-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathstart.sh
executable file
·277 lines (231 loc) · 6.15 KB
/
start.sh
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
#!/bin/sh
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
blue='\033[0;34m'
magenta='\033[0;35m'
cyan='\033[0;36m'
# Reset text attributes to normal + without clearing screen.
alias Reset="tput sgr0"
# Color-echo.
# arg $1 = message
# arg $2 = Color
cecho() {
echo "${2}${1}"
Reset # Reset to normal.
return
}
echo ""
cecho "##############################################" $red
cecho "# Please don't run this blindly " $red
cecho "##############################################" $red
echo ""
echo "Agree?"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) echo "byebye"; exit 1;;
esac
done
# Install brew if is not already Installed
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo ""
echo "Updating homebrew"
brew update
# Install GNU core utilities (those that come with OS X are outdated)
echo ""
echo "Installing GNU core utilities"
brew install coreutils
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
echo ""
echo "Installing GNU find, locate, updatedb, and xargs, g-prefixed"
brew install findutils
# Install Bash 4
echo ""
echo "Installing Bash 4"
brew install bash
# Install more recent versions of some OS X tools
echo ""
echo "Installing more recent versions of some OS X tools"
brew tap homebrew/dupes
brew install homebrew/dupes/grep
echo 'export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"' >> ~/.zshrc
# Brew packages commonly used
binaries=(
wget
curl
ffmpeg
node
nginx
nvm
)
echo "Installing binaries..."
brew install ${binaries[@]}
echo "Cleaning up"
brew cleanup
echo "Installing Oh-my-zsh "
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
echo "Installing cask "
brew install caskroom/cask/brew-cask
# Alternate cask versions
brew tap caskroom/versions
# I like the symlinks to be in /Applications instead of the default cask config
echo 'export HOMEBREW_CASK_OPTS="--appdir=/Applications"' >> ~/.zshrc
# tmux, vim
brew install tmux
brew install vim
# Some cask apps
apps=(
dropbox
vlc
vox
the-unarchiver
slack
telegram
rambox
)
echo "Installing apps..."
brew cask install ${apps[@]}
# Cask I use for development
devel_apps=(
iterm2
sublime-text
macdown
firefox
google-chrome
hyper
sourcetree
visual-studio-code
sequel-pro
)
echo "Installing devel apps..."
brew cask install ${devel_apps[@]}
# Yarn
echo ""
echo "Installing Yarn"
brew install yarn
# Heroku
echo ""
echo "Installing Heroku-Toolbelt"
brew install heroku-toolbelt
brew install parity
# Databases
echo "Downloading Databases ..."
brew install mysql
brew info mysql
brew install postgresql
brew install redis
# Ruby
echo "Installing Ruby ..."
brew install rbenv
brew install ruby-build
echo "Configuring Ruby ..."
find_latest_ruby() {
rbenv install -l | grep -v - | tail -1 | sed -e 's/^ *//'
}
ruby_version="$(find_latest_ruby)"
append_to_zshrc 'eval "$(rbenv init - --no-rehash)"' 1
eval "$(rbenv init -)"
if ! rbenv versions | grep -Fq "$ruby_version"; then
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/opt/openssl rbenv install -s "$ruby_version"
fi
rbenv global "$ruby_version"
rbenv shell "$ruby_version"
gem update --system
echo ""
cecho "##############################################" $red
cecho "# STARTING SYSTEM CONFIG SCRIPT #" $red
cecho "##############################################" $red
echo ""
echo "Continue?"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) echo "byebye"; exit 1;;
esac
done
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
echo ""
echo "Saving to disk (not to iCloud) by default"
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
echo ""
echo "Disabling press-and-hold for keys in favor of a key repeat"
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
echo ""
echo "Setting a blazingly fast keyboard repeat rate (ain't nobody got time fo special chars while coding!)"
defaults write NSGlobalDomain KeyRepeat -int 0
# m-cli
echo "Installing m-cli ..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/rgcr/m-cli/master/install.sh | sh)"
echo "export PATH=$PATH:/usr/local/m-cli" >> ~/.profile
echo "export PATH=$PATH:/usr/local/m-cli" >> ~/.zshrc
###############################################################################
# Sublime Text
###############################################################################
echo ""
echo "Enable Sublime Text 2 command line?"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) echo "byebye"; exit 1;;
esac
done
###############################################################################
# m-cli
###############################################################################
echo ""
echo "Install m-cli? (Swiss Army Knife for Mac OS X)"
select yn in "Yes" "No"; do
case $yn in
Yes ) echo ""
echo "Installing m-cli"
break;;
No ) break;;
esac
done
###############################################################################
# Quicklook helpers
# List of useful Quick Look plugins for developers
# see: https://github.com/sindresorhus/quick-look-plugins
###############################################################################
echo ""
cecho "##############################################" $red
cecho "# STARTING QUICKLOOK HELPERS #" $red
cecho "##############################################" $red
echo ""
echo "Install s useful Quick Look plugins for developers"
echo "Continue?"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) echo "byebye"; exit 1;;
esac
done
# Cask I use for development
devel_quicklook=(
qlcolorcode
qlstephen
qlmarkdown
quicklook-json
qlprettypatch
quicklook-csv
betterzipql
qlimagesize
webpquicklook
suspicious-package
)
echo "Installing quicklook helpers..."
brew cask install ${devel_quicklook[@]}
echo ""
cecho "Done!" $white
echo ""
cecho "###############################################################################" $white