source /usr/share/wcd/wcd-include.sh
fi
-if [[ -s ~/.iank/ll-function ]]; then
- # shellcheck source=.iank/ll-function
+if [[ -s /a/bin/small-misc-bash/ll-function ]]; then
+ # shellcheck source=/a/bin/small-misc-bash/ll-function
+ source /a/bin/small-misc-bash/ll-function
+elif [[ -s ~/.iank/ll-function ]]; then
source ~/.iank/ll-function
fi
done
}
+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
+}
+# compare digs to the 2 servers
+# usage: digdiff @server1 @server2 DIG_ARGS
+# note: only the soa master nameserver will respond with
+# ra "recursive answer" flag. That difference is meaningless afaik.
+digdiff() {
+ local s1 s2
+ s1=$1
+ shift
+ s2=$1
+ shift
+ digsort $s1 "$@" | tee /tmp/digdiff
+ diff -u /tmp/digdiff <(digsort $s2 "$@")
+}
+
dt() {
date "+%A, %B %d, %r" "$@"
}
e() { echo "$@"; }
-# echo var. print var including escapes, etc
+# echo args
+ea() {
+ if (( ! $# )); then
+ echo no args
+ fi
+ for arg; do
+ printf "%qEOL\n" "${arg}"
+ printf "%s" "${arg}" |& hexdump -C
+ done
+}
+# echo vars. print var including escapes, etc
ev() {
- printf "%qEOL\n" "${!1}"
- printf "%s" "${!1}" |& hexdump -C
+ if (( ! $# )); then
+ echo no args
+ fi
+ for arg; do
+ printf "%qEOL\n" "${!arg}"
+ printf "%s" "${!arg}" |& hexdump -C
+ done
}
eless() {
less /var/log/exim4/mainlog
}
+eqcat() {
+ exiqgrep -i | while read i; do
+ exim -Mvh $i; hr; exim -Mvb $i; hr;
+ exigrep $i /var/log/exim4/mainlog; hr
+ done
+}
# shellcheck disable=SC2032
}
p8() { ping 8.8.8.8; }
+p6() { ping6 2001:4860:4860::8888; }
pkx() { # package extract
local pkg cached tmp f