Skip to content

Instantly share code, notes, and snippets.

@jbharter
Last active January 8, 2019 18:58
Show Gist options
  • Save jbharter/6800dcd98c439989327e621290843752 to your computer and use it in GitHub Desktop.
Save jbharter/6800dcd98c439989327e621290843752 to your computer and use it in GitHub Desktop.
Current bash profile, been working with Kubernetes a lot lately.
##### Bash Setup
# Lots of inspiration and straight up copypasta from Nathaniel Landau
# https://natelandau.com/my-mac-osx-bash_profile/
# source potential .bashrc?
if [ -f $HOME/.bashrc ];
then
source "$HOME/.bashrc"
fi
##### More Sources
# Load up convenience aliases
if [ -f "$HOME/GitHub/jbharter/utilities/aliases.bash.sh" ];
then
source "$HOME/GitHub/jbharter/utilities/aliases.bash.sh";
fi
# Load up convenience functions
if [ -f "$HOME/GitHub/jbharter/utilities/utilities.bash.sh" ];
then
source "$HOME/GitHub/jbharter/utilities/utilities.bash.sh";
fi
# updates PATH for the Google Cloud SDK.
if [ -f "$HOME/Applications/google-cloud-sdk/path.bash.inc" ];
then
source "$HOME/Applications/google-cloud-sdk/path.bash.inc";
fi
# enables shell command completion for gcloud.
if [ -f "$HOME/Applications/google-cloud-sdk/completion.bash.inc" ];
then
source "$HOME/Applications/google-cloud-sdk/completion.bash.inc";
fi
# source bash_completion
if [ -f /usr/local/etc/bash_completion ];
then
source "/usr/local/etc/bash_completion"
fi
# source kube_ps1
if [ -f $HOME/GitHub/jonmosco/kube-ps1/kube-ps1.sh ];
then
source "$HOME/GitHub/jonmosco/kube-ps1/kube-ps1.sh"
fi
# source nvm
if [ -f $HOME/.nvm ];
then
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
fi
##### Bash Functions
trash () { command mv "$@" ~/.Trash ; }
mcd () { mkdir -p "$1" && cd "$1"; }
zipf () { zip -r "$1".zip "$1" ; }
ff () { /usr/bin/find . -name "$@" ; }
ff () { /usr/bin/find . -name "$@" ; } # ff: Find file under the current directory
ffs () { /usr/bin/find . -name "$@"'*' ; } # ffs: Find file whose name starts with a given string
ffe () { /usr/bin/find . -name '*'"$@" ; } # ffe: Find file whose name ends with a given string
##### Helpful env variables.
export JDKS=/Library/Java/JavaVirtualMachines
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
# Add helpful jars to CP for scala console and such.
export MVN_REPOS="$HOME/.m2/repository"
export CLASSPATH="$MVN_REPOS/com/acxiom/uds/uds-document-id-encryption/1.4.0/uds-document-id-encryption-1.4.0.jar"
export CLASSPATH="$CLASSPATH:$MVN_REPOS/commons-codec/commons-codec/1.11/commons-codec-1.11.jar"
export CLASSPATH="$CLASSPATH:$MVN_REPOS/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar"
export CLASSPATH="$CLASSPATH:$MVN_REPOS/org/apache/commons/commons-lang3/3.6/commons-lang3-3.6.jar"
export EDITOR=emacs
# Set default blocksize for ls, df, du
# from this: http://hints.macworld.com/comment.php?mode=view&cid=24491
# ------------------------------------------------------------
export BLOCKSIZE=1k
#export LSCOLORS=exfxcxdxBxegedabagacad
# Disable kube_ps1 symbol
export KUBE_PS1_SYMBOL_ENABLE=false
complete -C /usr/local/bin/vault vault
export GOPATH=$HOME/.go
#export PROMPT_COMMAND=set_prompt
set_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment