My dotfiles. Period.

azzgoat.bashrc 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. # Add RVM to PATH for scripting
  35. export PATH=$PATH:$HOME/.rvm/bin
  36. export EDITOR='vim'
  37. ### ................ ###
  38. ### SET UP SSH-AGENT ###
  39. ### '''''''''''''''' ###
  40. # http://mah.everybody.org/docs/ssh#run-ssh-agent
  41. SSH_ENV="$HOME/.ssh/environment"
  42. function start_agent {
  43. echo "Initialising new SSH agent..."
  44. /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
  45. echo succeeded
  46. chmod 600 "${SSH_ENV}"
  47. . "${SSH_ENV}" > /dev/null
  48. /usr/bin/ssh-add;
  49. }
  50. # Source SSH settings, if applicable
  51. if [ -f "${SSH_ENV}" ]; then
  52. . "${SSH_ENV}" > /dev/null
  53. #ps ${SSH_AGENT_PID} doesn't work under cywgin
  54. ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
  55. start_agent;
  56. }
  57. else
  58. start_agent;
  59. fi
  60. ### .................. ###
  61. ### RUN BYOBU IF SSH'D ###
  62. ### '''''''''''''''''' ###
  63. # (but only it this is a login shell)
  64. if shopt -q login_shell
  65. then
  66. if [ -n "$SSH_CONNECTION" ]
  67. then
  68. byobu
  69. exit
  70. fi
  71. fi