Last active
December 22, 2015 18:59
-
-
Save thedeerchild/6516429 to your computer and use it in GitHub Desktop.
Set up ZURB MacBooks out of the box for new ZURBians.
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
#Add Engineering's public keys | |
echo "Adding public keys..." | |
curl -k https://raw.github.com/gist/1097803/engineer_keys.sh | sh &> /dev/null | |
#Applications to install from remote DMG sources | |
remote_apps=("Sublime Text 2" "Firefox" "Google Chrome" "Adium") | |
remote_dmgs=("http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.dmg" "https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" "http://downloads.sourceforge.net/project/adium/Adium_1.5.7.dmg") | |
cd ~ | |
for ((i=${#remote_apps[@]}-1; i>=0; i--)); | |
do | |
echo "Downloading ${remote_apps[$i]}..." | |
curl -L -C - ${remote_dmgs[$i]} -o "${remote_apps[$i]}.dmg" | |
hdiutil attach "${remote_apps[$i]}.dmg" -mountpoint "/Volumes/${remote_apps[$i]}" &> /dev/null | |
sudo cp -R "/Volumes/${remote_apps[$i]}/${remote_apps[$i]}.app" /Applications | |
cd ~ | |
hdiutil unmount "/Volumes/${remote_apps[$i]}" &> /dev/null | |
rm -rf "${remote_apps[$i]}.dmg" | |
#Add to dock | |
defaults write com.apple.dock persistent-apps -array-add "<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/${remote_apps[$i]}.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>" | |
done | |
#Install Coda 2 | |
cd ~ | |
echo "Downloading Coda..." | |
curl -L -C - "https://panic.com/coda/d/Coda%202.0.11.zip" -o "Coda.zip" | |
unzip "Coda.zip" -d /Applications &> /dev/null | |
rm "Coda.zip" | |
defaults write com.apple.dock persistent-apps -array-add "<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Coda 2.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>" | |
#Add Terminal to dock | |
defaults write com.apple.dock persistent-apps -array-add "<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Utilities/Terminal.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>" | |
#Restart dock | |
echo "Customizing dock..." | |
killall -HUP Dock | |
# Install Homebrew | |
echo "Installing Homebrew..." | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/mxcl/homebrew/go/install)" &> /dev/null | |
# Install git | |
echo "Installing Git..." | |
brew install git &> /dev/null | |
# Install Rbenv | |
brew install rbenv &> /dev/null && brew install ruby-build &> /dev/null | |
# Add shims and autocomplete to profile | |
LINE_TO_ADD='if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' | |
if ! grep -qsFx "$LINE_TO_ADD" ~/.profile ~/.bash_profile ; then | |
profile=~/.profile | |
[ -w "$profile" ] || profile=~/.bash_profile | |
printf "%s\n" "$LINE_TO_ADD" >> "$profile" | |
source "$profile" | |
fi | |
# Install fairly recent ruby and set it as default | |
echo "Installing Ruby 2.0.0-p247..." | |
rbenv install 2.0.0-p247 &> /dev/null && rbenv global 2.0.0-p247 &> /dev/null | |
# Install Bundler and Rails | |
echo "Installing Bundler..." | |
gem install bundler --no-rdoc --no-ri &> /dev/null && gem install railties --no-rdoc --no-ri &> /dev/null | |
# Rebuild native extensions | |
rbenv rehash | |
# Install MySQL | |
echo "Installing MySQL..." | |
brew install mysql | |
mkdir -p /Library/LaunchAgents &> /dev/null && ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents &> /dev/null | |
echo "Starting MySQL..." | |
##launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist | |
mysql.server start | |
#Setup Dropbox | |
cd ~ | |
echo "Downloading Dropbox..." | |
curl -L -C - "https://www.dropbox.com/download?plat=mac" -o "Dropbox.dmg" | |
hdiutil attach "Dropbox.dmg" -mountpoint "/Volumes/Dropbox" &> /dev/null | |
sudo cp -R "/Volumes/Dropbox/Dropbox.app" /Applications | |
cd ~ | |
hdiutil unmount "/Volumes/Dropbox" &> /dev/null | |
rm -rf "Dropbox.dmg" | |
open /Applications/Dropbox.app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment