Skip to content

Instantly share code, notes, and snippets.

@indrasaputra
Last active June 23, 2022 03:12
Show Gist options
  • Save indrasaputra/718dca7d8c9b24d16bdb855fa3e5ea6d to your computer and use it in GitHub Desktop.
Save indrasaputra/718dca7d8c9b24d16bdb855fa3e5ea6d to your computer and use it in GitHub Desktop.
# delete all untagged docker images
docker rmi -f $(docker images -a | grep "<none>" | awk '{print $3}')
# delete all unnecessary volume
docker volume ls | grep -v DRIVER | awk '{print $2}' | grep -x '.\{30,100\}' | xargs docker volume rm
# delete all past container
docker ps -a | grep -v CONTAINER | awk '{print $1}' | xargs docker rm -f
removecontainers() {
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
}
armageddon() {
removecontainers
docker network prune -f
docker rmi -f $(docker images --filter dangling=true -qa)
docker volume rm $(docker volume ls --filter dangling=true -q)
docker rmi -f $(docker images -qa)
}
# git dev alias
alias setgitmaster='export GIT_DEFAULT_BRANCH=master'
alias setgitmain='export GIT_DEFAULT_BRANCH=main'
alias gcm='git checkout $GIT_DEFAULT_BRANCH'
alias gcmb='git checkout -b'
alias gpl='git pull'
alias ga='git add'
alias gpso='git push origin'
alias gpsob='git push origin $(git branch --show-current)'
alias gpsof='git push --force origin'
alias gpsofb='git push --force origin $(git branch --show-current)'
alias gplo='git pull origin'
alias gc='git commit -S -m'
alias gcn='git commit -S --no-verify -m'
alias gcb='git checkout'
alias gca='git commit -S --amend'
alias gcan='git commit -S --no-verify --amend'
alias gbd='git branch -D'
alias gmd='gcm && gpl && gbd'
alias gfo='git fetch origin'
export PATH=$PATH:$HOME/go/bin
export GIT_DEFAULT_BRANCH=main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment