diff .bash_aliases @ 198:6e7913283c7a

Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
author Steve Huston <huston@srhuston.net>
date Wed, 30 Sep 2020 11:21:14 -0400
parents 954d25f20123
children 7d3fe7399566
line wrap: on
line diff
--- a/.bash_aliases	Wed Sep 30 10:54:00 2020 -0400
+++ b/.bash_aliases	Wed Sep 30 11:21:14 2020 -0400
@@ -1,5 +1,3 @@
-# $Id$
-
 # Aliases are read from this file; no real reason to separate them out except
 # for readability.
 
@@ -48,28 +46,8 @@
 
 # SSH aliases
 alias bh='ssh csesbh2.princeton.edu'
-alias dh='ssh srhuston.net'
-alias j='ssh joshua.srhuston.net'
-alias keys='ssh-add $HOME/.ssh/*.pvt'
-alias r='ssh -l root'
-alias rf='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null -l root'
-alias rbh='ssh -t csesbh2.princeton.edu screen -raAx csesbh2'
-alias rj='ssh -t joshua.srhuston.net screen -raAx'
-alias rx='ssh -t xanadu.astro.princeton.edu screen -raAx'
-alias roc='ssh zenoss@rocinante'
-alias s=ssh
-alias sf='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null'
-t() {
-  T_HOST=xanadu.astro.princeton.edu
-  if [ -n "$2" ] ; then
-    T_HOST=$2
-  fi
-  ssh -t $T_HOST "ssh $1"
-}
-alias x='ssh xanadu.astro.princeton.edu'
-
-# SSH key signing with Vault for administration
 cert() {
+  # SSH key signing with Vault for administration
   export VAULT_ADDR='https://ajax.rc.princeton.edu:8200'
   ssh-add -d $HOME/.ssh/rc_vault_key-cert.pub > /dev/null 2>&1
   if vault login -method=radius username=vi-srh; then
@@ -79,6 +57,28 @@
     echo Failed to login to vault, aborting
   fi
 }
+alias dh='ssh srhuston.net'
+alias j='ssh joshua.srhuston.net'
+alias keys='ssh-add $HOME/.ssh/*.pvt'
+alias r='ssh -l root'
+alias rf='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null -l root'
+alias rbh='ssh -t csesbh2.princeton.edu screen -raAx csesbh2'
+alias rj='ssh -t joshua.srhuston.net screen -raAx'
+alias rx='ssh -t xanadu.astro.princeton.edu screen -raAx'
+alias s=ssh
+alias sf='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null'
+t() {
+  # Tunneling SSH - a simple 't hostname' will tunnel to xanadu and then
+  # connect to hostname, while 't hostname tunnelhost' will connect to
+  # tunnelhost and then hostname
+  T_HOST=xanadu.astro.princeton.edu
+  if [ -n "$2" ] ; then
+    T_HOST=$2
+  fi
+  ssh -t $T_HOST "ssh $1"
+}
+alias x='ssh xanadu.astro.princeton.edu'
+
 
 # Proxying/tunneling - predominantly for my Mac laptop
 proxy() {
@@ -95,11 +95,6 @@
 
 # Remote desktop/VNC
 eval "alias milton='ssh -L9930:milton:5900 -f joshua.srhuston.net \"sleep 5\"; ${VNCVIEWER}localhost:9930 &'"
-# Xanadu VMs
-eval "alias xvm='ssh -L9909:localhost:5909 -f xanadu.astro.princeton.edu \"sleep 300\"; ${VNCVIEWER}localhost:9909 &'"
-eval "alias cygnus='ssh -L9910:localhost:5910 -f xanadu.astro.princeton.edu \"sleep 300\"; ${VNCVIEWER}localhost:9910 &'"
-eval "alias syrinx='ssh -L9911:localhost:5911 -f xanadu.astro.princeton.edu \"sleep 300\"; ${VNCVIEWER}localhost:9911 &'"
-eval "alias lyra='ssh -L9912:localhost:5912 -f xanadu.astro.princeton.edu \"sleep 300\"; ${VNCVIEWER}localhost:9912 &'"
 
 # Programs
 alias atari='atari800 -height 800 -width 600'
@@ -108,7 +103,6 @@
 alias pine='alpine'
 alias ret='screen -raAx'
 alias rot13="tr 'a-zA-Z' 'n-za-mN-ZA-M'"
-alias tops='unset STY; screen -c .screenrc.pbstops -S pbstop'
 tt () {
   OPTS="-G"
   if [ -e ${HOME}/.tt/${1}.tin ] ; then
@@ -131,7 +125,6 @@
 # LDAP/host tools
 alias ldm="ldapmodify -Q -Y GSSAPI -c"
 alias ldsloop='while true; do read; clear; lds "$REPLY"; done'
-alias hostmaster='ssh -x -a huston@arizona.princeton.edu /usr/oit/bin/hostinfo'
 
 lds () {
   QUERY="$1"
@@ -144,26 +137,6 @@
   ldapsearch -Q -Y GSSAPI -LLL $OPTS "($QUERY)" $@
 }
 
-ldsauth () {
-  QUERY="$1"
-  shift
-  OPTS=""
-  [[ "$1" =~ ^- ]] && {
-    OPTS="$1"
-    shift
-  }
-  ldapsearch -LLL -Z -W -D cn=DrAdmin,dc=astro,dc=princeton,dc=edu $OPTS -x "($QUERY)" $@
-}
-
-ldapsync() {
-  for H in ldap ldap2 ldap3 ; do
-    echo -ne $H":\t"
-    ldapsearch -LLL -h $H.astro.princeton.edu -x -s base '(objectclass=*)' contextCSN | egrep -v '^($|dn)' | sed 's/contextCSN: //'
-  done
-  echo -ne "now:\t"
-  date -u +%Y%m%d%H%M%S
-}
-
 # Other
 alias condor_check="ls -lat /u/condor/hosts/*/log/MasterLog"
 alias slurp="wget -r -l1 -np -nd -A.mp3"
@@ -179,17 +152,6 @@
   popd
 }
 
-tock() {
-  while true ; do
-    if [ `date +%S` -gt 42 ] ; then
-      if [ `date +%S` -lt 47 ] ; then
-        afplay /System/Library/Sounds/Pop.aiff &
-      fi
-    fi
-    sleep 1
-  done > /dev/null 2>&1
-}
-
 TOhtml() {
   OUTDIR=`mktemp -d TOHTML.XXXXXX`
   for F in `hg locate` ; do