Skip to content

Instantly share code, notes, and snippets.

@japboy
Last active August 29, 2015 14:14
Show Gist options
  • Save japboy/05faf9bec892ceafeb77 to your computer and use it in GitHub Desktop.
Save japboy/05faf9bec892ceafeb77 to your computer and use it in GitHub Desktop.
A script to launch local servers
#!/bin/bash
CWD=$(pwd)
function ctrl_c () {
#pgrep -f mongod && pkill mongod
pgrep -f mysql && mysql.server stop
cd ${CWD}
unset CWD
unset -f ctrl_c
}
trap ctrl_c SIGINT
#mongod --config $(brew --prefix)/etc/mongod.conf &
mysql.server start
[[ ! -z "${1}" && -d ${1} ]] && cd ${1}
#python -m SimpleHTTPServer 8080
#ruby -run -e httpd . -p 8080
php -S 0.0.0.0:8080
#wzrd app.js:bundle.js -p 8080 -- -t 6to5ify --extension=".js"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment