Skip to content

Instantly share code, notes, and snippets.

@serbrech
Created April 25, 2012 18:37
Show Gist options
  • Save serbrech/2492064 to your computer and use it in GitHub Desktop.
Save serbrech/2492064 to your computer and use it in GitHub Desktop.
This is how I bootstrap my envoironment. It's a small shellscript that will open a new tab and run the command past as argument to it.
#!/bin/sh
# Credits goes to http://stackoverflow.com/questions/1589114/opening-a-new-terminal-tab-in-osxsnow-leopard-with-the-opening-terminal-window#answer-7911097
# I just slightly modified it to take an argument.
new_tab() {
pwd=`pwd`
osascript -e "tell application \"Terminal\"" \
-e "tell application \"System Events\" to keystroke \"t\" using {command down}" \
-e "do script \"cd $pwd; clear; $1;\" in front window" \
-e "end tell"
> /dev/null
}
init(){
new_tab mongod
new_tab "redis-server /usr/local/etc/redis.conf"
new_tab "foreman start"
new_tab spork
new_tab "rvmsudo passenger start -p 80 --user=<username>"
}
#BOOM!
init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment