+if [[ $(which -s pidof) -eq 0 ]]; then
+ function pidof () { ps -e -o pid,comm | grep "$1" | awk '{print $1}'; }
+fi
+
+function ssh-forget() {
+ sed -i "" "/^$1,/d" ~/.ssh/known_hosts
+}
+
+function ssh-learn() {
+ sed -i "" "/^$1,/d" ~/.ssh/known_hosts
+ ssh-keyscan -t rsa $1 >> ~/.ssh/known_hosts
+}
+
+function _ssh_complete() {
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ opts=$( grep -o '^[^, ]\+' ~/.ssh/known_hosts )
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+}
+complete -F _ssh_complete ssh
+
+function _ssh_screen () {
+ DISCONNECT=""
+ RECONNECT="-R"
+ HOST=$1
+ while [ "$2" != "" ]; do
+ case $2 in
+ -d | --disconnect )
+ DISCONNECT="-D"
+ ;;
+ * )
+ echo "Usage: $HOST [-d | --discconnect]"
+ return 1
+ ;;
+ esac
+ shift
+ done
+
+ ssh -t $HOST screen $DISCONNECT $RECONNECT
+}