Skip to content

Instantly share code, notes, and snippets.

@mridulgain
Created November 9, 2023 12:40
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 mridulgain/7c386f7d1597cf06ff7ea8f2d2160ba7 to your computer and use it in GitHub Desktop.
Save mridulgain/7c386f7d1597cf06ff7ea8f2d2160ba7 to your computer and use it in GitHub Desktop.
My .bashrc additions
# go
export PATH=$PATH:$(go env GOPATH)/bin
# java
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
# kubebuilder autocompletion
if [ -f /usr/local/share/bash-completion/bash_completion ]; then
. /usr/local/share/bash-completion/bash_completion
fi
. <(kubebuilder completion bash)
# color codes
NORMAL="\[\e[00m\]" # Normal
BOLD="\[\e[1m\]" # Bold
BLACK="\[\e[0;30m\]" # Black
RED="\[\e[1;31m\]" # Red
GREEN="\[\e[0;32m\]" # Green
YELLOW="\[\e[0;33m\]" # Yellow
BLUE="\[\e[0;34m\]" # Blue
PURPLE="\[\e[0;35m\]" # Purple
CYAN="\[\e[0;36m\]" # Cyan
WHITE="\[\e[0;37m\]" # White
BOLD_GREEN="\[\e[1;32m\]" # Bold & Green
BOLD_BLUE="\[\e[1;34m\]"
# kubernetes context aware prompt
function kprompt() {
# https://github.com/jonmosco/kube-ps1
source /home/avesha/local_lab/prompt/kube-ps1/kube-ps1.sh
# "$(kube_ps1)" -> function will be evaluated and assigned as a string, so the value is static
# '$(kube_ps1)' -> each time the assigned string is refered, the function will execute & thus returns dynamic value
# PS1="[$BOLD_GREEN\u@\h $CYAN\W $NORMAL$(kube_ps1)]\$ "
PS1='[\[\e[1;32m\]\u@\h \[\e[0;36m\]\W \[\e[00m\]$(kube_ps1)]\$ '
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment