Skip to content

Instantly share code, notes, and snippets.

@rpearce
Last active August 31, 2015 17:04
Show Gist options
  • Save rpearce/0e4b8f02d7719a51e931 to your computer and use it in GitHub Desktop.
Save rpearce/0e4b8f02d7719a51e931 to your computer and use it in GitHub Desktop.
New Mac Install Script (Students)
#!/bin/sh
###############################################################################
# XCode
###############################################################################
echo "Setting up XCode"
xcodebuild -license
xcode-select --install
sudo xcode-select -switch /Library/Developer/CommandLineTools
###############################################################################
# Homebrew
###############################################################################
echo "Installing command line utilities"
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update homebrew recipes
brew update
# Install more recent versions of some OS X tools
brew tap homebrew/dupes
brew install homebrew/dupes/grep
# terminal utils
binaries=(
coreutils # Install GNU core utilities (those that come with OS X are outdated)
findutils # Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
bash # Install Bash 4
python
ack
git
heroku
hub
postgres
node
npm
rbenv
ruby-build
)
echo "Installing packages..."
brew install ${binaries[@]}
brew cleanup
brew install caskroom/cask/brew-cask
brew tap caskroom/versions
# Apps
apps=(
google-chrome
atom
flux
slack
iterm2
github
)
# Install apps to /Applications
# Default is: /Users/$user/Applications
echo "Installing apps..."
brew cask install --appdir="/Applications" ${apps[@]}
$PATH=$(brew --prefix coreutils)/libexec/gnubin:$PATH
###############################################################################
# Atom Editor
###############################################################################
# "Setting Git to use Atom as default editor"
git config --global core.editor "atom"
###############################################################################
# Ruby
###############################################################################
touch ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
rbenv install 2.2.3
rbenv global 2.2.3
rbenv rehash
###############################################################################
# Hub working alongside git (access to $ git create)
###############################################################################
echo 'eval "$(hub alias -s)"' >> ~/.bash_profile
###############################################################################
# Set up PostgreSQL database
###############################################################################
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
createdb
###############################################################################
# Bash prompt setup (with git setup!)
###############################################################################
# Paste this in to ~/.bash_profile
# https://gist.github.com/rpearce/82dc9f6b96d1a04dcff5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment