Skip to content

Instantly share code, notes, and snippets.

@kudrevatykh
Last active August 29, 2015 14:22
Show Gist options
  • Save kudrevatykh/a7518be9c249415667bf to your computer and use it in GitHub Desktop.
Save kudrevatykh/a7518be9c249415667bf to your computer and use it in GitHub Desktop.
bash profile snippet

snippets for bash_profile, mainly for servers with ssh access

##GPG AGENT##
if [ -f "$HOME"/.gpg-agent-info ]; then
eval $(cat "$HOME"/.gpg-agent-info)
eval $(cut -d= -f 1 < "$HOME"/.gpg-agent-info | xargs echo export)
fi
gpg-connect-agent /bye 2> /dev/null
if [ $? != 0 ] ; then
eval $(gpg-agent --daemon --write-env-file)
fi
GPG_TTY=$(tty)
export GPG_TTY
##SSH AGENT AND SCREEN/TMUX##
if [ -n "$SSH_TTY" -a -S "$SSH_AUTH_SOCK" ]; then
ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh-auth-sock"
SSH_AUTH_SOCK="$HOME/.ssh/ssh-auth-sock"
export SSH_AUTH_SOCK
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment