-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathinstall-osx.txt
376 lines (297 loc) · 14.8 KB
/
install-osx.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
#!/usr/bin/env bash
set -e # exit on any nonzero command
################################################################################
######################### Command Line Tools ###################################
################################################################################
# Try to just run command line tools
xcode-select --install
sleep 1
osascript <<EOD
tell application "System Events"
tell process "Install Command Line Developer Tools"
keystroke return
click button "Agree" of window "License Agreement"
end tell
end tell
EOD
# If that didn't work, install command line tools for relevant version of xcode & macOS
# https://developer.apple.com/download/more/
# MacOS 10.12.6 & XCode 9.2 =>
# https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.12_for_Xcode_9.2/Command_Line_Tools_macOS_10.12_for_Xcode_9.2.dmg
################################################################################
######################### Cleanup Default Files ################################
################################################################################
if [ -f "$HOME/.profile" ]; then
rm "$HOME/.profile"
fi
if [ -f "$HOME/.bashrc" ]; then
rm "$HOME/.bashrc"
fi
if [ -f "$HOME/.bash_profile" ]; then
rm "$HOME/.bash_profile"
fi
if [ -f "$HOME/.localrc" ]; then
rm "$HOME/.localrc"
fi
if [ -f "$HOME/.bash_logout" ]; then
rm "$HOME/.bash_logout"
fi
if [ -f "$HOME/.viminfo" ]; then
rm "$HOME/.viminfo"
fi
################################################################################
############################### Homebrew #######################################
################################################################################
# Reset permissions on /usr/local
sudo chown -R "$USER" /usr/local
# Try uninstalling homebrew first in case the system shipped with something stupid
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
# Now install it fresh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update && brew upgrade
################################################################################
########################## Update System Utils #################################
################################################################################
brew install wget coreutils binutils diffutils bash make less
brew install findutils --with-default-names
brew install gnutls --with-default-names
brew install gnu-sed --with-default-names
brew install gnu-tar --with-default-names
brew install gnu-which --with-default-names
brew install grep --with-default-names
################################################################################
######################### Programming Languages ################################
################################################################################
# Java
brew cask install java
# python
brew install python --with-brewed-openssl
brew install python@2
pip3 install --upgrade pip setuptools wheel
pip install --upgrade pip setuptools
pip3 install --user pyyaml colorama
pip3 install rtv qrcode csvkit
pip3 install python-language-server
# haskell
# Install haskell-platform full via official package installer. Don't use homebrew
# ruby
brew install rbenv
brew install ruby-build
rbenv install 2.5.1
rbenv rehash
rbenv global 2.5.1
rbenv rehash
gem install bundler
# perl
\\curl -L http://install.perlbrew.pl | bash
# shellcheck disable=SC1090
source ~/perl5/perlbrew/etc/bashrc
perlbrew install perl-5.16.0
perlbrew switch perl-5.16.0
# javascript
brew install node
brew install yarn --without-node
yarn global add eslint
yarn global add javascript-typescript-langserver
# bash
brew install shellcheck
yarn global add bash-language-server
# css
yarn global add stylelint
yarn global add caniuse-cmd
yarn global add vscode-css-languageserver-bin
# html
brew install tidy-html5
yarn global add vscode-html-languageserver-bin
# viml
pip install vim-vint
################################################################################
################################# git ##########################################
################################################################################
brew install git git-lfs git-flow-avh bash-completion gnu-getopt
curl https://raw.githubusercontent.com/petervanderdoes/git-flow-completion/develop/git-flow-completion.bash > git-flow-completion.bash
chmod 755 git-flow-completion.bash
mv git-flow-completion.bash ~/.git-flow-completion.sh
################################################################################
############################## Utilities #######################################
################################################################################
brew install asciinema # record terminal sessions
brew install bat # a prettier cat/less utility
brew install calc # command line calculator
brew install cmus # audio player
brew install --HEAD universal-ctags/universal-ctags/universal-ctags # ctags
brew install diff-so-fancy # better, colorized, diff displays
brew install ffmpeg --with-libvpx --with-theora --with-libvorbis --with-fdk-aac --with-tools --with-freetype --with-libass --with-libvpx --with-x265 # video processor
brew install figlet # pretty-print words really big
brew install gpg # privacy & key management
brew install gsl # gnu scientific library, dependency for lots of stuff
brew install htop # better version of top utility
brew install imagemagick # image processor
brew install jq # json parser
pip3 install khal # calendar on commandline
brew install lastpass-cli --with-pinentry # password manager
brew install libcaca # codec for ascii video
brew install lynx # web and gopher browser for cli
brew install mosh # ssh for intermittent connections
brew install mplayer --with-libcaca # multimedia player
brew install mysql # database
brew install ncdu # browsable file/folder size
brew install --HEAD neovim # text editor
brew install newsbeuter # rss reader
brew install p7zip # compression utility
brew install pinentry-mac # command line password interface for gpg
brew install prettyping # graphical ping replacer
brew install reattach-to-user-namespace # fix for clipboard issues in term
brew install sshuttle # poor man's vpn over ssh
brew install ssh-copy-id # easily deploy ssh keys to servers
brew install stow # manages dotfiles
brew install surfraw # search engine cli interface
brew install the_silver_searcher # grep replacer
brew install tig # git browser
brew install tmux # terminal multiplexer
brew install tpp # text based power point
brew install tree # show file hierearchy
brew install unrar # compression utility
brew install vdirsyncer # sync webdav
brew install youtube-dl # download youtube content
################################################################################
############################# Applications #####################################
################################################################################
brew cask install deluge
brew cask install filezilla
brew cask install nextcloud
brew cask install spideroakone
brew cask install syncthing-app
brew cask install veracrypt
brew cask install vlc
brew cask install gpg-suite
brew install mas
# Log in to Apple App Store before running mas installers
# Microsoft Remote Desktop
mas install 715768417
# Wire
mas install 931134707
################################################################################
########################### Quicklook Plugins ##################################
################################################################################
brew cask install qlcolorcode qlmarkdown qlprettypatch qlstephen quicklook-csv quicklook-json
################################################################################
############################## Completions #####################################
################################################################################
brew install pip-completion
brew install vagrant-completion
################################################################################
###################### Folder Structures and Links #############################
################################################################################
mkdir -p ~/Sites/system/
mkdir -p ~/Sites/work/
mkdir -p ~/Sites/personal/
mkdir -p ~/Sites/sync/spideroak
mkdir -p ~/Sites/sync/syncthing
mkdir -p ~/Sites/sync/nextcloud
ln -s ~/Sites/sync/nextcloud ~/.nextcloud
ln -s ~/Sites/sync/spideroak ~/.spideroak
ln -s ~/Sites/sync/syncthing ~/.syncthing
################################################################################
############################### Dotfiles #######################################
################################################################################
cd ~/Sites/system && git clone https://github.com/jamestomasino/dotfiles.git
cd ~/Sites/system/dotfiles && make
################################################################################
########################### Plugin Installs ####################################
################################################################################
vim -c ":PlugInstall|q|q" # auto install plugins
"$HOME/.tmux/plugins/tpm/bin/install_plugins"
# Language server protocol installs
nvim -c ":CocInstall coc-json coc-tsserver coc-html coc-css coc-solargraph coc-yaml coc-highlight coc-dictionary coc-eslint coc-stylelint|q" # auto install plugins
################################################################################
########################### iTerm Colors ####################################
################################################################################
# Import this into iterm profile
wget https://raw.githubusercontent.com/mattly/iterm-colors-pencil/master/pencil-dark.itermcolors
################################################################################
####################### System Configuration ###################################
################################################################################
# Disable weird new apple setting to set keyboard rate
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 1
# Set a shorter Delay until key repeat
defaults write NSGlobalDomain InitialKeyRepeat -int 15
# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Show the ~/Library folder
chflags nohidden ~/Library
# Store screenshots in subfolder on desktop
mkdir ~/Desktop/Screenshots
defaults write com.apple.screencapture location ~/Desktop/Screenshots
# Disable the 'Are you sure you want to open this application?' dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Show percentage in battery status
defaults write com.apple.menuextra.battery ShowPercent -string "YES"
defaults write com.apple.menuextra.battery ShowTime -string "NO"
# Disable Notification Center and remove the menu bar icon
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
# Disable rubberband scrolling
defaults write -g NSScrollViewRubberbanding -bool false
# Disable dashboard
defaults write com.apple.dashboard mcx-disabled -boolean YES
# Move dock to left side of screen
defaults write com.apple.dock orientation -string left
# Show all filename extensions in Finder
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: icnv, Nlmv, Flwv
defaults write com.apple.finder FXPreferredViewStyle -string "Nlmv"
# Remove default text from basic screen saver
defaults write ~/Library/Preferences/com.apple.ScreenSaver.Basic MESSAGE " "
# Disable sound effect when changing volume
defaults write -g com.apple.sound.beep.feedback -integer 0
# Disable user interface sound effects
defaults write com.apple.systemsound 'com.apple.sound.uiaudio.enabled' -int 0
# Set system sounds volume to 0
defaults write com.apple.systemsound com.apple.sound.beep.volume -float 0
# Autohide Dock
defaults write com.apple.dock autohide -bool true
# Show/Hide Dock instantly
defaults write com.apple.Dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
# Disable Smart Quotes
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable Smart Dashes
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Trackpad: enable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Set Desktop as the default location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/`
defaults write com.apple.finder NewWindowTarget -string "PfDe"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"
# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Show item info to the right of the icons on the desktop
/usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
# Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Bottom left screen corner → Start screen saver
defaults write com.apple.dock wvous-bl-corner -int 2
defaults write com.apple.dock wvous-bl-modifier -int 0
# Wipe all (default) app icons from the Dock
defaults write com.apple.dock persistent-apps -array
# Ask for admin password upfront
sudo -v
# Keepalive for sudo until done
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Set volume to 0 at boot
sudo nvram SystemAudioVolume=" "
# Kill affected applications, so the changes apply
for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" >/dev/null 2>&1; done