}
-dat() { # do all tee, for more complex scripts
- tee >(ssh frodo bash -l) >(bash -l) >(ssh x2 bash -l) >(ssh tp bash -l)
+# do all tee.
+# pipe to this, or just type like a shell
+dat() {
+ tee >(ssh frodo.b8.nz bash -l) >(ssh x2 bash -l) >(ssh tp.b8.nz bash -l) >(ssh kw bash -l) >(ssh tp.b8.nz bash -l)
}
da() { # do all
local host
- "$@"
- for host in x2 tp kd; do
- ssh $host $(printf "")
+ for host in x2 kw tp.b8.nz x3.b8.nz frodo.b8.nz; do
+ ssh $host "$@"
done
}
sudo sed -ri "/http.us.debian.org/ s@( *[^ #]+ +)[^ ]+([^#]+).*@\1$url\2# http.us.debian.org@" /etc/apt/sources.list
sudo apt-get update
}
-dig() {
- command dig +nostats +nocmd "$@"
-}
-# Output with sections sorted, and removal of query id, so 2 dig outputs can be diffed.
-digsort() {
- local sec
- sec=
- dig +nordflag "$@" | sed -r 's/^(;; ->>HEADER<<-.*), id: .*/\1/' | while read -r l; do
- if [[ $l == [^\;]* ]]; then
- sec+="$l"$'\n'
- else
- if [[ $sec ]]; then
- printf "%s" "$sec" | sort
- sec=
- fi
- printf "%s\n" "$l"
- fi
- done
-}
-# note: only the soa master nameserver will respond with
-# ra "recursive answer" flag. That difference is meaningless afaik.
-# Same thing happens with gnu nameservers.
digme() {
- digsort "$@" @ns1.iankelling.org | tee /tmp/digme
- diff -u /tmp/digme <(digsort "$@" @ns2.iankelling.org)
+ digdiff @ns{1,2}.iankelling.org "$@"
}
local ran_d
ran_d=false
case $PS1 in
- *DISTRO-BEGIN*)
+ *DISTRO-BEGIN!*|*DISTRO!*)
/b/ds/distro-begin || return $?
ran_d=true
;;&
- *DISTRO-END*)
+ *DISTRO-END!*|*DISTRO!*)
/b/ds/distro-end || return $?
ran_d=true
;;&