forked from ptb/mac-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep-2.command
executable file
·425 lines (375 loc) · 9.93 KB
/
step-2.command
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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
#!/bin/sh
if [ -z "$1" ]; then
osascript > /dev/null <<-END
tell app "Terminal" to do script "source ${0} 0"
END
clear
else
function init_install_path () {
if [ ! -d "/Volumes/Storage" ] \
&& [ -d "/Volumes/VMware Shared Folders/Storage" ]; then
cd "/Volumes" \
&& sudo ln -s "VMware Shared Folders/Storage" "Storage"
fi
if [ -d "/Volumes/Storage/Software" ]; then
INSTALL_PATH="/Volumes/Storage/Software"
else
INSTALL_PATH="${HOME}/Downloads"
fi
mkdir -p "${HOME}/Library/Caches/Homebrew/"
}
function install_command_line_tools () {
init_install_path
INSTALL_PATH_XCODE="${INSTALL_PATH}/apple.com"
if [ ! -d "${INSTALL_PATH_XCODE}" ]; then
mkdir -p "${INSTALL_PATH_XCODE}"
fi
if [ ! -f "${INSTALL_PATH_XCODE}/CLTools_Executables.pkg" ] \
|| [ ! -f "${INSTALL_PATH_XCODE}/DevSDK_OSX1012.pkg" ]; then
cd "${INSTALL_PATH_XCODE}" \
&& curl --compressed --location --silent \
"https://swscan.apple.com/content/catalogs/others/index-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" \
| sed -n \
-e "s/^.*<string>\(.*CLTools_Executables.pkg\).*/\1/p" \
-e "s/^.*<string>\(.*DevSDK_OSX1012.pkg\).*/\1/p" \
| tail -n 2 \
| xargs -L 1 curl --compressed --location --remote-name
fi
if [ -f "${INSTALL_PATH_XCODE}/CLTools_Executables.pkg" ] \
&& [ -f "${INSTALL_PATH_XCODE}/DevSDK_OSX1012.pkg" ]; then
sudo installer -pkg "${INSTALL_PATH_XCODE}/CLTools_Executables.pkg" -target /
sudo installer -pkg "${INSTALL_PATH_XCODE}/DevSDK_OSX1012.pkg" -target /
fi
}
function install_homebrew () {
sudo chown $(whoami) '/usr/local' '/usr/local/Caskroom' "${HOME}/Library/Caches/Homebrew/"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew analytics off
brew update
brew doctor
brew tap "caskroom/cask"
brew tap "homebrew/bundle"
}
function create_brewfile () {
cat > /usr/local/Brewfile <<-EOF
tap "caskroom/cask"
tap "caskroom/fonts"
tap "caskroom/versions"
tap "homebrew/bundle"
tap "homebrew/dupes"
tap "homebrew/nginx"
tap "infinit/releases"
tap "ptb/custom"
tap "railwaycat/emacsmacport"
tap "vitorgalvao/tiny-scripts"
cask "java"
cask "ptb/custom/mas-xcode"
# cask "adobe-illustrator-cc"
# cask "adobe-indesign-cc"
# cask "adobe-photoshop-cc"
# cask "ptb/custom/enhanced-dictation"
cask "ptb/custom/text-to-speech-allison"
cask "ptb/custom/mas-keynote"
cask "ptb/custom/mas-numbers"
cask "ptb/custom/mas-pages"
cask "ptb/custom/mas-affinity-photo"
cask "sonarr"
cask "sonarr-menu"
cask "vmware-fusion"
# cask "ptb/custom/bbedit-10"
cask "ptb/custom/blankscreen"
cask "ptb/custom/composer"
cask "ptb/custom/ipmenulet"
cask "ptb/custom/mas-1password"
cask "ptb/custom/mas-autoping"
cask "ptb/custom/mas-coffitivity"
cask "ptb/custom/mas-growl"
cask "ptb/custom/mas-hardwaregrowler"
cask "ptb/custom/mas-i-love-stars"
cask "ptb/custom/mas-icon-slate"
cask "ptb/custom/mas-justnotes"
cask "ptb/custom/mas-wifi-explorer"
cask "ptb/custom/pcalc-3"
cask "ptb/custom/safari-technology-preview"
cask "ptb/custom/sketchup-pro"
cask "ptb/custom/synergy"
cask "ptb/custom/tune4mac"
brew "aspell", args: ["lang=en"]
brew "vitorgalvao/tiny-scripts/cask-repair"
brew "chromedriver"
brew "duti"
brew "railwaycat/emacsmacport/emacs-mac", args: ["with-spacemacs-icon"]
brew "ptb/custom/ffmpeg",
args: [
"with-dcadec",
"with-faac",
"with-fdk-aac",
"with-ffplay",
"with-fontconfig",
"with-freetype",
"with-frei0r",
"with-lame",
"with-libass",
"with-libbluray",
"with-libbs2b",
"with-libcaca",
"with-libsoxr",
"with-libssh",
"with-libvidstab",
"with-libvorbis",
"with-libvpx",
"with-opencore-amr",
"with-openh264",
"with-openjpeg",
"with-openssl",
"with-opus",
"with-pkg-config",
"with-qtkit",
"with-rtmpdump",
"with-rubberband",
"with-schroedinger",
"with-sdl",
"with-snappy",
"with-speex",
"with-texi2html",
"with-theora",
"with-tools",
"with-webp",
"with-x264",
"with-x265",
"with-xvid",
"with-yasm",
"with-zeromq",
"with-zimg" ]
brew "git"
# brew "git-annex"
brew "gnu-sed", args: ["with-default-names"]
brew "gnupg"
brew "gpac"
brew "hub"
brew "ievms"
brew "imagemagick"
brew "mercurial"
brew "mp4v2"
brew "mtr"
brew "nmap"
brew "homebrew/nginx/nginx-full",
args: [
"with-dav-ext-module",
"with-fancyindex-module",
"with-gzip-static",
"with-http2",
"with-mp4-h264-module",
# "with-passenger",
"with-push-stream-module",
"with-secure-link",
"with-webdav" ]
brew "node"
brew "openssl"
brew "homebrew/dupes/rsync"
brew "python"
brew "ruby"
brew "selenium-server-standalone"
brew "sqlite"
brew "stow"
brew "terminal-notifier"
brew "trash"
brew "vim"
brew "wget"
brew "youtube-dl"
brew "zsh"
cask "adium"
cask "airfoil"
cask "alfred"
cask "arduino"
cask "atom"
cask "autodmg"
cask "bbedit"
cask "caffeine"
cask "carbon-copy-cloner"
cask "charles"
cask "dash"
# cask "datetree"
# cask "disk-inventory-x"
cask "docker-toolbox"
cask "dropbox"
cask "duet"
cask "exifrenamer"
cask "expandrive"
cask "firefox"
cask "flux"
cask "github-desktop"
cask "gitup"
cask "google-chrome"
cask "handbrake"
cask "handbrakecli"
cask "hermes"
cask "imageoptim"
cask "integrity"
cask "istat-menus"
cask "jubler"
cask "little-snitch"
cask "machg"
cask "makemkv"
cask "menubar-countdown"
cask "meteorologist"
# cask "microsoft-office"
cask "moom"
cask "mp4tools"
cask "munki"
cask "musicbrainz-picard"
cask "namechanger"
cask "nvalt"
cask "nzbget"
cask "nzbvortex"
cask "openemu"
cask "opera"
cask "caskroom/versions/osxfuse-beta"
cask "pacifist"
cask "platypus"
cask "plex-media-server"
cask "quitter"
# cask "raindropio"
cask "rescuetime"
cask "scrivener"
cask "sitesucker"
cask "sizeup"
cask "sketch"
cask "sketchup"
cask "skitch"
cask "skype"
cask "slack"
cask "sourcetree"
cask "steermouse"
cask "subler"
cask "caskroom/versions/sublime-text-dev"
cask "time-sink"
# cask "timing"
cask "the-unarchiver"
# cask "tidy-up"
cask "torbrowser"
cask "tower"
cask "transmit"
cask "vimr"
cask "vlc"
# cask "webkit-nightly"
cask "xld"
cask "xquartz"
cask "inkscape"
# brew "wine"
cask "wireshark"
cask "caskroom/fonts/font-inconsolata-lgc"
brew "infinit/releases/infinit"
EOF
}
function install_osx_software () {
init_install_path
INSTALL_PATH_HOMEBREW="${INSTALL_PATH}/github.com/Homebrew"
if [ -d "${INSTALL_PATH_HOMEBREW}" ]; then
cd "$(cd "${INSTALL_PATH_HOMEBREW}" && pwd)" \
&& cp -av * "${HOME}/Library/Caches/Homebrew/"
fi
cd /usr/local/ && brew bundle
brew upgrade --all
brew linkapps
cd $(cd /usr/local/Caskroom/little-snitch/* && pwd) && open "Little Snitch Installer.app"
}
function install_node_software () {
npm i -g babel-cli bower browser-sync browserify chimp coffee-script eslint eslint-plugin-promise eslint-plugin-standard gulp-cli jasmine polyserve riot selenium-webdriver superstatic svgo uglify-js watchify webpack
}
function install_python_software () {
curl -Ls https://bootstrap.pypa.io/get-pip.py | sudo -H python
pip install --upgrade pip setuptools
pip install --upgrade babelfish bottle 'guessit<2' influxdb netifaces pika psutil py2app pyobjc-core pysnmp pystache qtfaststart requests scour selenium statsd 'subliminal<2' watchdog yapf zeroconf
pip install --upgrade glances pyobjc 'requests[security]'
}
function install_ruby_software () {
printf "%s\n" \
"gem: --no-document" \
>> "${HOME}/.gemrc"
gem update --system
gem update
gem install nokogiri -- --use-system-libraries
gem install web-console --version "~> 2"
gem install rails sqlite3 sass-rails uglifier coffee-rails jquery-rails turbolinks jbuilder sdoc byebug spring tzinfo-data
gem install em-websocket middleman middleman-autoprefixer middleman-blog middleman-compass middleman-livereload middleman-minify-html middleman-robots mime-types slim
gem install bootstrap-sass git-cipher org-ruby selenium-webdriver thin
}
function create_vi_script () {
cat > /usr/local/bin/vi <<-EOF
#!/bin/sh
if [ -e '/Applications/Emacs.app' ]; then
t=()
if [ \${#@} -ne 0 ]; then
while IFS= read -r file; do
[ ! -f "\$file" ] && t+=("\$file") && /usr/bin/touch "\$file"
file=\$(echo \$(cd \$(dirname "\$file") && pwd -P)/\$(basename "\$file"))
\$(/usr/bin/osascript <<-END
if application "Emacs.app" is running then
tell application id (id of application "Emacs.app") to open POSIX file "\$file"
else
tell application ((path to applications folder as text) & "Emacs.app")
activate
open POSIX file "\$file"
end tell
end if
END
) & # Note: END on the previous line may be indented with tabs but not spaces
done <<<"\$(printf '%s\n' "\$@")"
fi
if [ ! -z "\$t" ]; then
\$(/bin/sleep 10; for file in "\${t[@]}"; do
[ ! -s "\$file" ] && /bin/rm "\$file";
done) &
fi
else
vim -No "\$@"
fi
EOF
chmod a+x /usr/local/bin/vi
}
function link_utilities () {
cd /Applications/Utilities \
&& for a in /System/Library/CoreServices/Applications/*; do
sudo ln -s "../..$a" .
done \
&& for b in /Applications/Xcode.app/Contents/Applications/*; do
sudo ln -s "../..$b" .
done \
&& for c in /Applications/Xcode.app/Contents/Developer/Applications/*; do
sudo ln -s "../..$c" .
done
}
function reenable_sudo_timeout () {
sudo sed -i -e "/Defaults timestamp_timeout=-1/d" /etc/sudoers
sudo sed -i -e "/%admin ALL=(ALL) NOPASSWD:SETENV: \/usr\/sbin\/installer/d" /etc/sudoers
}
function install_all () {
install_command_line_tools
install_homebrew
create_brewfile
install_osx_software
# install_node_software
install_python_software
# install_ruby_software
create_vi_script
link_utilities
# reenable_sudo_timeout
}
clear
cat <<-END
Enter any of these commands:
install_command_line_tools
install_homebrew
create_brewfile
install_osx_software
# install_node_software
install_python_software
# install_ruby_software
create_vi_script
link_utilities
# reenable_sudo_timeout
Or:
install_all
END
fi