Skip to content

Instantly share code, notes, and snippets.

@guelau
Last active March 9, 2021 20:09
Show Gist options
  • Save guelau/ed61d32968299878faca3def90fb8e29 to your computer and use it in GitHub Desktop.
Save guelau/ed61d32968299878faca3def90fb8e29 to your computer and use it in GitHub Desktop.
$HOME/.oh-my-zsh/custom/myCustomZsh.zsh
# Kubernetes
alias k="kubectl"
alias kx="kubectl config use-context"
alias kg='kubectl get'
alias kd='kubectl describe'
alias kgp='kubectl get pods'
alias kgns='kubectl get namespaces'
alias kgall='kubectl get ingress,service,deployment,pod,statefulset'
source <(kubectl completion zsh)
complete -F __start_kubectl k
# Search Alias (use ack and fd's applications)
alias g='ack'
alias f='fd'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# Screen helper (create, list and resume
alias sc="screen -S"
alias sl="screen -ls"
alias sr="screen -r"
alias j='jobs -l'
if [ $UID -ne 0 ]; then # if user is not root
alias reboot='sudo reboot'
alias update='sudo apt-get update && sudo apt-get upgrade' # Debian's user
else
alias update='apt-get update && apt-get upgrade'
fi
# Some other helpers
alias h='history'
alias path='echo -e ${PATH//:/\\n}'
alias now='date +"%T"'
alias curdate='date +"%d-%m-%Y"'
# In case of...
alias rm='rm -I --preserve-root'
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'
# ADD ~/bin directory in PATH
export PATH=$PATH:$HOME/bin
perf() {
OUTPUT_FORMAT="\
─────────────────────────\n\
namelookup\t%{time_namelookup}s\n\
connect\t\t%{time_connect}s\n\
appconnect\t%{time_appconnect}s\n\
pretransfer\t%{time_pretransfer}s\n\
redirect\t%{time_redirect}s\n\
starttransfer\t%{time_starttransfer}s\n\
─────────────────────────\n\
total\t\t%{time_total}s\n\
─────────────────────────\n"
curl -so /dev/null -w $OUTPUT_FORMAT "$@"
}
# Return json decoded string
d64() {
echo $@ | base64 -D | jq
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment