Skip to content

Instantly share code, notes, and snippets.

@keithhamilton
Last active August 4, 2016 13:52
Show Gist options
  • Save keithhamilton/824d260ba5ca4b39b08c to your computer and use it in GitHub Desktop.
Save keithhamilton/824d260ba5ca4b39b08c to your computer and use it in GitHub Desktop.
OS X Dev tool installer, version 2
#!/bin/bash
# Keith's bootstrap file for a clean OS
# Install oh-my-zsh
curl -L http://install.ohmyz.sh | sh
# Install homebrew
# Current xcode command-line tools at:
# https://developer.apple.com/downloads/index.action#
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
# Install core tools via brew/pip
BREW_TOOLS=(awscli caskroom/cask/brew-cask erlang ffmpeg heroku-toolbelt mysql
ngrok nmap node python redis sqlite wget)
brew install `echo $BREW_TOOLS[*]`
# pip installs
PIP_TOOLS=(boto fabric virtualenv)
pip install `echo $PIP_TOOLS[*]`
# relink Python to brewed python
brew unlink python && brew link python
# -----------------------------------
# JAVA INSTALLS
# Install Legacy Java (1.6u45) for IntelliJ IDEA
cd ~/Downloads
wget http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2014-001.dmg
hdiutil mount JavaForOSX201-001.dmg
cd /Volumes/Java\ for\ OS\ X\ 2014-001
sudo installer -pkg JavaForOSX.pkg -target /
diskutil unmount /Volumes/Java\ for\ OS\ X\ 2014-001
# Install Java SDK 1.7u65
# ---------------------------------------------
OS_VERS=`sw_vers | grep ProductVersion | awk '{print $2}'`
REVERT_SYS_VERSION=0
if [ ${OS_VERS} == '10.10' ]; then
cd /System/Library/CoreServices
# create a clone of the SystemVersion plist replacing '10.10' with '10.7.3'
# then back up and replace the SystemVersion plist
sudo cat SystemVersion.plist | sed 's/10.10/10.7.3/g' > /tmp/SystemVersion.plist
sudo cp SystemVersion.plist SystemVersion.plist.bak
sudo mv /tmp/SystemVersion.plist SystemVersion.plist
REVERT_SYS_VERSION=1
fi
# Install Java
if [ ! -e /opt/homebrew-cask ]; then
read -p "--> homebrew-cask not found. Please download the Java 7u65 SDK installer to your Downloads folder. Press ENTER once it has been installed"
hdiutil mount ~/Downloads/jdk-7u65-macosx-x64.dmg
cd /Volumes/JDK\ 7\ Update\ 65
sudo installer -pkg JDK\ 7\ Update\ 65.pkg -target /
diskutil unmount /Volumes/JDK\ 7\ Update\ 65
else
brew tap caskroom/versions
brew cask install java7
fi
if [ ${REVERT_SYS_VERSION} == 1 ]; then
# replace the original plist file
cd /System/Library/CoreServices
sudo mv SystemVersion.plist.bak SystemVersion.plist
fi
cd ~
# END JAVA INSTALL
# --------------------------------------
# Install Apps via Cask
CASK_APPS=(alfred araxis-merge audacity caffeine charles filezilla firefox
google-chrome google-drive hipchat hyperdock intellij-idea iterm2 keepassx mou
omnigraffle onepassword reggy sequel-pro skype spotify sublime-text
vmware-fusion)
brew cask install `echo $CASK_APPS[*]`
# add alfred to login items
defaults write loginwindow AutoLaunchedApplicationDictionary -array-add '{ "Path" = "~/Applications/Alfred\ 2.app"; "Hide" = 0; }'
# link alfred
brew cask alfred link
# run os x dotfile if logged in as keith.hamilton
if [ `whoami` = "keith.hamilton" ]; then
# create src dir if not present
if [ ! -e ~/src/github.com/keithhamilton/dotfiles/ ]; then
mkdir -p ~/src/github.com/keithhamilton
cd ~/src/github.com/keithhamilton/
# clone down dotfiles
git clone https://github.com/keithhamilton/dotfiles
# cd into ~/src/github.com/keithhamilton
cd ~/src/github.com/keithhamilton/dotfiles
# execute os x dotfile
/bin/bash .osx
fi
fi
# install spf13
curl http://j.mp/spf13-vim3 -L -o - | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment