My dotfiles. Period.

azzgoat.bashrc 1.7KB

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