Skip to content

Instantly share code, notes, and snippets.

@atmos
Created April 28, 2010 04:15
Show Gist options
  • Save atmos/381720 to your computer and use it in GitHub Desktop.
Save atmos/381720 to your computer and use it in GitHub Desktop.
getting started with homebrew
#!/bin/sh
curl http://gist.github.com/raw/323731/install_homebrew > install_homebrew.rb
ruby install_homebrew.rb
rm install_homebrew.rb
echo "PATH=/usr/local/bin:/Developer/usr/bin:\$PATH; export PATH" >> ~/.profile
source ~/.profile
echo "Your path is now $PATH"
brew install git
brew update
# installing mysql
brew install mysql
if [[ "$?" -eq "0" ]]; then
MYSQL_VERSION=`brew list mysql | awk -F/ '{print $6}' | head -n1`
/usr/local/Cellar/mysql/$MYSQL_VERSION/bin/mysql_install_db
cp /usr/local/Cellar/mysql/$MYSQL_VERSION/com.mysql.mysqld.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
else
echo "Unable to install mysql, weak"
exit 1
fi
# installing postgres
brew install postgresql
if [[ "$?" -eq "0" ]]; then
POSTGRESQL_VERSION=`brew list postgresql | awk -F/ '{print $6}' | head -n 1`
initdb /usr/local/var/postgres
launchctl load -w /usr/local/Cellar/postgresql/$POSTGRESQL_VERSION/org.postgresql.postgres.plist
else
echo "Unable to install postgresql, weak"
exit 1
fi
# install mongo
brew install mongo
if [[ "$?" -eq "0" ]]; then
MONGODB_VERSION=`brew list mongodb | awk -F/ '{print $6}' | head -n 1`
cp /usr/local/Cellar/mongodb/$MONGODB_VERSION/org.mongodb.mongod.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist
else
echo "Unable to install mongodb, weak"
exit 1
fi
# install a bunch of utils
for i in node rlwrap kiwi ack sqlite hub wget; do
brew install $i
done
# install rvm for ease of use
sudo gem install rvm
rvm-install
echo "if [[ -s /Users/$USER/.rvm/scripts/rvm ]] ; then source /Users/$USER/.rvm/scripts/rvm ; fi" >> ~/.profile
source ~/.profile
# setup the default 1.8.7 version
rvm install 1.8.7-p173
rvm use 1.8.7-p173
echo "rvm use 1.8.7-p173" >> ~/.profile
# install bundler
gem install bundler
git clone git://github.com/atmos/hancock.git
cd hancock/
bundle install
bundle exec rake
if [[ "$?" -eq "0" ]]; then
echo "Successfully bootstrapped your machine"
else
echo "Shit failed. :("
fi
#wget http://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
#cat ~/.profile >> ~/.zshrc
#rm ~/.profile
@defunkt
Copy link

defunkt commented Apr 28, 2010

curl http://gist.github.com/raw/323731/install_homebrew will always get you the newest version of a Gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment