Created
July 17, 2019 14:13
-
-
Save gvko/030bce1e95aa3450e0cda4166fad69fa to your computer and use it in GitHub Desktop.
aliases
This file contains 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
## set Nano as default editor | |
export EDITOR=nano | |
## DOCKER | |
# Stop/kill all running containers. | |
alias dockerkillall='docker kill $(docker ps -q)' | |
# Delete stopped containers. | |
alias dockercleanc='printf "\n===> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)' | |
# Delete untagged images. | |
alias dockercleanimages='printf "\n===> Deleting untagged images\n\n" && docker rmi $(docker images --filter "dangling=true" -q --no-trunc)' | |
# Delete dangling volumes | |
alias dockercleanvolumes='printf "\n===> Deleting dangling volumes\n\n" && docker volume rm $(docker volume ls -qf dangling=true)' | |
# Delete all stopped containers and untagged images. | |
alias dockerclean='dockercleanimages || true && dockercleanvolumes' | |
# Eval/start docker | |
alias dockerstart='eval "$(docker-machine env default)"' | |
# Enter a container | |
enter_docker_container() { | |
docker exec -ti $1 bash | |
} | |
alias container='enter_docker_container' | |
# LazyDocker | |
alias lzd='lazydocker' | |
## Login Docker to ECR | |
alias docker-login-ecr="eval $(aws ecr get-login --no-include-email --region eu-central-1)" | |
## manipulating .zshrc | |
alias nanozsh='nano ~/.zshrc' | |
alias sourcezsh='source ~/.zshrc' | |
alias catzsh='cat ~/.zshrc' | |
alias openzsh='open ~/.zshrc' | |
alias sublzsh='subl ~/.zshrc' | |
alias ohmyzsh="open ~/.oh-my-zsh" | |
## Git aliases | |
alias firstpush='git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)' | |
alias gpush='git push origin $(git rev-parse --abbrev-ref HEAD)' | |
alias gpull='git pull origin $(git rev-parse --abbrev-ref HEAD)' | |
alias git-sync='git pull -r && git push' | |
alias gitclean='~/developer/random/git-clean-old-branches.sh' | |
alias smash='git aa && git cm -m $1 && git p' | |
## General aliases | |
alias ll='ls -laG' # lists dir + hidden files, info and colourizes the output | |
alias fix-spotlight='find . -type d -name "node_modules" -exec touch "{}/.metadata_never_index" \;' | |
alias npmclean='rm -rf node_modules/ && npm i' | |
alias tree="find . -print -maxdepth 2 | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" | |
alias tree3="find . -print -maxdepth 3 | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" | |
## Terraform | |
alias trf='terraform' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment