Skip to content

Instantly share code, notes, and snippets.

@addamh
Created May 28, 2011 15:50
Show Gist options
  • Save addamh/996967 to your computer and use it in GitHub Desktop.
Save addamh/996967 to your computer and use it in GitHub Desktop.
NORMES MacOSX Development System Bootstrap Script
#!/usr/bin/env bash
echo "Fixing Samba..."
echo "[default]" > ~/Library/Preferences/nsmb.conf
echo "streams=no" >> ~/Library/Preferences/nsmb.conf
echo "Removing System Gems..."
rm -r /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
gem update --system
gem clean
echo "Installing Homebrew..."
mkdir /usr/local
chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
brew update
echo "Creating Bash Profile..."
echo '. "$HOME/.bashrc"' > ~/.bash_profile
echo "Installing MacVim..."
brew install macvim
echo "Installing Utilities..."
brew install wget proctools ack ctags-exuberant markdown hub
echo "Installing Git..."
brew install git
echo "Installing Dotfiles"
mkdir ~/hashrocket
cd ~/hashrocket
git clone http://github.com/hashrocket/dotmatrix.git
ln -s ~/hashrocket/dotmatrix/.bashrc ~/
ln -s ~/hashrocket/dotmatrix/.hashrc ~/
ln -s ~/hashrocket/dotmatrix/.vim ~/
ln -s ~/hashrocket/dotmatrix/.vimrc ~/
sh ~/hashrocket/dotmatrix/bin/vimbundles.sh
echo "Installing RVM..."
mkdir -p ~/.rvm/src/ && \
cd ~/.rvm/src && \
rm -rf ./rvm/ && \
git clone --depth 1 git://github.com/wayneeseguin/rvm.git && \
cd rvm && \
./install
echo 'if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi' \
>> ~/.bashrc.local
echo 'rvm_project_rvmrc_default=1' \
> ~/.rvmrc # Use default gemset when leaving a .rvmrc project dir
echo '[[ -r $rvm_path/scripts/completion ]] && source $rvm_path/scripts/completion' \
>> ~/.bashrc.local # rvm autocompletion
echo "Installing OpenSSL..."
rvm package install openssl
echo "Installing rubies..."
rvm install 1.8.7 -C --enable-shared=yes
rvm install 1.9.2 -C --enable-shared=yes
echo "Setting 1.9.2 As Default Ruby..."
rvm use 1.9.2 --default
echo "Setting Up .gemrc..."
echo -e '---
:benchmark: false
gem: --no-ri --no-rdoc
:update_sources: true
:bulk_threshold: 1000
:verbose: true
:sources:
- http://rubygems.org
- http://gems.github.com
:backtrace: false' > ~/.gemrc
echo "Installing Database Systems..."
echo " 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
echo " 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
echo " Installing MongoDB..."
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
echo "Installing Redis, a key-value database ..."
brew install redis
echo "Installing Node..."
brew install node
echo "Setting Up Global Gems..."
for x in $(rvm list strings)
do
rvm use $x@global && gem install mysql --\
--with-mysql-dir=/usr/local \
--with-mysql-config=/usr/local/bin/mysql_config
rvm use $x@global && gem install mongrel pg
rvm use $x@global && gem install open_gem ruby-debug hitch
done
echo "Installing Growl..."
cd ~/Downloads
wget http://growl.cachefly.net/Growl-1.2.dmg
open Growl-1.2.dmg
cd /Volumes/Growl-1.2/Extras/growlnotify/
# Don't use the install shell script
# Use the following:
mkdir -p /usr/local/bin
echo " Creating /usr/local/bin"
mkdir -p /usr/local/man/man1
echo " Creating /usr/local/man/man1"
cp growlnotify /usr/local/bin/growlnotify
cp growlnotify.1 /usr/local/man/man1/growlnotify.1
echo "Generating Public Key..."
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub | pbcopy
open https://github.com/account/ssh
echo "Installing Bundler for managing Ruby libraries..."
gem install bundler
echo "Installing Rails to write and run web applications..."
gem install rails
echo "Installing the Heroku gem to interact with the http://heroku.com API..."
gem install heroku
echo "Installing the Taps gem to push and pull SQL databases between development, staging, and production environments..."
gem install taps
echo "Installing Ruby gems to talk to the databases..."
gem install sqlite3 pg mysql
echo "
===========================================
_ _ ____ _____ __ __ ______ _____
| \ | |/ __ \| __ \| \/ | ____|/ ____|
| \| | | | | |__) | \ / | |__ | (___
| . \` | | | | _ /| |\/| | __| \___ \
| |\ | |__| | | \ \| | | | |____ ____) |
|_| \_|\____/|_| \_\_| |_|______|_____/
===========================================
Installation Complete!
";
@addamh
Copy link
Author

addamh commented May 28, 2011

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