12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #!/bin/bash
-
- ### .... ###
- ### BASH ###
- ### '''' ###
-
- make_ps1h() {
- echo "$red\h$normal";
- }
-
- # my tools as aliases
- alias winpdb="$HOME/local/winpdb/winpdb"
- alias node="$HOME/local/node/bin/node"
- alias npm="$HOME/local/node/bin/npm"
- alias tap="./node_modules/tap/bin/tap.js"
- alias tap-reader="./node_modules/tap/bin/tap-reader.js"
-
- alias diff="colordiff -u"
-
-
- ### ...... ###
- ### OTHERS ###
- ### '''''' ###
-
- # tame minions
- export PERL5LIB="$PERL5LIB:$HOME/lib/minions/lib"
- export PERL5LIB="$PERL5LIB:$HOME/local/gnucash-importer/lib"
-
- export EDITOR='vim'
-
- ### ................ ###
- ### SET UP SSH-AGENT ###
- ### '''''''''''''''' ###
-
- # http://mah.everybody.org/docs/ssh#run-ssh-agent
-
- SSH_ENV="$HOME/.ssh/environment"
-
- function start_agent {
- echo "Initialising new SSH agent..."
- /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
- echo succeeded
- chmod 600 "${SSH_ENV}"
- . "${SSH_ENV}" > /dev/null
- /usr/bin/ssh-add;
- }
-
- # Source SSH settings, if applicable
-
- if [ -f "${SSH_ENV}" ]; then
- . "${SSH_ENV}" > /dev/null
- #ps ${SSH_AGENT_PID} doesn't work under cywgin
- ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
- start_agent;
- }
- else
- start_agent;
- fi
-
- ### .................. ###
- ### RUN BYOBU IF SSH'D ###
- ### '''''''''''''''''' ###
-
- # (but only it this is a login shell)
-
- if shopt -q login_shell
- then
- if [ -n "$SSH_CONNECTION" ]
- then
- byobu
- exit
- fi
- fi
|