-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbrew-setup
executable file
·444 lines (354 loc) · 17.4 KB
/
brew-setup
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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# !/bin/bash
#
# Mac OS X Automated Installer Script
#
# Copyright 2016 - Bryan R. Hoffpauir, Jr.
#
# References :
# - My macosx app setup list using brew and cask
# http://javapapo.blogspot.com/2015/08/my-macosx-app-setup-list-using-brew-and.html
# - Best Way to check if the Command Line Tools are installed?
# http://apple.stackexchange.com/questions/219507/best-way-to-check-in-bash-if-command-line-tools-are-installed
# - How to Write Go Code
# https://golang.org/doc/code.html#GOPATH
# - How to Setup Your Mac to Develop News Applications Like We Do
# http://blog.apps.npr.org/2013/06/06/how-to-setup-a-developers-environment.html
# - Set your Github API Token If you hit a ”GitHub API rate limit exceeded” :
# https://gist.github.com/christopheranderton/8644743
# - Why I am not able to see the JAVA_HOME path on my MAC OS X 10.11? :
# http://stackoverflow.com/questions/33046697/why-i-am-not-able-to-see-the-java-home-path-on-my-mac-os-x-10-11
# - VirtualEnv & VirtualEnvWrapper problems installing b/c of SIP :
# https://github.com/pypa/pip/issues/3165
# - On OS X El Capitan I can not upgrade a python package dependent on the six compatibility utilities NOR can I remove six :
# http://stackoverflow.com/questions/33185147/can-not-uninstall-six-on-os-x10-11
# - Setting Up the Amazon EC2 Command Line Interface Tools on Linux/Unix and Mac OS X
# http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-linux.html
# - How to setup OS X EL Capitan Environment Variables (Create, Read, Update, Delete)
# http://codewithintent.com/how-to-setup-os-x-el-capitan-environment-variables-create-read-update-delete/
# - Eight Terminal Utilities Every OS X Command Line User Should Know
# http://www.mitchchn.me/2014/os-x-terminal/
# - My basic setup for OS X Lion
# http://www.darkoperator.com/blog/2011/7/24/my-basic-setup-on-osx-lion.html
# - Installing Metasploit Framework on OS X El Capitan
# http://hackerforhire.com.au/installing-metasploit-framework-on-os-x-el-capitan/
# - How to fix permission issues on Homebrew in OS X El Capitan?
# http://digitizor.com/fix-homebrew-permissions-osx-el-capitan/
# - Use Homebrew zsh Instead of the OSX Default
# http://rick.cogley.info/post/use-homebrew-zsh-instead-of-the-osx-default/
# - Immutable Infrastructure with AWS and Ansible – Part 1 – Setup
# http://vcdxpert.com/?p=105
# - Using the latest SSH from Homebrew on OSX
# https://coderwall.com/p/qdwcpg/using-the-latest-ssh-from-homebrew-on-osx
# - Install Multiple Java Versions on Mac
# http://davidcai.github.io/blog/posts/install-multiple-jdk-on-mac/
# - Managing multiple versions of Java on OS X
# https://andrew-jones.com/blog/managing-multiple-versions-of-java-on-os-x/
# - jEnv - Manage your Java environment
# http://www.jenv.be
#
echo "******************************************************"
# Change to the current user's home directory, a few of the commands require it and nothing prohibits it...
echo "Switching to your home directory..."
cd ~
echo "Ensuring permissions are set correctly on /usr/local and sub-directories..."
sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local
# You need to have installed Xcode via the AppStore for this script to run
echo "Xcode Command Line Tools is required for this setup script."
# Check & Prompt for Install if needed - See Stack Exchange Reference above
if xcode-select --install 2>&1 | grep installed; then
echo "Xcode Command Line Tools already installed, proceeding with setup...";
else
echo "Xcode Command Line Tools is not currently installed."
echo "Please accept the confirmation when prompted to continue...";
fi
echo "******************************************************"
echo
echo "Installing Homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing Homebrew Cask & Services to allow installing pre-built packages and configuring macOS launchctl services...""
brew tap homebrew/bundle
# Use brew bundle command to restore all apps previously dumped to file
brew bundle install -v --file="~/Working/mac-setup/.Brewfile"
echo "Running brew doctor - halt the script & investigate if you see any errors."
brew doctor
# TODO - Add call to create symlinks for dotfiles
# Update /etc/shells to comment out the system default bash and add an entry to enable the latest version we just installed via homebrew
ed -s /etc/shells <<< $',s?/bin/bash?#/bin/bash?g\n,w'
sudo echo "#Add homebrew bash override as shell option" | sudo tee -a /etc/shells
sudo echo "/usr/local/bin/bash" | sudo tee -a /etc/shells
# TODO: Add support for git cloning and installing bash-it - https://github.com/Bash-it/bash-it
# TODO: bash-powerline: https://github.com/riobard/bash-powerline
# TODO: bashful: https://github.com/jmcantrell/bashful
# Install and configure bashub client for archiving all bash commands in the cloud - https://bashhub.com/install
# See Also: https://github.com/rcaloras/bashhub-client
# See Also: https://github.com/rcaloras/bashhub-client/wiki/Security-and-Privacy
# TODO: Review configuration to determine if / which commands to exclude from logging
# TODO: Refactor using https://github.com/niieani/bash-oo-framework
# TODO: Refactor using https://github.com/bpkg/bpkg
#
# TODO: add logic to close and restart terminal session for this to take affect
# curl -OL https://bashhub.com/setup && bash setup
# Update config to suppress "You need a passphrase to unlock the secret key for" when signing git commits
# Reference: http://stackoverflow.com/questions/37763170/git-signed-commits-how-to-suppress-you-need-a-passphrase-to-unlock-the-secret
echo 'no-tty' >> $HOME/.gnupg/gpg.conf
# TO-DO - remove after testing - refactor for use with more updated .iterm2_shell_integration.bash
# now available via iTerm
# curl -L https://iterm2.com/misc/install_shell_integration.sh | bash
# Development Languages, Environments, & Related Utilities
# Python...
echo "Installing pip, pre-req for virtualenv, enter your password if promptedv..."
sudo easy_install pip
echo "Installing virtualenv & virtualenvwrapper..."
sudo -H pip install virtualenv --upgrade
sudo -H pip install virtualenvwrapper --upgrade --ignore-installed six
source /usr/local/bin/virtualenvwrapper_lazy.sh
# JavaScript, v8m, etc...
echo "Installing Node.js & npm..."
export NODE_PATH="/usr/local/lib/node_modules"
# Install npm packages
npm install -g grunt
npm install -g gulp
# Ruby
echo "Updating, Installing and configuring all ruby versions & rbenv..."
rbenv init
# Go
echo "Installing and configuring Go language..."
mkdir $HOME/work
export GOPATH="$HOME/work"
export PATH="$LOCALBIN:$PATH:$GOPATH/bin"
# Java
# Should comment out below and rely on profile scripts to set env variables correctly - these may be leading to multiple settings...
export JAVA_HOME="/usr/bin"
# Add logic to probe the versions of java just installed and register with jenv
# TODO - re-work path logic using jenv
export PATH="$JAVA_HOME/bin:$PATH"
#
# PHP - NOTE - If we're going to run NGINX / Zend Server on VM's or Docker Containers
#
# The the actual requirements for the local system in terms of PHP and post-config required
# can be relatively light. I'm currently focusing on essential development tools, utilities,
# and core language runtimes needed for my IDE & Editors to function properly
# I am SPECIFICALLY not installing NGINX or Apache via homebrew but rather just the PHP
# languages and if needed the php modules.
#
# TODO: Will test to verify if I can remove any of stuff I'm installing once I have Docker and VM's up and running.
#
# Fix File System Case-Sensitivity Warning on PHPStorm Startup
cp work/mac-setup/idea.properties ~/Library/Preferences/PhpStorm2016.1/
# Install local versions of PHP needed for development & testing
# Some of the following cause issues with my customized .bash_profile - need to troubleshoot
phpbrew init
[[ -e ~/.phpbrew/bashrc ]] && source ß~/.phpbrew/bashrc
phpbrew lookup-prefix homebrew
phpbrew update
phpbrew -d install -j --test 5.5.0 +all
phpbrew -d ext install -j +all
# Cloud / Virtualization / Container Stacks & Provisioning System
echo "Installing xhyve..."
brew install xhyve
echo "Installing VirtualBox..."
brew cask install Caskroom/cask/virtualbox
brew cask install Caskroom/cask/virtualbox-extension-pack
echo "Installing VMWare Fusion 8..."
brew cask install Caskroom/cask/vmware-fusion
echo "Installing Docker & Supporting Utilities..."
# Docker + Kitematic + Boot2Docker ???
echo "Installing Docker & Container Managment Utilities..."
brew cask install Caskroom/cask/dockertoolbox
brew install docker-cloud
brew install docker-gen
brew install docker-swarm
brew install dockviz
brew install docker-clean
brew install docker-completion
brew install docker-compose-completion
brew install docker-machine-completion
# Vagrant & HashiCorp Apps
echo "Installing Vagrant and other HashiCorp applications / utilities..."
brew install vagrant
brew install packer
brew install serf
brew install consul
brew install consul-template
brew install vault
brew install terraform
brew install terraform-inventory
brew install vault
brew install nomad
brew install otto
brew install vassh # Vagrant Host-Guest SSH Command Wrapper/Proxy/Forwarder
# https://github.com/x-team/vassh
# Install Vagrant VMWare Fusion Provider & Activate License key from Google Drive Archive
GOOGLE_DRIVE=~/Google\ Drive
vagrant plugin install vagrant-vmware-fusion
vagrant plugin license vagrant-vmware-fusion "$GOOGLE_DRIVE/Software/Vagrant/license.lic"
# Ansible Utilities
echo "Installing Ansible & Ansible CMDB Utilities..."
brew install ansible
brew install ansible-cmdb
# TODO: Review Ansible Role to ensure still needed
echo "Installing the yaegashi.blockinfile Ansible role from Ansible galaxy..."
sudo ansible-galaxy install yaegashi.blockinfile
# Install all of the available AWS CLI Tools
echo "Installing all available Amazon Web Services CLI Utilities..."
brew install awscli
brew install ec2-ami-tools
brew install ec2-api-tools
brew install aws-as aws-cfn-tools
brew install aws-elasticache
brew install aws-elasticbeanstalk
brew install aws-keychain
brew install aws-mon
brew install aws-shell
brew install aws-sns-cli
brew install awsebcli
brew install rds-command-line-tools
brew install elb-tools s3cmd
brew install aws-cloudsearch
brew install aws-sns-cli
brew install amazon-ecs-cli
brew install aws-apigateway-importer
brew install s3sync
brew install auto-scaling
brew cask install Caskroom/cask/elasticwolf
# Setup ~/.aws/config settings
# TODO : write this logic
# Install awless
brew tap wallix/awless
brew install awless
# Configure bash autocompletion
echo '[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion\n' >> ~/.bashrc
awless completion bash > /usr/local/etc/bash_completion.d/awless
# Configure zsh automcompletion
echo 'source <(awless completion zsh)\n' >> ~/.zshrc
# Install Google Compute and Cloud SDK & Utilities
echo "Installing all available Google Compute Engine / Google Cloud Utilities..."
brew cask install Caskroom/cask/google-cloud-sdk
brew cask install Caskroom/cask/googleappengine
brew install google-sql-tool
# Install Red Hat OpenShift Cloud & Container Utilities
echo "Installing & Configuring RedHat Open Shift Utilities..."
brew install openshift-cli
sudo gem install rhc
echo "Initializing OpenShift Client Utilities - you will be prompted for login and ssh key information..."
# TODO: Write script that generates key, uploads to rhc, runs setup with
# --autocomplete and finally removes default id_rsa
# NOTE: Rough script logic below....ssh/config already updated to use assumptions in following code for paths
#
# mkdir .ssh/rhcloud.com/
# ssh-keygen -t rsa -b 4096 -f ~/.ssh/rhcloud.com/id_rsa
# chmod 600 ~/.ssh/rhcloud.com/id_rsa
# rhc sshkey remove default
# rhc sshkey add default ~/.ssh/rhcloud.com/id_rsa.pub
# cp .ssh/config ~/.ssh/config
# rhc setup --autocomplete
# rm -f .ssh/*id
# Install Local DataStores
#
# Don't plan on using them for development, per-se, but want to have clients
# installed and have the local server setup to be startable since some of the
# auto-discovery systems in Zend and other Clients run into issues when the
# client and server are on different hosts.
#
# Redis, Memcache, MySQL (or MariaDB, Percona)?
brew install redis
brew install memcached
brew install mariadb
brew install postgresql
brew install percona-toolkit
# Make sure to add the various top-utils that don't conflict
# brew install pg_top innotop # These were generating errors
brew install memcache-top # Grabs real-time stats from memcache & outputs it like top
# https://code.google.com/archive/p/memcache-top/
echo "Installing MySQL & PostgreSQL Clients..."
brew cask install Caskroom/cask/sequel-pro # Mac database management application for working with MySQL databases.
# https://sequelpro.com/
brew cask install Caskroom/cask/psequel # Clean and simple interface for you to perform common PostgreSQL tasks quickly.
# http://www.psequel.com
brew cask install Caskroom/cask/dbvisualizer # Universal database tool for developers, DBAs and analysts for graphing schemas
# https://www.dbvis.com/
# Install Browsers, Communications Clients
echo "Installing Chrome Browser & Related Apps / Extensions..."
brew cask install Caskroom/cask/google-chrome Caskroom/cask/google-hangouts Caskroom/cask/google-adwords-editor
brew install chromedriver # Launcing requires either
# Launch at Startup : ln -sfv /usr/local/opt/chromedriver/*.plist ~/Library/LaunchAgents
# Launch on demand : launchctl load ~/Library/LaunchAgents/homebrew.mxcl.chromedriver.plist
brew cask install Caskroom/cask/chrome-devtools # Run Chrome DevTools as a stand-alone app
brew install chrome-cli # Cool CLI Automation for Chrome, see https://github.com/prasmussen/chrome-cli
echo "Installing Firefox Browser and Related Apps / Extensions..."
brew cask install Caskroom/cask/firefox
echo "Installing Remote Access Utilities..."
brew cask install Caskroom/cask/teamviewer # TeamViewer - https://www.teamviewer.com/
echo "Installing Mac OS X System Utilities..."
brew cask install Caskroom/cask/onyx
brew cask install Caskroom/cask/maintenance
brew cask install Caskroom/cask/deeper
brew cask install Caskroom/cask/the-unarchiver
echo "Installing Messaging Apps"
brew cask install Caskroom/cask/slack
brew cask install Caskroom/cask/hipchat
brew cask install Caskroom/cask/skype
brew cask install Caskroom/cask/zoomus
echo "Installing Document Readers"
brew cask install Caskroom/cask/kindle
brew cask install Caskroom/cask/adobe-reader
brew cask install Caskroom/cask/dash
brew cask install Caskroom/cask/calibre
brew cask install Caskroom/cask/kindlepreviewer
echo "Installing Image Processing Libraries & Utilies..."
brew cask install Caskroom/cask/imageoptim
brew install djvulibre djvu2pdf djview4 pngcrush
brew cask install Caskroom/cask/invisionsync
brew cask install Caskroom/cask/xnconvert
brew cask install Caskroom/cask/xnviewmp
echo "Installing Client Apps, IDE's and configuring UI Enhancements..."
# Installing vim Enhancements
brew install vim --override-system-vi
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.eim
brew cask install Caskroom/cask/vimr
# Installing Visual Studio for Mac OS X
brew cask install Caskroom/cask/visual-studio-code
# TODO: Add logic to Install JetBrains IDE
# TODO: Add installation of bash support for JetBrains IDE via https://github.com/jansorg/BashSupport
# Install Zend Stack : Zend Server, Z-Ray, Zend Studio
# TODO: http://justinhileman.info/article/reinstalling-php-on-mac-os-x/
# TODO: Add Zend Server via Docker
# TODO: Add Zend Server via Vagrant
# TODO: Add Zend Server via homebrew
# brew cask install Caskroom/cask/zendserver
brew cask install Caskroom/cask/zend-studio
# Install Mac-focused dev utilities
brew install anvil
brew cask install Caskroom/cask/rcenvironment
# Install Video Clients
echo "Installing Local and Online Video Clients..."
brew cask install 4k-video-downloader # YouTube video downloader
brew cask install Caskroom/vlc/vlc # Video Lan Client
brew cask install Caskroom/cask/airserver # AirServer - https://www.airserver.com
echo "Install other client applications..."
brew install pipe-viewer
brew cask install blueservice calcservice wordservice easyfind
brew cask install activity-audit
echo "Install Paw HTTP REST / JSON API Development Utility..."
brew install paw # Install Lucky Marmots Paw (HTTP & REST Client) https://luckymarmot.com/paw
# NOTE: Licensing must occur manually
echo "Install Blogging / Writing Apps..."
brew cask install wordpresscom # Install WP Client - https://apps.wordpress.com/desktop/
echo "Install Mac App Store CLI..."
brew install mas # Install the Mac App Store Command Line Interface for scripting App Store installations
# TODO: Write automation scripts for installing App Store Apps & upgrading apps
# Apps which cannot be installed via Homebrew - needs AppStore installation
# Apple Apps
# - Final Cut Pro
# - Garage Band
# Buffer by Buffer
# Proxy by WebSecurify
# WebReaver by WebSecurify
# Voila by Global Delight Technologies
# AirMail
# FullContact - note ver 1 is available via Homebrew - testing to see if I can upgrade
# Magnet
# @TODO - Add logic for handling .dotfiles sync here
# Cleanup files downloaded for installations....
brew cleanup
brew cask cleanup