Created
March 9, 2015 20:41
-
-
Save dannydb/167e50c6d16e37e04156 to your computer and use it in GitHub Desktop.
killport
This file contains hidden or 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
# Sometimes yosemite crashes with a gunicorn server up | |
# and when it comes back up there is a python process blocking port 8000 | |
# kill that process with this function | |
# http://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac | |
function killport() { | |
lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment