Last active
December 7, 2023 18:25
-
-
Save alexdyukov/d1fcf7fb0780c791446360d8f389f095 to your computer and use it in GitHub Desktop.
bash 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
shopt -s histappend | |
export PROMPT_COMMAND='history -a' | |
export CGO_ENABLED="0" | |
export GOPATH=$HOME/go | |
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin:/usr/local/go/bin | |
COMMON_CREDITIAL='salt' | |
export GIT_SSH_COMMAND='ssh -i ~/.ssh/fake -o IdentitiesOnly=yes' | |
export GOPRIVATE=gitlab.mycompany.com | |
function gofix() { | |
for i in "$@"; do | |
test -e "${i}" || echo "gofix: cannot open ${i}" >&2 | |
test -e "${i}" && gofumpt -e -w -extra "${i}" && goimports -w "${i}" && go vet "$(basename ${i})" | |
done | |
} | |
function getcreds() { | |
echo u$(echo "${COMMON_CREDITIAL}${1}" | md5sum | shasum | sha512sum | cut -c 1-11) | |
echo "${COMMON_CREDITIAL}${1}" | md5sum | shasum | sha512sum | cut -c 12-28 | |
} | |
alias curltime='curl -w "time_namelookup:\t%{time_namelookup}\ntime_connect:\t\t%{time_connect}\ntime_appconnect:\t%{time_appconnect}\ntime_pretransfer:\t%{time_pretransfer}\ntime_redirect:\t\t%{time_redirect}\ntime_starttransfer:\t%{time_starttransfer}\n\t\t\t----------\ntime_total:\t\t%{time_total}\n" -o /dev/null -sL' | |
alias tmx="tmux a -t $USER || tmux new -s $USER" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment