Last active
May 26, 2017 10:40
-
-
Save ignlg/691cb662e92c41289a03 to your computer and use it in GitHub Desktop.
Setup Mac OS X from scratch using Homebrew & Cask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
### | |
# | |
# Setup Mac OS X from scratch using Homebrew & Cask | |
# | |
# Version: 1.2.31 | |
# Date: 20151207 | |
# Author: Ignacio Lago @ignlg | |
# Gist: https://gist.github.com/ignlg/691cb662e92c41289a03 | |
# | |
### | |
# 888888 dP"Yb dP"Yb 88 .dP"Y8 | |
# 88 dP Yb dP Yb 88 `Ybo." | |
# 88 Yb dP Yb dP 88 .o o.`Y8b | |
# 88 YbodP YbodP 88ood8 8bodP' | |
function _msg_error { echo -e "! $@"; } | |
function _msg_info { echo -e "-----> $@"; } | |
function _msg_log { echo -e $@ | indent; } | |
function indent { sed -l 's/^/ /'; } | |
function _areyousure { | |
read -p "? ---> Are you sure? (y/N) " -n 1 -r; echo | |
if [[ ! $REPLY =~ ^[Yy]$ ]]; then return 1; fi | |
} | |
function _areyouabsolutelysure { | |
read -p "? ---> Are you sure? (yes/No) " -n 3 -r; echo | |
if [[ ! $REPLY =~ ^[Yy][Ee][Ss]$ ]]; then return 1; fi | |
} | |
function _askcask { | |
read -p "? ---> Install $@ ? (y/N) " -n 1 -r; echo | |
if [[ $REPLY =~ ^[Yy]$ ]]; then | |
brew cask install $@ | |
fi | |
} | |
function _cask { | |
brew cask install $@ | |
} | |
# Yb dP 88""Yb 88b 88 | |
# Yb dP 88__dP 88Yb88 | |
# YbdP 88""" 88 Y88 | |
# YP 88 88 Y8 | |
_msg_info "(Optional) Install Tunnelblick and configure your VPN" | |
_msg_log https://tunnelblick.net/downloads.html | |
read -p "Press any key when done or to skip... " -n1 -s | |
if [[ -f "./vpn.bash" ]]; then | |
source ./vpn.bash | |
fi | |
echo | |
# Yb dP dP""b8 dP"Yb 8888b. 888888 | |
# YbdP dP `" dP Yb 8I Yb 88__ | |
# dPYb Yb Yb dP 8I dY 88"" | |
# dP Yb YboodP YbodP 8888Y" 888888 | |
_msg_info Install Xcode | |
_msg_log https://developer.apple.com/downloads/ | |
echo | |
_msg_log "To fix warning about malware or stuck verifying:" | |
_msg_log "> xattr -d com.apple.quarantine Xcode.app" | |
echo | |
read -p "Press any key when done... " -n1 -s | |
_msg_info Commandline tools... | |
xcode-select --install | |
echo | |
# 88 88 dP"Yb 8b d8 888888 88""Yb 88""Yb 888888 Yb dP | |
# 88 88 dP Yb 88b d88 88__ 88__dP 88__dP 88__ Yb db dP | |
# 888888 Yb dP 88YbdP88 88"" 88""Yb 88"Yb 88"" YbdPYbdP | |
# 88 88 YbodP 88 YY 88 888888 88oodP 88 Yb 888888 YP YP | |
_msg_info Install Homebrew and Cask... | |
export HOMEBREW_CASK_OPTS="--appdir=/Applications" | |
_areyousure && | |
( | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew doctor || exit 1 | |
brew install caskroom/cask/brew-cask | |
brew tap caskroom/versions | |
) | |
_msg_info Homebrew Apps... | |
brew install curl dnsmasq ffmpeg figlet fish gist git go imagemagick node openssl wget youtube-dl || exit 1 | |
# dP""b8 db .dP"Y8 88 dP | |
# dP `" dPYb `Ybo." 88odP | |
# Yb dP__Yb o.`Y8b 88"Yb | |
# YboodP dP""""Yb 8bodP' 88 Yb | |
_msg_info Cask Apps... | |
_cask java | |
_cask 1password # password manager | |
_cask aerial # appleTV screen saver | |
_cask android-file-transfer | |
_cask android-studio-canary | |
_cask bartender # organize menu bar apps | |
_cask battery-guardian | |
_cask caffeine # keep mac awake | |
_cask charles # proxy | |
_cask crashplan # backups | |
_cask daisydisk # disk usage | |
_cask dropbox | |
_cask easyfind | |
_cask evernote | |
_cask firefox | |
_cask flash | |
_cask flux # adapts display color to the time of day | |
_cask google-chrome | |
_cask google-earth | |
_cask iterm2 | |
_cask libreoffice | |
_cask mailbox # email | |
_cask markright # markdown editor | |
_cask megasync | |
_cask yujitach-menumeters # patched for el capitan | |
_cask minecraft | |
_cask mplayerx | |
_cask ngrok # local server made public | |
_cask piskel # pixel editor | |
_cask rowanj-gitx | |
_cask skitch | |
_cask skype | |
_cask slack | |
_cask spectacle # arrange windows | |
_cask spotify | |
_cask spotify-notifications | |
_cask steam | |
_cask sublime-text3 | |
_cask subtitles # trial version | |
_cask the-unarchiver | |
_cask torbrowser | |
_cask tunnelblick-beta # vpn client | |
_cask utorrent-beta | |
_cask vagrant # virtual machines | |
_cask vagrant-manager | |
_cask vlc | |
_cask wireshark # network analysis | |
# db 88b 88 8888b. 88""Yb dP"Yb 88 8888b. | |
# dPYb 88Yb88 8I Yb 88__dP dP Yb 88 8I Yb | |
# dP__Yb 88 Y88 8I dY 88"Yb Yb dP 88 8I dY | |
# dP""""Yb 88 Y8 8888Y" 88 Yb YbodP 88 8888Y" | |
_msg_info Android SDK... | |
brew install android-sdk | |
brew install android-ndk | |
# db 8888b. dP"Yb 88""Yb 888888 | |
# dPYb 8I Yb dP Yb 88__dP 88__ | |
# dP__Yb 8I dY Yb dP 88""Yb 88"" | |
# dP""""Yb 8888Y" YbodP 88oodP 888888 | |
_msg_info Adobe Apps... | |
_askcask adobe-illustrator-cc | |
_askcask adobe-photoshop-cc | |
# dP"Yb 88""Yb 888888 88 dP"Yb 88b 88 db 88 | |
# dP Yb 88__dP 88 88 dP Yb 88Yb88 dPYb 88 | |
# Yb dP 88""" 88 88 Yb dP 88 Y88 dP__Yb 88 .o | |
# YbodP 88 88 88 YbodP 88 Y8 dP""""Yb 88ood8 | |
_msg_info Optional Apps | |
_askcask alfred && brew cask alfred link # better than spotlight | |
_askcask google-drive | |
_askcask jdownloader # download manager | |
_askcask lastfm | |
_askcask malwarebytes-anti-malware # anti malware | |
_askcask parallels-desktop # virtualization | |
_askcask virtualbox # virtualization free | |
_askcask wacom-graphire2-tablet # Graphire2 driver | |
_askcask wacom-graphire4-tablet # Graphire4 driver | |
_askcask wacom-bamboo-tablet # Bamboo driver | |
_askcask wacom-tablet | |
# _msg_info Other Apps | |
# _cask all2mp3 | |
# _cask anvil | |
# _cask authy-bluetooth | |
# _cask awareness | |
# _cask chromecast | |
# _cask clamxav | |
# _cask github-desktop | |
# _cask google-music-manager | |
# _cask grandperspective | |
# _cask joinme | |
# _cask little-snitch | |
# _cask livereload | |
# _cask rescuetime | |
# _cask satellite-eyes | |
# _cask sidestep | |
# _cask transmit | |
# _cask wunderlist | |
# dP""b8 88 888888 db 88b 88 88 88 88""Yb | |
# dP `" 88 88__ dPYb 88Yb88 88 88 88__dP | |
# Yb 88 .o 88"" dP__Yb 88 Y88 Y8 8P 88""" | |
# YboodP 88ood8 888888 dP""""Yb 88 Y8 `YbodP' 88 | |
_msg_info Cleanup... | |
brew cleanup --force | |
rm -f -r /Library/Caches/Homebrew/* | |
# 88b 88 88""Yb 8b d8 | |
# 88Yb88 88__dP 88b d88 | |
# 88 Y88 88""" 88YbdP88 | |
# 88 Y8 88 88 YY 88 | |
_msg_info Npm setups... | |
npm install -g gulp grunt cordova coffee-script surge | |
# _msg_info Vagrant with Parallels | |
# vagrant plugin install vagrant-parallels | |
# 88""Yb 88 88 88""Yb Yb dP | |
# 88__dP 88 88 88__dP YbdP | |
# 88"Yb Y8 8P 88""Yb 8P | |
# 88 Yb `YbodP' 88oodP dP | |
_msg_info Ruby... | |
echo "gem: --no-document" >> ~/.gemrc | |
curl -L https://get.rvm.io | bash -s stable --auto-dotfiles --autolibs=enable --rails | |
rvm install ruby-head | |
rvm use ruby-head | |
gem install brew-cask-upgrade compass jekyll | |
# dP"Yb .dP"Y8 Yb dP dP""b8 dP"Yb 88b 88 888888 88 dP""b8 | |
# dP Yb `Ybo." YbdP dP `" dP Yb 88Yb88 88__ 88 dP `" | |
# Yb dP o.`Y8b dPYb Yb Yb dP 88 Y88 88"" 88 Yb "88 | |
# YbodP 8bodP' dP Yb YboodP YbodP 88 Y8 88 88 YboodP | |
_msg_info OS X Configuration... | |
_msg_log "Enable show hidden files" | |
defaults write com.apple.finder AppleShowAllFiles YES | |
_msg_log "Enable Cut in Finder" | |
defaults write com.apple.finder AllowCutForItems YES | |
echo | |
_msg_info "Done!" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment