Skip to content

Instantly share code, notes, and snippets.

@jazzytomato
Created April 18, 2019 12:01
Show Gist options
  • Save jazzytomato/b41dd10981caca44ac7211bea5c97fc1 to your computer and use it in GitHub Desktop.
Save jazzytomato/b41dd10981caca44ac7211bea5c97fc1 to your computer and use it in GitHub Desktop.
# set a badge with a hostname
# Also sets a bg color when in prod
function warnssh() {
printf "\e]1337;SetBadgeFormat=%s\a" $(echo -n $1 | base64)
if [[ $1 =~ "^prod-.*" ]] ; then
echo -e "\033]1337;SetColors=bg=612c62\a"
fi
ssh $*
printf "\e]1337;SetBadgeFormat=%s\a" ""
echo -e "\033]1337;SetColors=bg=000\a"
}
alias ssh='warnssh'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment