Skip to content

Instantly share code, notes, and snippets.

@mtintes
Last active January 4, 2021 20:45
Show Gist options
  • Save mtintes/286d3fc28613460fe193f521bdcbf606 to your computer and use it in GitHub Desktop.
Save mtintes/286d3fc28613460fe193f521bdcbf606 to your computer and use it in GitHub Desktop.
useful aliases and functions that i dont want to remember.
#run an alpine container in interactive mode to debug with k8s or docker. Helpful for finding network junk.
alias kbb="kubectl run -it --rm --restart=Never alpine --image=alpine sh"
alias dbb="docker run --name alpine --rm -i -t alpine sh"
#find the program highjacking that port you wanted to use
function port() {lsof -i tcp:$1}
# DOCKER
#get all the docker ps without all the k8s processes
alias dps="docker ps | grep -v k8s"
#removes some old junk containers that are not running.
alias dclear="docker rm $(docker ps -a -q)"
#kill all the dangling images
alias dangle="docker rmi $(docker images -f "dangling=true" -q)"
#Git Aliases
http://ses4j.github.io/2020/04/01/git-alias-recent-branches/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment