Skip to content

Instantly share code, notes, and snippets.

@cholick
Last active August 29, 2015 14:02
Show Gist options
  • Save cholick/31f1bc1d46f86a552031 to your computer and use it in GitHub Desktop.
Save cholick/31f1bc1d46f86a552031 to your computer and use it in GitHub Desktop.
alias fjson="pbpaste | python -m json.tool | pbcopy; pbpaste"
alias servedir="python -m SimpleHTTPServer"
function setjdk() { if [ $# -ne 0 ];then export JAVA_HOME=`/usr/libexec/java_home -v $@`; fi; java -version; }
function lsjdk() { ls -1 /System/Library/Java/JavaVirtualMachines/; ls -1 /Library/Java/JavaVirtualMachines/; }
killport() {
if [ -z $1 ]; then
echo 'Port is required. Usage: "killport 8000"';
return
fi
local pid=`lsof -i :$1 | grep LISTEN | awk '{print $2}'`
if [ -z $pid ]; then
echo "No process running on $1"
else
echo "Killing process [$pid]"
kill $pid
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment