Last active
October 14, 2023 16:42
-
-
Save jiimaho/3a431022b2bb657adc58833b710f963a to your computer and use it in GitHub Desktop.
List process listening on port
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
# Below content is in .zshrc file normally under ~/.zshrc | |
# Do NOT replace your entire .zshrc with this content, but rather pick the pieces and APPEND to your existing .zshrc | |
# DOTNET | |
alias dri="dotnet restore --interactive" | |
alias db="dotnet build" | |
# K8S | |
# Usage: kx <context> | |
kx() { | |
kubectl config use-context $1 | |
} | |
alias k=kubectl | |
[[ $commands[kubectl] ]] && source <(kubectl completion zsh) | |
# SUBLIME | |
export EDITOR="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" | |
# LAZYGIT | |
# Usage: lg | |
lg() | |
{ | |
export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir | |
lazygit "$@" | |
if [ -f $LAZYGIT_NEW_DIR_FILE ]; then | |
cd "$(cat $LAZYGIT_NEW_DIR_FILE)" | |
rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null | |
fi | |
} | |
# LAZYDOCKER | |
alias ld=lazydocker | |
# NETWORKING | |
# Usage: listening <PORT> | |
listening() { | |
if [ $# -eq 0 ]; then | |
lsof -iTCP -sTCP:LISTEN -n -P | |
elif [ $# -eq 1 ]; then | |
lsof -iTCP -sTCP:LISTEN -n -P | grep -i --color $1 | |
else | |
echo "Usage: listening [pattern]" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment