Skip to content

Instantly share code, notes, and snippets.

@claudiobizzotto
Last active August 3, 2019 20:48
Show Gist options
  • Save claudiobizzotto/947c1afe69c2e9e6f627003ecb920059 to your computer and use it in GitHub Desktop.
Save claudiobizzotto/947c1afe69c2e9e6f627003ecb920059 to your computer and use it in GitHub Desktop.
Some of my sweetest bash aliases
# General
alias diffall="diff --brief --recursive --new-file"
# Networking
alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
# GPG
alias keys="gpg --list-secret-keys --keyid-format LONG"
# Python SimpleHTTPServer
alias simple-server="python -m SimpleHTTPServer 8000"
# Python json escape (for use with cURL)
jescape () {
printf %s $1 | python -c 'import json,sys,re; print(json.dumps(re.sub("\s+", " ", sys.stdin.read()).strip()))'
}
# Kubernetes
alias kcontainers='kubectl get pod $pod -o jsonpath="{.spec['"'"'containers'"'"','"'"'initContainers'"'"'][*].name}"'
alias kshell="kubectl run kshell --rm -i --tty --image centos -n dev -- bash"
alias mtls="kubectl get MeshPolicy default -o yaml"
# GCP (Google Cloud)
alias liens='gcloud alpha resource-manager liens list'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment