-allmyirc() {
- local d
- d=/var/lib/znc/moddata/log/iank/freenode
- ssh root@iankelling.org "cd $d; find . -mtime -60 -type f -exec grep '\<iank.*' {} +" | sed -r 's,^..([^/]*)/(.{11})(.{5})(.{8}).,\2\4 \1,' | sort
+
+# my profanity
+#
+myprof() {
+ pushd /home/iank/.local/share/profanity/chatlogs/iank_at_fsf.org/rooms/office_at_conference.fsf.org
+ logs=(*)
+ logcount=${#logs[@]}
+ if (( logcount > 15 )); then
+ i=$(( logcount - 15 ))
+ else
+ i=0
+ fi
+ # usually do this on monday, sometimes later
+ if [[ $(date +%A) == Monday ]]; then
+ min_date=$(date -d 'monday 2 weeks ago' +%s)
+ else
+ min_date=$(date -d 'monday 3 weeks ago' +%s)
+ fi
+ for (( ; i < logcount; i++ )); do
+ log=${logs[$i]}
+ d=$(date -d "$(head -n1 $log|awk '{print $1}')" +%s)
+ if (( d < min_date )); then
+ continue
+ fi
+ if awk '$3 == "iank:"' $log | sed -r 's/^(.{10}).(.{8})[^ ]+(.*)/\1_\2\3/' | grep .; then
+ hr
+ fi
+ done
+ popd
+}
+
+# Tail pms in the last day, for the case where we restart profanity and
+# didn't check for pms beforehand. Assume the most recent logs are on kd.
+# If that isn't the case, use prof-recent-local
+prof-recent() {
+ case $HOSTNAME in
+ kd)
+ prof-recent-local
+ ;;
+ *)
+ ssh b8.nz prof-recent-local
+ ;;
+ esac