Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
126 lines (89 sloc) 3.83 KB
#!/usr/bin/env bash
# utility function for pausing the script at any point
# and waiting for user input to continue
function pause(){
echo ""
read -p "$*"
echo ""
}
read -p "Is this computer running OSX Lion (10.7)? [y/n] " lion
echo "Checking for SSH key, generating one if it doesn't exist ..."
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa
echo "Copying public key to clipboard. Paste it into your Github account ..."
[[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | pbcopy
open https://github.com/account/ssh
echo "Installing Homebrew, a good OS X package manager ..."
/usr/bin/ruby -e "$(/usr/bin/curl -fsSkL raw.github.com/mxcl/homebrew/go)"
brew update
echo "Put Homebrew location earlier in PATH ..."
echo "
# recommended by brew doctor
export PATH='/usr/local/bin:$PATH'" >> ~/.bash_profile
source ~/.bash_profile
echo "Installing Git, a good version control system ..."
brew install git
echo "Installing Hub, a good way to interact with github repos from the cli ..."
brew install hub
echo "Installing ssh-copy-id, good for copying your ssh key to servers ..."
brew install ssh-copy-id
echo "Installing vim (with Ruby support), a good text editor ..."
brew install vim
echo "Installing Postgres, a good open source relational database ..."
brew install postgres --no-python
echo "Installing MySQL, another good open source relational database ..."
brew install mysql
echo "Postgres set up"
initdb /usr/local/var/postgres
if [ $lion == "Y" -o $lion == "y" ] ; then
echo "Lion comes with a version of postgres already installed and uses those binaries by default this is a fix for that"
curl http://nextmarvel.net/blog/downloads/fixBrewLionPostgres.sh | sh
fi
echo "Installing Redis, a good key-value store ..."
brew install redis
echo "Installing MongoDB, a good document-based data store ..."
brew install mongodb
echo "installing Memcached, a good memory object caching system ..."
brew install memcached
echo "Installing The Silver Searcher, a good way to search through files ..."
brew install the_silver_searcher
echo "Installing tmux, a good way to save project state and switch between projects ..."
brew install tmux
echo "Installing ImageMagick, good for cropping and re-sizing images ..."
brew install imagemagick
echo "Installing QT, used by Capybara Webkit for headless Javascript integration testing ..."
brew install qt
echo "Installing Node.js, a good platform for event-driven applications using server side javascript ..."
brew install node
echo "Installing Node Package Manager to manage Node package dependencies ..."
curl https://npmjs.org/install.sh | sh
echo "Installing rbenv, a good ruby version manager ..."
brew install rbenv
echo "Installing rbenv-vars, good for setting environment variables with rbenv ..."
brew install rbenv-vars
echo "Put rbenv in PATH and rbenv init in shell ..."
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_proile
echo "Installing ruby-build, good for automating ruby installs alongside rbenv ..."
brew install ruby-build
curl -Os https://raw.github.com/molawson/laptop/master/ruby ; bash ruby
echo "Cleaning up most of the mess we made ..."
rm ruby
echo "Now you need to setup postgres ...\n"
brew info postgres
pause "Press [Enter] to continue: "
echo "Now you need to setup mysql ...\n"
brew info mysql
pause "Press [Enter] to continue: "
echo "Now you need to setup mongodb ...\n"
brew info mongodb
pause "Press [Enter] to continue: "
echo "Now you need to setup redis ...\n"
brew info redis
pause "Press [Enter] to continue: "
echo "Now you need to setup memcached ...\n"
brew info memcached
pause "Press [Enter] to continue: "
echo "\n-----------------------------"
echo "All done here. Happy hacking!"
echo "-----------------------------\n"