Skip to content

Instantly share code, notes, and snippets.

@rpearce
Last active June 18, 2016 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpearce/72801a00a466ff56cf00c34d1a99952f to your computer and use it in GitHub Desktop.
Save rpearce/72801a00a466ff56cf00c34d1a99952f to your computer and use it in GitHub Desktop.
#!/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
ack
git
node
npm
rbenv
ruby-build
postgres
)
echo "Installing packages..."
brew install ${binaries[@]}
brew cleanup
brew tap caskroom/cask
# Apps
apps=(
atom
google-chrome
iterm2
spotify
)
# Install apps to /Applications
# Default is: /Users/$user/Applications
echo "Installing apps..."
brew cask install --appdir="/Applications" ${apps[@]}
###############################################################################
# Editor
###############################################################################
echo "Setting Git to use VIM as default editor..."
git config --global core.editor "vim"
###############################################################################
# Bash prompt setup (with git setup!)
###############################################################################
echo "Setting up ~/.bash_profile..."
touch ~/.bash_profile
curl https://gist.githubusercontent.com/rpearce/82dc9f6b96d1a04dcff5/raw/a3b0fdee46085fd26749594e4ebca7d08b39dcd3/.bash_profile > ~/.bash_profile
echo "Sourcing ~/.bash_profile"
. ~/.bash_profile
###############################################################################
# Ruby
###############################################################################
echo "Installing Ruby version 2.3.1..."
rbenv install 2.3.1
rbenv global 2.3.1
rbenv rehash
###############################################################################
# Set up PostgreSQL database
###############################################################################
echo "Starting Postgres..."
brew services start postgresql
echo "Creating default Postgres DB..."
createdb
###############################################################################
# Git Config & SSH Key Generation
###############################################################################
echo "Setting up Git Config and SSH Key Gen"
git config --global user.name "Robert Pearce"
git config --global user.email "me@robertwpearce.com"
ssh-keygen -t rsa -b 4096 -C "me@robertwpearce.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
pbcopy < ~/.ssh/id_rsa.pub
echo "Now go online to GitHub.com > Settings > SSH & GPG Keys > New SSH Key and paste in the copied public key"
echo "***************"
echo "Make sure to create a new GitHub token, as well, and use that as your CLI GitHub Password"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment