Created
January 20, 2024 08:29
-
-
Save Fatpandac/cecec277672ee3b042afeb845fe87487 to your computer and use it in GitHub Desktop.
List all the local nodes and Python servers.
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
lss() { | |
select=$(lsof -Pn | grep LISTEN | awk '{cmd = "ps -o command= -p"$2; printf "%s ||| %s ||| ",$1,$9; system(cmd)}' | grep -iE '^node|^python' | fzf) | |
if [ -z != $select ];then | |
port=$(echo $select | awk '{print $3}' | cut -d':' -f2) | |
localIP=$(ipconfig getifaddr en0) | |
open http://$localIP:$port | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment