-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup_mac.sh
executable file
·199 lines (161 loc) · 6.24 KB
/
setup_mac.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
#!/bin/bash
#
# Homebrew
#
# This installs some of the common dependencies needed (or at least desired)
# using Homebrew.
echo "Running Mac setup. This would take a while. Please sit back and relax."
# Check for Homebrew
if test ! "$(which brew)"
then
echo "Installing Homebrew for you."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Make sure we’re using the latest Homebrew
brew update
# Upgrade any already-installed formulae
brew upgrade
# Install GNU core utilities (those that come with OS X are outdated)
brew install coreutils
echo "Don’t forget to add $(brew --prefix coreutils)/libexec/gnubin to \$PATH."
brew tap caskroom/cask
# Utility function to install cask formulas
function installcask() {
if brew cask info "${@}" | grep "Not installed" > /dev/null; then
brew cask install "${@}"
else
echo "$* is already installed."
fi
}
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
brew install findutils
# Install Bash 4
brew install bash
brew install zsh zsh-completions
brew install shellcheck
# Install wget with IRI support
brew install wget --with-iri
brew install curl --with-ssl --with-ssh
# Install GNU `sed`, overwriting the built-in `sed`.
brew install gnu-sed --with-default-names
# Install more recent versions of some OS X tools
brew tap homebrew/dupes
brew install homebrew/dupes/grep
brew tap josegonzalez/homebrew-php
# Install everything else
brew install openssl
brew install ack
brew install git git-extras hub git-ftp git-crypt
brew install rename htop-osx tree ngrep mtr nmap
brew install autojump
brew install legit # http://www.git-legit.org/
brew install Zopfli # https://code.google.com/p/zopfli/
brew install fortune cowsay
brew install node
installcask ngrok # https://ngrok.com/ 2.x available from Cask now
brew install sshrc # https://github.com/Russell91/sshrc
brew install httpie # https://github.com/jakubroztocil/httpie
brew install jq # https://stedolan.github.io/jq/
brew install python3
brew install editorconfig
brew install ssh-copy-id # http://linux.die.net/man/1/ssh-copy-id
brew install elixir
brew install gpg
# Native apps
brew tap phinze/homebrew-cask
brew install brew-cask
###############################################################################
# Install utilities #
###############################################################################
installcask firefox
installcask android-file-transfer
installcask iterm2
installcask qlcolorcode qlstephen qlmarkdown quicklook-json qlprettypatch quicklook-csv betterzipql webp-quicklook suspicious-package && qlmanage -r
# Postgres 9 Database
brew install postgres
installcask pgadmin3
# ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
# launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
psql postgres -c 'CREATE EXTENSION "adminpack";'
sudo gem install pg
# PG tools needed for every other project:
brew tap osgeo/osgeo4mac
brew install gdal
brew install postgis
# Fonts
brew tap caskroom/fonts
installcask font-source-code-pro
sudo easy_install pip
sudo pip install -r requirements.pip
################################################################################
# Data Stores #
################################################################################
brew install mysql
brew install mongo
brew install redis
brew install elasticsearch
################################################################################
# Dev tools #
################################################################################
installcask install virtualbox
installcask install vagrant
installcask install postman
# New Docker for Mac. For older version run `brew install docker`
installcask install docker
brew install diff-so-fancy
brew link xz && brew install weechat
installcask install sublime-text
brew install tmux
brew install cookiecutter
# Some frontend stuff
brew install node
npm i -g postcss-cli
npm i -g autoprefixer
# Install custom stuff
# Slack
installcask install slack
################################################################################
# Customize Shell #
################################################################################
install_oh_my_zsh () {
# Test to see if zshell is installed. If it is:
if [ -f /bin/zsh ] || [ -f /usr/bin/zsh ]; then
# Install Oh My Zsh if it isn't already present
if [[ ! -d $HOME/oh-my-zsh/ ]]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
# Set the default shell to zsh if it isn't currently set to zsh
if [[ ! "$SHELL" == $(which zsh) ]]; then
chsh -s "$(which zsh)"
fi
else
# If zsh isn't installed, get the platform of the current machine
platform=$(uname);
# If the platform is Linux, try an apt-get to install zsh and then recurse
if [[ $platform == 'Linux' ]]; then
if [[ -f /etc/redhat-release ]]; then
sudo yum install zsh
fi
if [[ -f /etc/debian_version ]]; then
sudo apt-get install zsh
fi
# If the platform is OS X, tell the user to install zsh :)
elif [[ $platform == 'Darwin' ]]; then
echo "We'll install zsh, then re-run this script!"
brew install zsh
exit
fi
fi
}
install_oh_my_zsh
###############################################################################
# Zsh #
###############################################################################
set -P
# Zsh Syntax highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}"/plugins/zsh-syntax-highlighting
# Install Powerlevel9k theme
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
# Remove outdated versions from the cellar
brew cleanup && brew cask cleanup
exit 0