Last active
August 29, 2015 14:02
-
-
Save cholick/31f1bc1d46f86a552031 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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