My dotfiles. Period.

azzgoat.bashrc 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/bash
  2. ### .... ###
  3. ### BASH ###
  4. ### '''' ###
  5. make_ps1h() {
  6. echo "$red\h$normal";
  7. }
  8. # my tools as aliases
  9. alias se="$HOME/bin/se"
  10. alias mkexec="$HOME/bin/mkexec.pl"
  11. alias cgo="$HOME/bin/cgo"
  12. alias opera-study="$HOME/bin/opera-study"
  13. alias opera-dwww="$HOME/bin/opera-dwww"
  14. alias winpdb="$HOME/local/winpdb/winpdb"
  15. alias node="$HOME/local/node/bin/node"
  16. alias npm="$HOME/local/node/bin/npm"
  17. alias tap="./node_modules/tap/bin/tap.js"
  18. alias tap-reader="./node_modules/tap/bin/tap-reader.js"
  19. alias git='~/bin/git'
  20. # keep modified stamps for some files
  21. alias vim='~/bin/vim-bx.pl'
  22. alias Markdown='~/bin/Markdown'
  23. alias diff="colordiff"
  24. # from minions
  25. alias autotest.pl='~/bin/autotest.pl'
  26. alias watchdump.pl='~/bin/watchdump.pl'
  27. # Linux counter
  28. alias lico-update.sh='~/bin/lico-update.sh'
  29. ### ...... ###
  30. ### OTHERS ###
  31. ### '''''' ###
  32. # tame minions
  33. export PERL5LIB="$PERL5LIB:$HOME/lib/minions/lib"
  34. export PERL5LIB="$PERL5LIB:$HOME/local/gnucash-importer/lib"
  35. # Add RVM to PATH for scripting
  36. export PATH=$PATH:$HOME/.rvm/bin
  37. export EDITOR='vim'
  38. ### ................ ###
  39. ### SET UP SSH-AGENT ###
  40. ### '''''''''''''''' ###
  41. # http://mah.everybody.org/docs/ssh#run-ssh-agent
  42. SSH_ENV="$HOME/.ssh/environment"
  43. function start_agent {
  44. echo "Initialising new SSH agent..."
  45. /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
  46. echo succeeded
  47. chmod 600 "${SSH_ENV}"
  48. . "${SSH_ENV}" > /dev/null
  49. /usr/bin/ssh-add;
  50. }
  51. # Source SSH settings, if applicable
  52. if [ -f "${SSH_ENV}" ]; then
  53. . "${SSH_ENV}" > /dev/null
  54. #ps ${SSH_AGENT_PID} doesn't work under cywgin
  55. ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
  56. start_agent;
  57. }
  58. else
  59. start_agent;
  60. fi
  61. ### .................. ###
  62. ### RUN BYOBU IF SSH'D ###
  63. ### '''''''''''''''''' ###
  64. # (but only it this is a login shell)
  65. if shopt -q login_shell
  66. then
  67. if [ -n "$SSH_CONNECTION" ]
  68. then
  69. byobu
  70. exit
  71. fi
  72. fi