Skip to content

Commit

Permalink
fix aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrand committed Dec 4, 2023
1 parent 1ce07e4 commit 2f59a03
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions tools/bash_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,39 @@ alias pull='git pull --rebase ; git fetch --prune'
alias push='git pull --rebase ; git fetch --prune ; git push'
alias status='git status'

#--- Cli aliases
#--- Bosh clis aliases
alias bosh-depls-failed="bosh is --json | jq -r '.Tables[].Rows[]|select(.process_state == (\"failing\",\"unresponsive agent\"))|.deployment + \" (\" + .instance + \") : \" + .process_state'"
alias bosh-events="bosh events | grep \"hm \" | grep -E \"create|delete\""
alias bosh-task='function __bt() { bosh task $1 --debug | grep -vE " BEGIN| COMMIT| SELECT |INSERT INTO|DELETE FROM| UPDATE | WHERE |Renewing lock"; }; __bt'
alias check-k8s='/usr/local/bin/check-k8s.sh'
alias clean-prometheus-tasks='for var in $(bosh tasks | grep "prometheus" | grep -E "queued|processing" | sed -e "s+\t.*++g") ; do bosh cancel-task $var ; done'
alias credhub-get='function __cg() { index=$2 ; log-credhub -i ; credhub get -n $1 --versions=$(($index + 1)) -j | jq -r .versions[$index].value; }; __cg'
alias fly='fly -t concourse'
alias get-minio-token='kctx core-connectivity ; kubectl -n 60-minio-operator get secret $(kubectl -n 60-minio-operator get serviceaccount console-sa -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode'
alias hm-bosh-tasks="bosh tasks -a -r=20000 --json | jq -r '.Tables[].Rows[]|select(.user == \"hm\")|.started_at + \" \" + .id + \" \" + .description + \" \" + .deployment + \" => \" + .result'"
alias k='/usr/local/bin/kubectl'
alias kctx='/usr/local/bin/kubectx'
alias kns='/usr/local/bin/kubens'
alias kube-tail='/usr/local/bin/kube-tail.sh'
alias kt='kube-tail'
alias k9s='if [ -f ${K9SCONFIG}/config.yml ] ; then sed -i "s+logoless:.*+logoless: true+" ${K9SCONFIG}/config.yml ; fi ; k9s'
alias k9s-screen='/usr/local/bin/k9s-screen.sh'
alias log-bosh='. /usr/local/bin/log-bosh.sh'
alias log-cf='. /usr/local/bin/log-cf.sh'
alias log-credhub='. /usr/local/bin/log-credhub.sh'
alias log-fly='. /usr/local/bin/log-fly.sh'
alias log-govc='. /usr/local/bin/log-govc.sh'
alias log-k8s='. /usr/local/bin/log-k8s.sh'
alias log-openstack='. /usr/local/bin/log-openstack.sh'
alias log-shield='. /usr/local/bin/log-shield.sh'
alias log-uaac='. /usr/local/bin/log-uaac.sh'
alias os='openstack'
alias prune-workers='fly prune-worker -a'
alias recreate-workers='bosh -d concourse recreate worker --canaries=0 --max-in-flight=10'
alias switch='. /usr/local/bin/switch.sh'

#--- k8s aliases
alias check-k8s='/usr/local/bin/check-k8s.sh'
alias get-minio-token='kctx core-connectivity ; kubectl -n 60-minio-operator get secret $(kubectl -n 60-minio-operator get serviceaccount console-sa -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode'
alias k='/usr/local/bin/kubectl'
alias kctx='/usr/local/bin/kubectx'
alias kns='/usr/local/bin/kubens'
alias kube-editor='. /usr/local/bin/kube-editor.sh'
alias kube-tail='/usr/local/bin/kube-tail.sh'
alias kt='kube-tail'
alias k9s='if [ -f ${K9SCONFIG}/config.yml ] ; then sed -i "s+logoless:.*+logoless: true+" ${K9SCONFIG}/config.yml ; fi ; k9s'
alias k9s-screen='/usr/local/bin/k9s-screen.sh'
alias log-k8s='. /usr/local/bin/log-k8s.sh'
alias testkube='function __tk() { cmd="$1" ; params="$@" ; if [ "${cmd}" = "get" ] || [ "${cmd}" = "g" ] ; then flag="--label kusto=$(kubectl ns -c)" ; else flag="" ; fi ; tk ${params} ${flag} ; }; __tk'
alias tk='testkube'

Expand All @@ -51,7 +54,6 @@ alias dsh='function __dsh() { docker exec -it $1 sh; }; __dsh'
alias diff='colordiff'
alias f='function __f() { printf "%100s\n"|tr " " "=";find . ! -regex ".*[/]\.git[/]?.*" ! -regex ".*last-deployment-failure\.yml" -type f,l -not -xtype l -not -xtype d -print0 | xargs -0 grep -I -i --color "$1";unset -f __f;printf "%100s\n"|tr " " "="; }; __f'
alias generate-password='apg -MCLN -n 1 -m 30'
alias kube-editor='. /usr/local/bin/kube-editor.sh'
alias ps1-clear='unset BOSH_TARGET ; unset K8S_CONTEXT'
alias proxy='. /usr/local/bin/proxy.sh'
alias show-cert='function __scrt() { openssl x509 -text -certopt no_header,no_version,no_signame,no_pubkey,no_sigdump -nocert -in $1; }; __scrt'
Expand Down

0 comments on commit 2f59a03

Please sign in to comment.