Skip to content

Instantly share code, notes, and snippets.

@sshtmc
Last active June 25, 2023 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sshtmc/6e30036ffbf0f5a839ca23faebc9479f to your computer and use it in GitHub Desktop.
Save sshtmc/6e30036ffbf0f5a839ca23faebc9479f to your computer and use it in GitHub Desktop.
##### Keep history from all terminal sessions
# Avoid duplicates
HISTCONTROL=ignoredups:erasedups
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend
# After each command, append to the history file and reread it
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
##### Pyenv
# curl https://pyenv.run | bash
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# Restart your shell for the changes to take effect.
# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:
eval "$(pyenv virtualenv-init -)"
##### direnv
eval "$(direnv hook bash)"
##### ssh-agent
export SSH_AUTH_SOCK=${SSH_AUTH_SOCK:-~/.ssh/ssh_auth_sock}
if ! ssh-add -l > /dev/null && ls $HOME/.ssh/id*.pub >/dev/null 2>&1; then
pkill ssh-agent
eval "$(ssh-agent)"
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
ssh-add
fi
cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment