Mercurial > index.cgi > dotfiles
comparison .bash_aliases @ 90:cdfa42697eec
Updated lds, added ldsauth and ldapsync
author | Steve Huston <huston@astro.princeton.edu> |
---|---|
date | Fri, 14 Jun 2013 16:54:18 -0400 |
parents | 0b67280c980c |
children | 9d5fcbb36232 |
comparison
equal
deleted
inserted
replaced
89:103f26c9f9f7 | 90:cdfa42697eec |
---|---|
111 # LDAP/host tools | 111 # LDAP/host tools |
112 alias ldm="ldapmodify -Z -x -W -c -D 'cn=DrAdmin,dc=astro,dc=princeton,dc=edu'" | 112 alias ldm="ldapmodify -Z -x -W -c -D 'cn=DrAdmin,dc=astro,dc=princeton,dc=edu'" |
113 alias ldsloop='while true; do read; clear; lds "$REPLY"; done' | 113 alias ldsloop='while true; do read; clear; lds "$REPLY"; done' |
114 alias hostmaster='ssh -x -a huston@arizona.princeton.edu /usr/oit/bin/hostinfo' | 114 alias hostmaster='ssh -x -a huston@arizona.princeton.edu /usr/oit/bin/hostinfo' |
115 | 115 |
116 lds () { | |
117 QUERY="$1" | |
118 shift | |
119 OPTS="" | |
120 [[ "$1" =~ ^- ]] && { | |
121 OPTS="$1" | |
122 shift | |
123 } | |
124 ldapsearch -LLL $OPTS -x "($QUERY)" $@ | |
125 } | |
126 | |
127 ldsauth () { | |
128 QUERY="$1" | |
129 shift | |
130 OPTS="" | |
131 [[ "$1" =~ ^- ]] && { | |
132 OPTS="$1" | |
133 shift | |
134 } | |
135 ldapsearch -LLL -Z -W -D cn=DrAdmin,dc=astro,dc=princeton,dc=edu $OPTS -x "($QUERY)" $@ | |
136 } | |
137 | |
138 ldapsync() { | |
139 for H in ldap ldap2 ldap3 ; do | |
140 echo -ne $H":\t" | |
141 ldapsearch -LLL -h $H.astro.princeton.edu -x -s base '(objectclass=*)' contextCSN | egrep -v '^($|dn)' | sed 's/contextCSN: //' | |
142 done | |
143 echo -ne "now:\t" | |
144 date -u +%Y%m%d%H%M%S | |
145 } | |
146 | |
116 # Other | 147 # Other |
117 alias condor_check="ls -lat /u/condor/hosts/*/log/MasterLog" | 148 alias condor_check="ls -lat /u/condor/hosts/*/log/MasterLog" |
118 alias slurp="wget -r -l1 -np -nd -A.mp3" | 149 alias slurp="wget -r -l1 -np -nd -A.mp3" |
119 | 150 |
120 # Other Functions | 151 # Other Functions |
121 | 152 |
122 lds() { | |
123 QUERY="$1" | |
124 shift | |
125 ldapsearch -LLL -x "($QUERY)" $@ | |
126 } | |
127 | 153 |
128 update_toodledo() { | 154 update_toodledo() { |
129 case `hostname -s` in | 155 case `hostname -s` in |
130 xanadu|syrinx) | 156 xanadu|syrinx) |
131 TOODLEDO_CMDS="toodledo tasks @Work; toodledo tasks @Anywhere" | 157 TOODLEDO_CMDS="toodledo tasks @Work; toodledo tasks @Anywhere" |