-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·390 lines (292 loc) · 11.5 KB
/
install
File metadata and controls
executable file
·390 lines (292 loc) · 11.5 KB
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
#!/bin/bash
source ~/.bash_profile
# Header logging
e_header() {
printf "\n$(tput setaf 7)%s$(tput sgr0)\n" "$@"
}
# Success logging
e_success() {
printf "$(tput setaf 64)✓ %s$(tput sgr0)\n" "$@"
}
# Error logging
e_error() {
printf "$(tput setaf 1)x %s$(tput sgr0)\n" "$@"
}
# Warning logging
e_warning() {
printf "$(tput setaf 136)! %s$(tput sgr0)\n" "$@"
}
# Ask for confirmation before proceeding
seek_confirmation() {
printf "\n"
e_warning "$@"
read -p "Continue? (y/n) " -n 1
printf "\n"
}
# Test whether the result of an 'ask' is a confirmation
is_confirmed() {
if [[ "$REPLY" =~ ^[Yy]$ ]]; then
return 0
fi
return 1
}
# Test whether a command exists
# $1 - cmd to test
type_exists() {
if [ $(type -P $1) ]; then
return 0
fi
return 1
}
# Before relying on Homebrew, check that packages can be compiled
if ! type_exists 'gcc'; then
e_error "The XCode Command Line Tools must be installed first."
exit 1
fi
# Install Homebrew
e_header "Installing Homebrew, a good OS X package manager ..."
#ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go/install)"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap homebrew/dupes
# Create SSH Keys nd prompt user to add them to Github
e_header "Checking for SSH key in ~/.ssh/id_rsa.pub, generating one if it doesn't exist ..."
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa
e_header "Copying public key to clipboard."
[[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | pbcopy
# Add SSH keys to Github
e_header "Add your ssh key to Github"
seek_confirmation "Open https://github.com/account/ssh in your browser"
if is_confirmed; then
open https://github.com/account/ssh
fi
seek_confirmation "Test Github Authentication via ssh"
if is_confirmed; then
printf "\n Testing..."
ssh -T git@github.com
fi
# Install Homebrew Git
e_header "Installing Git..."
brew install git
# Before we do any config install our dotfiles
e_header "Installing Newism dot files..."
git clone git://github.com/leevigraham/dotfiles.git ~/.dotfiles
~/.dotfiles/bin/dotfiles
~/.dotfiles/bin/osx
source ~/.bash_profile
e_header "Adding Global Git Config..."
echo "Whats your name? [Enter]: "
read name
echo "What's your email? [Enter]: "
read email
echo "git config --global user.name '$name'" >> .bash_profile.local
echo "git config --global user.email '$email'" >> .bash_profile.local
# Install zsh
# e_header "Installing zsh..."
# brew install zsh
# sudo mv /etc/zshenv /etc/zprofile
e_header "Install bash-completion..."
brew install git bash-completion
e_header "Creating ~/Site folders"
mkdir -p ~/Sites/Work
mkdir -p ~/Sites/Home
e_header "Install Solarized terminal theme"
git clone git://github.com/tomislav/osx-lion-terminal.app-colors-solarized.git ~/Sites/Work/solarized-terminal
sleep 1 # Wait a bit to make sure the theme is loaded
defaults write com.apple.terminal "Default Window Settings" -string "Solarized Light"
defaults write com.apple.terminal "Startup Window Settings" -string "Solarized Light"
e_header "Installing ImageMagick, good for cropping and re-sizing images ..."
brew install imagemagick
e_header "Installing optipng, a PNG optimizer that recompresses the image files to a smaller size, without losing any information. ..."
brew install optipng
e_header "Creating SSL Certificate and updating Apache..."
# See: http://webdevstudios.com/2013/05/24/how-to-set-up-ssl-with-osx-mountain-lions-built-in-apache/
mkdir ssl
cd ssl
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
sudo cp server.crt /private/etc/apache2/server.crt
sudo cp server.key /private/etc/apache2/server.key
# Include SSL Conf in /private/etc/apache2/httpd.conf
sudo sed -i .bak 's/\#Include \/private\/etc\/apache2\/extra\/httpd-ssl.conf/Include \/private\/etc\/apache2\/extra\/httpd-ssl.conf/g' /private/etc/apache2/httpd.conf
e_header "Installing Gitflow..."
brew install git-flow
e_header "Installing Hub..."
brew install hub
e_header "Installing RVM (Ruby Version Manager) and Ruby 2.1.3, which becomes the default ..."
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
e_header "Installing packages required for RVM"
brew install autoconf automake libtool pkg-config openssl readline libyaml sqlite libxml2 libxslt libksba
e_header "Installing Ruby 2.1.3 via RVM"
rvm install 2.1.3 --disable-binary
rvm use 2.1.3 --default
ruby -v
e_header "Installing bundler for handling dependencies..."
sudo gem install bundler --no-rdoc --no-ri
e_header "Installing guard for watching files for changes..."
sudo gem install guard --no-rdoc --no-ri
e_header "Installing KSS for generating styleguides..."
sudo gem install kss --no-rdoc --no-ri
e_header "Installing rake..."
sudo gem install rake --no-rdoc --no-ri
e_header "Installing latest version of Sass..."
sudo gem install sass --no-rdoc --no-ri
e_header "Installing latest version of Compass..."
sudo gem install compass --no-rdoc --no-ri
e_header "Installing latest version of Capistrano..."
sudo gem install capistrano --no-rdoc --no-ri
e_header "Updating Rubygems..."
sudo gem update
e_header "Installing Meteor"
curl https://install.meteor.com/ | sh
e_header "Installing Phantom JS for Javascript testing..."
brew install phantomjs
e_header "Installing MongoDb..."
brew install mongodb
e_header "Installing Node and (Node Package Manager)..."
brew install node
sudo brew postinstall node
brew link node
e_header "Installing Bower..."
npm install -g bower
e_header "Installing Gulp..."
npm install -g gulp
e_header "Installing Grunt..."
npm install -g grunt-cli
e_header "Installing Underscore..."
npm install -g underscore
e_header "Installing Backbone..."
npm install -g backbone
e_header "Installing Coffeescript..."
npm install -g coffee-script
e_header "Installing JSHint to validate Javascript code..."
npm install -g jshint
e_header "Installing Uglify for minifying Javascript code..."
npm install -g uglify-js
e_header "Installing Handlebars templating engine..."
npm install -g handlebars
e_header "Installing Jade templating engine..."
npm install -g jade
e_header "Installing JS2Coffee for converting projects to Coffeescript..."
npm install -g js2coffee
e_header "Installing StrongLoop..."
npm install -g strongloop
e_header "Cleaning Brew links..."
ls -1 /usr/local/Library/LinkedKegs | while read line; do
brew unlink $line
brew link --force $line
done
e_header "Tapping josegonzalez/homebrew-php..."
brew tap josegonzalez/homebrew-php
e_header "Installing PHP 5.6..."
brew install php56
brew link php56
e_header "Updating the date.timezone setting in /usr/local/etc/php/5.6/php.ini"
sed -i .bak 's/\;date.timezone =/date.timezone = "America\/Chicago"/g' /usr/local/etc/php/5.6/php.ini
sed -i .bak 's/\;auto_detect_line_endings = Off/auto_detect_line_endings = On/g' /usr/local/etc/php/5.6/php.ini
e_header "Installing PHP 5.6 xDebug..."
brew install php56-xdebug
e_header "Installing PHP 5.6 Twig..."
brew install php56-twig
e_header "Installing PHP 5.6 Imagick"
brew install php56-imagick
e_header "Installing PHP 5.6 MCrypt..."
brew install php56-mcrypt
e_header "Fixing PEAR permissions"
chmod -R ug+w $(brew --prefix php5)/lib/php
pear config-set php_ini /usr/local/etc/php/5.6/php.ini
pear config-set auto_discover 1
e_header "Installing Composer (PHP package manager)..."
brew install composer
composer self-update
e_header "Installing Capifony..."
sudo gem install capifony
e_header "Installing Mysql.."
brew install mysql --enable-debug
e_header "Installing Rails"
sudo gem install rails
e_header "Installing Yeoman"
npm install -g yo
e_header "Installing PHP POW by Dan Ott"
sudo gem install phpow
e_header "Installing Rails POW by Sam Stephenson"
curl get.pow.cx | sh
e_header "Installing rbenv by Sam Stephenson"
brew install rbenv ruby-build
e_header "Enable keyboard access for all controls/modals"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
e_success "Done"
e_header "Disable OS X press-and-hold keys to increase key repeat rate."
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
e_success "Done"
e_header "Set up a fast key repeat rate."
defaults write NSGlobalDomain KeyRepeat -int 0.02
e_success "Done"
e_header "Decrease the delay until keys are repeated."
defaults write NSGlobalDomain InitialKeyRepeat -int 12
e_success "Done"
e_header "Disable autocorrect (srsly.)"
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
e_success "Done"
e_header "Enable sub-pixel rendering even if you don't have a fancy Apple display"
defaults write NSGlobalDomain AppleFontSmoothing -int 2
e_success "Done"
e_header "Automatically hide and show the dock"
defaults write com.apple.dock autohide -bool true
e_success "Done"
e_header "Make hidden applications semi-transparent on the dock"
defaults write com.apple.dock showhidden -bool true
e_success "Done"
e_header "Allow Finder to quit (using ⌘Q)"
defaults write com.apple.finder QuitMenuItem -bool true
e_success "Done"
e_header "Show all filename extensions in the finder"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
e_success "Done"
e_header "Show the path bar in the Finder"
defaults write com.apple.finder ShowPathbar -bool true
e_success "Done"
e_header "Expand the Save panel by default in all applications"
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
e_success "Done"
e_header "Expand the Printer panel by default in all applications"
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
e_success "Done"
e_header "Enable airdrop-over-ethernet for bridged networks"
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
e_success "Done"
e_header "Avoid creating DSStore files on network volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
e_success "Done"
e_header "Display the full POSIX path as the Finder window's title"
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
e_success "Done"
e_header "Disable the warning when you change a file extension"
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
e_success "Done"
e_header "Disable the warning shown before you empty the trash"
defaults write com.apple.finder WarnOnEmptyTrash -bool false
e_success "Done"
e_header "Empty the trash securely by default (yes, this will be time consuming)"
defaults write com.apple.finder EmptyTrashSecurely -bool true
e_success "Done"
e_header "Reveal the ~/Library folder"
chflags nohidden ~/Library
e_success "Done"
e_header "Increase the window resize speed for Cocoa apps"
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
e_success "Done"
e_header "Require password immediately after sleep or screensaver begins."
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
e_success "Done"
e_header "Only use UTF-8 in Terminal.app"
defaults write com.apple.terminal StringEncodings -array 4
e_success "Done"
sudo apachectl restart
cd ../
source ~/.bash_profile
e_success "Boom... Done"