45 lines
1.4 KiB
Text
45 lines
1.4 KiB
Text
#######################################
|
|
# APPEND this to your .bashrc
|
|
#######################################
|
|
# Source local .bashrc customization from this file
|
|
if [ -f ~/.bashrc_local ]; then
|
|
. ~/.bashrc_local
|
|
fi
|
|
|
|
# Source local aliases from this file
|
|
if [ -f ~/.bash_aliases ]; then
|
|
. ~/.bash_aliases
|
|
fi
|
|
|
|
export PS1="\[$(tput bold)\]\[\033[48;5;139m\]\w\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]\\$ \[$(tput sgr0)\]"
|
|
|
|
vaulthelper() {
|
|
if [ $(ifconfig | grep -A2 '^utun[0-9]:' | grep -c '[[:space:]]inet 172.31.251') -eq 1 ]; then
|
|
$(~/git/vault-helper -keychain -username $(id -un));
|
|
launchctl setenv VAULT_TOKEN $VAULT_TOKEN
|
|
else
|
|
echo "You're not connected to Unic VPN, vaulthelper won't work"
|
|
fi
|
|
}
|
|
|
|
if [ -z $(launchctl getenv VAULT_TOKEN) ]
|
|
then
|
|
vaulthelper
|
|
else
|
|
export VAULT_TOKEN=$(launchctl getenv VAULT_TOKEN)
|
|
fi
|
|
|
|
# Fetch a Splunk auth token for ansible history
|
|
if [ ! -z $VAULT_TOKEN ]; then export SPLUNK_AUTHTOKEN=$(curl -X GET https://vault.unic.com/api/v1/secrets/14730/fields/api-key -H "Authorization: Bearer $VAULT_TOKEN" -s | tr -d \"); else echo "Splunk: \$VAULT_TOKEN not set"; fi
|
|
|
|
export VIRTUALENV_PYTHON=/usr/local/bin/python3
|
|
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
|
|
export WORKON_HOME=~/python_envs/
|
|
source /usr/local/bin/virtualenvwrapper.sh
|
|
|
|
eval $(thefuck --alias)
|
|
|
|
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
|
|
|
|
ulimit -n 1024
|
|
. "$HOME/.cargo/env"
|