Skip to content

Instantly share code, notes, and snippets.

@kyokuheki
Last active July 6, 2018 01:37
Show Gist options
  • Save kyokuheki/eaab9c667a39881171f260e8befceed5 to your computer and use it in GitHub Desktop.
Save kyokuheki/eaab9c667a39881171f260e8befceed5 to your computer and use it in GitHub Desktop.
よく使うコマンド
alias getwip='/usr/bin/curl -sS httpbin.org/ip | jq .origin'
alias httbin='/usr/bin/wget httpbin.org/ip -qO-'
alias ping8='ping 8.8.8.8'
alias ping1='ping 1.1.1.1'
alias pingv68='ping6 2001:4860:4860::8888'
alias pingv61='ping6 2606:4700:4700::1111'
alias passwdgen='openssl passwd -1 -salt `openssl rand -base64 8`'
# mac
opendiff
alias cot='open -a coteditor'
# lsof locked_file_path
# lsof +D locked_dir_path
function ss () {
case $1 in
-*l*) sudo lsof -nP -iTCP -sTCP:LISTEN;;
-*l*4*) sudo lsof -nP -i4TCP -sTCP:LISTEN;;
-*4*l*) sudo lsof -nP -i4TCP -sTCP:LISTEN;;
-*l*6*) sudo lsof -nP -i6TCP -sTCP:LISTEN;;
-*6*l*) sudo lsof -nP -i6TCP -sTCP:LISTEN;;
-*a*) sudo lsof -nP -iTCP -iUDP;;
*) netstat -nav -p tcp;;
esac
}
# cygwin
hd () { cygstart `which hidemaru` $(cygpath -w "$@") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment