Skip to content

Instantly share code, notes, and snippets.

@randallb
Created August 30, 2016 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randallb/451887ebf40ca7a9f43f7936d8b89997 to your computer and use it in GitHub Desktop.
Save randallb/451887ebf40ca7a9f43f7936d8b89997 to your computer and use it in GitHub Desktop.
# to get rid of tunnelss issue
# searchAndDestroy 443
searchAndDestroy() {
sudo lsof -n -i4TCP:$1 | grep LISTEN | awk '{print $2}' | xargs sudo kill -9
echo "Port" $1 "found and killed."
}
alias killTunnels="searchAndDestroy 443"
alias destroyAll="searchAndDestroy 443; searchAndDestroy 6379; searchAndDestroy 5000; searchAndDestroy 5100; searchAndDestroy 5200; searchAndDestroy 5300; searchAndDestroy 5400; "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment