Skip to content

Instantly share code, notes, and snippets.

@mikeage
Last active February 15, 2024 08:01
Show Gist options
  • Save mikeage/4d5c7fe500adc142b087dc4432af116f to your computer and use it in GitHub Desktop.
Save mikeage/4d5c7fe500adc142b087dc4432af116f to your computer and use it in GitHub Desktop.
if [[ $0 != -* ]]
then
echo "Error: run this script with "source $0.sh" instead of running it directly"
exit 1
fi
shopt -s histappend
export PS1='[$? \[$(tput setaf 6)\]${SSH_USER:-???} \u@\h\[\e[0m\] \[\e[91m\]\w\[\e[0m\]]\$ '
export KUBECONFIG=/root/.kube/config_${SSH_USER}
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward' ; history -r
if [ ! -f /usr/share/terminfo/a/alacritty ]
then
wget https://raw.githubusercontent.com/alacritty/alacritty/master/extra/alacritty.info
tic -xe alacritty,alacritty-direct alacritty.info
rm alacritty.info
fi
export HISTFILE=/root/.bash_history_$SSH_USER
export PROMPT_COMMAND='history -a'
history -c
history -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment