Skip to content

Instantly share code, notes, and snippets.

@dannydb
Created March 9, 2015 20:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannydb/167e50c6d16e37e04156 to your computer and use it in GitHub Desktop.
Save dannydb/167e50c6d16e37e04156 to your computer and use it in GitHub Desktop.
killport
# 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