Created
September 1, 2019 17:22
-
-
Save selivan/dcbc5183b9fd62afc842e47476b0fcfb to your computer and use it in GitHub Desktop.
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
# change shell title before running ssh | |
function ssh() { | |
# mess with title only if shell is interactive | |
# .bashrc should have a guard against non-interactive execution | |
# so this is just for additional safety - not good idea to break ssh | |
if [[ $- == *i* ]]; then | |
local host=$(echo "$@" | sed 's/-[a-zA-Z] //' | tr -d ' ' | cut -d' ' -f1) | |
echo -ne "\033]0;$host\007" | |
fi | |
$(type -f -p ssh || echo /usr/bin/ssh) "$@" | |
} | |
alias vpnjob='echo -ne "\033]0;vpn\007" ; sudo /usr/sbin/openvpn --config "$HOME"/work/job/vpn/my.ovpn' | |
#test -n "$TMOUT" && exec sh -c "unset TMOUT; exec bash" | |
#alias fuckoff='exec sh -c "unset TMOUT; exec bash"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment