.bashrc_append_this 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #######################################
  2. # APPEND this to your .bashrc
  3. #######################################
  4. # Source local .bashrc customization from this file
  5. if [ -f ~/.bashrc_local ]; then
  6. . ~/.bashrc_local
  7. fi
  8. # Source local aliases from this file
  9. if [ -f ~/.bash_aliases ]; then
  10. . ~/.bash_aliases
  11. fi
  12. export PS1="\[$(tput bold)\]\[\033[48;5;139m\]\w\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]\\$ \[$(tput sgr0)\]"
  13. vaulthelper() {
  14. if [ $(ifconfig | grep -A2 '^utun[0-9]:' | grep -c '[[:space:]]inet 172.31.251') -eq 1 ]; then
  15. $(~/git/vault-helper -keychain -username $(id -un));
  16. launchctl setenv VAULT_TOKEN $VAULT_TOKEN
  17. else
  18. echo "You're not connected to Unic VPN, vaulthelper won't work"
  19. fi
  20. }
  21. if [ -z $(launchctl getenv VAULT_TOKEN) ]
  22. then
  23. vaulthelper
  24. else
  25. export VAULT_TOKEN=$(launchctl getenv VAULT_TOKEN)
  26. fi
  27. # Fetch a Splunk auth token for ansible history
  28. 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
  29. export VIRTUALENV_PYTHON=/usr/local/bin/python3
  30. export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
  31. export WORKON_HOME=~/python_envs/
  32. source /usr/local/bin/virtualenvwrapper.sh
  33. eval $(thefuck --alias)
  34. test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
  35. ulimit -n 1024
  36. . "$HOME/.cargo/env"