-#### begin section that works with sl() function to return from
-# noninteractive ssh shells, or tty. tty because often i
-# use it when something is going and io is slow and my bashrc
-# is too slow.
+#### if (in
+# noninteractive ssh shells or tty). tty because often i use it when
+# something is going and io is slow and my bashrc is too slow.
if [[ $LC_USEBASHRC != t && ( $SSH_CONNECTION || $TERM == linux ) ]]; then
# Here we did not opt-in to running our .bashrc file so we just
# return, but we still setup a function to source it without returning
source $_tmp
fi
fi
+ if [[ $IANK_BASHRC_RUN ]]; then
+ $IANK_BASHRC_RUN ||:
+ fi
###### End sourcing of files #####
fi
#### end section that works with sl() function to return from
# cant, and then you can't yank-pop because the cursor is in the wrong spot.
#
#
+
+# make ctrl-backspace work, see
+# https://unix.stackexchange.com/questions/264791/ctrl-backspace-and-ctrl-delete-in-bash
+"\C-h": unix-word-rubout
# avoid annoying "New screen..." prompt
# https://serverfault.com/questions/377479/can-i-disable-the-message-line-when-launching-screen-rr
msgwait 0
+
+# starting under systemd for profanity sets term to just screen and then we get no colors
+term screen.xterm-256color
fi
/usr/bin/nagstamon &
}
+
+# profanity screen
+profsrc() {
+ screen -RD -S profanity
+}
+
+# i dont want to wait for konsole to exit...
prof() {
- if ! pgrep -f /usr/bin/dunst >/dev/null; then
- /usr/bin/dunst &
- fi
- profanity "$@"
+ command prof &>/dev/null &
}
local f
for f in $(i s | awk '$1 == "modified:" {print $2}'); do
if [[ $(head -n1 "$f") == '#!/bin/bash'* ]]; then
- sk $f
+ sk $f ||:
fi
done
}
dsign iankelling.org expertpathologyreview.com zroe.org amnimal.ninja
lipush
for h in li bk; do
- m sl $h <<'EOF'
+ m sl $h.b8.nz <<'EOF'
source ~/.bashrc
m dnsup
EOF
wlog() {
local day i days_back
days_back=${1:-16}
- for (( i=0; i<days_back; i++ )); do
+ for (( i=days_back; i>=0; i-- )); do
day=$( date +%F -d @$((EPOCHSECONDS - 86400*i )) )
date "+%a %b %d" -d @$((EPOCHSECONDS - 86400*i )) | tr '\n' ' '
/a/opt/timetrap/bin/t d -ftotal -s $day -e $day all -m '^w|lunch$'
}
+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
+}
+
# The way pidgin logs with xmpp (maybe related to running cheogram too)
# is that there are sometimes duplicates, and sometimes the a log file
# is for a specific day yet logs messages for subsequent days, and the
c /p/c/.purple/logs/jabber/iank@fsf.org/office@conference.fsf.org.chat
for x in *.html; do html2text -o ${x%.html}.txt $x; done;
# shellcheck disable=SC2016 # false positive on ${
- grep -A1 ') iank:' *.txt \
+ grep -A1 ') iank:' ./*.txt \
| sed -r 's/^(.{10})[^ ]*\.txt:\(?([^ ]*)[[:space:]](..). iank:/\1_\2_\3/
s/^[^ ]*\.txt-//
/^--$/d
s/^[^ ]*\.txt:\((.{2}).(.{2}).(.{4}) (.{8}) (.{2})\)?/\3-\1-\2_\4_\5/' \
| sed -n 'x;1d;0~2{G;s/\n/ /;p};${x;p}'
}
-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
+ min_date=$(date -d 'monday 2 weeks ago' +%s)
+ 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.
+profrecent() {
+ local d dates date files f
+ # consider making the day count passed by parameter. note: this works: $(date -d '2 day ago' +%Y_%m_%d)
+ dates=("$(date -d +%Y_%m_%d)" "$(date -d '1 day ago' +%Y_%m_%d)" )
+ for d in /d/p/profanity/chatlogs/iank_at_fsf.org/!(rooms); do
+ files=()
+ for date in ${dates[@]}; do
+ f=$d/$date.log
+ if [[ -e $f ]]; then
+ files+=($f)
+ fi
+ done
+ if (( ${#files[@]} >= 1 )); then
+ cat ${files[@]} | tail
+ hr
+ fi
+ done
+}
+
+
# usage: debvm DEBIAN_VERSION RAM_MB
debvm() {
local ver ram fname src
if [[ $h == kd && $HOSTNAME == x3 && $HOSTNAME == "$MAIL_HOST" ]]; then
m ssh root@$tg 'btrbk-spread-wrap &>/dev/null </dev/null &'
fi
- rsync -a -f"- */" -f"+ *" /var/log/btrbk/ root@$tg:/var/log/btrbk/$tg
+ rsync --mkpath -a -f"- */" -f"+ *" /var/log/btrbk/ root@$tg:/var/log/btrbk/$tg
ssh root@$tg /usr/local/bin/mail-backup-clean
done
if [[ $source ]]; then
- rsync -a -f"- */" -f"+ *" $source:/var/log/btrbk/ /var/log/btrbk/$source
+ rsync --mkpath -a -f"- */" -f"+ *" $source:/var/log/btrbk/ /var/log/btrbk/$source
fi
fi
####### begin misc packages ###########
+case $HOSTNAME in
+ kd)
+ ln -sfT /d/p/profanity ~/.local/share/profanity
+ ln -sfT /d/p/profanity-config ~/.config/profanity
+ source /a/bin/bash_unpublished/source-state
+ if [[ $HOSTNAME == "$HOST2" ]]; then
+ systemctl --now enable profanity
+ fi
+ ;;
+ *)
+
+ ln -sfT /p/profanity ~/.local/share/profanity
+ ln -sfT /p/profanity-config ~/.config/profanity
+ ;;
+esac
+
# template
case $codename in
flidas)
14 * * * * root /a/bin/ds/bk-backup |& log-once -24 bk-backup
0 7 * * * iank failmail myupgrade-iank
20 7 * * * root myupgrade |& log-once -1 myupgrade
+20 5 * * * root prof-backup |& log-once -1 prof-backup
19 * * * * root check-crypttab
4 20 * * 5 iank /usr/local/bin/check-lets-encrypt-ssl-settings
--- /dev/null
+[Unit]
+Description=profanity
+After=network-online.target
+
+[Service]
+# bash is required to get colors working
+ExecStart=/usr/bin/screen -S profanity -Dm /bin/bash -c profanity
+User=iank
+Group=iank
+
+[Install]
+WantedBy=multi-user.target
# }
exec copyq
+exec dunst
exec /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
# for my / office hp printers
hplip
html-xml-utils
+ html2text
hunspell
i3lock
i3status
if [[ $1 ]]; then
new_host=$1
if [[ $new_host == localhost ]]; then
- mailhost_p=1
new_host=$HOSTNAME
- else
- mailhost_p=0
fi
-
- # https://www.robustperception.io/how-to-have-labels-for-machine-roles
- dir=/var/lib/prometheus/node-exporter
- if [[ -e $dir ]]; then
- cat > $dir/mailhost.prom <<EOF
-host_role{role="mailhost"} $mailhost_p
-EOF
- fi
-
m sed -ri "s/MAIL_HOST=.*/MAIL_HOST=$new_host/" /a/bin/bash_unpublished/source-state
fi
source /a/bin/bash_unpublished/source-state
fi
+if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
+ mailhost_p=1
+else
+ mailhost_p=0
+fi
+# https://www.robustperception.io/how-to-have-labels-for-machine-roles
+dir=/var/lib/prometheus/node-exporter
+if [[ -e $dir ]]; then
+ cat > $dir/mailhost.prom <<EOF
+host_role{role="mailhost"} $mailhost_p
+EOF
+fi
+
+
+
if [[ $HOSTNAME == "$MAIL_HOST" || $HOSTNAME == kd ]]; then
m systemctl --now enable btrbk.timer
else
--- /dev/null
+#!/bin/bash
+
+
+set -e; . /usr/local/lib/err; set +e
+
+dossh=true
+if (( $# >= 1 )); then
+ remote=$1
+else
+ remote=b8.nz
+ if systemctl --quiet is-active profanity || [[ $HOSTNAME == kd ]]; then
+ dossh=false
+ fi
+fi
+
+if $dossh; then
+ # IANK_BASHRC_RUN because if prof-remote dies for some reason, we
+ # I dont want konsole to disappear.
+ export IANK_BASHRC_RUN="prof-remote $remote"
+ konsole --profile profanity
+else
+ konsole --profile profanity -e screen -RD -S profanity
+fi
--- /dev/null
+#!/bin/bash
+
+# We setup kd as a server which runs profanity, because profanity
+# contains important state which it does not save to disk: the most
+# recent read message in each chat room and for private messages.
+# To do this, uses data directories in /d/p.
+
+# However, if we need to take kd down for maintenance, we can run
+# profanity on HOST2 with data directory in /p. To do this, stop
+# profanity, run prof-backup, and then systemctl start profanity from
+# HOST2, and then run prof. To connect from other machines, run prof
+# HOST2_SSH_NAME. To have the profanity service stopped and started with
+# switch-mail-host, do touch /p/profanity-here. To do the reverse,
+#
+# systemctl stop profanity
+# rsync /p/profanity{,-config} kdwg.b8.nz:/d/p
+# ssh root@kdwg.b8.nz systemctl --now enable profanity
+
+if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi
+source /a/bin/errhandle/err
+
+source /a/bin/bash_unpublished/source-state
+if [[ $HOSTNAME != "$HOST2" ]]; then
+ exit 0
+fi
+
+case $HOSTNAME in
+ kd)
+ if systemctl --quiet is-active profanity; then
+ rsync /d/p/profanity{,-config} /p
+ fi
+ ;;
+ *)
+ if ssh b8.nz systemctl --quiet is-active profanity; then
+ rsync -a b8.nz:/d/p/profanity{,-config} /p
+ fi
+ ;;
+esac
--- /dev/null
+#!/bin/bash
+
+
+set -e; . /usr/local/lib/err; set +e
+
+remote=$1
+fastcon=0
+while true; do
+ start=$EPOCHSECONDS
+ ssh -t $remote screen -Dr -S profanity
+ if (( EPOCHSECONDS > start + 600 )); then
+ fastcon=0
+ fi
+ # we try to reconnect quickly for a while (just once as I write this),
+ # then try to reconnect slowly.
+ if (( fastcon < 1 )); then
+ echo "waiting 10. any key to cancel"
+ read -rsN1 -t 10 ||:
+ fastcon=$((fastcon+1))
+ else
+ echo "waiting 120. any key to cancel"
+ # like sleep but stop on any input
+ read -rsN1 -t 120 ||:
+ fi
+done
check-crypttab
/a/bin/cedit/cedit
btrbk-spread-wrap
+ prof
+ prof-remote
+ prof-backup
)
for f in /b/log-quiet/*; do
-I added several things, do a diff with default.orig.
-I saved that in case konsole updates the defaults.
-key Backspace+Ctrl : "\x17"
-it makes ctrl-backspace delete the prev word by making it input C-w.
-Note: keybindings name is specified in profile file, filename.keytab, and at the top of that file.
+Note: non-keybind konsole profile changes should be manually duplicated
+to the profanity profile, which exists to have a color scheme that is
+more compatible with profanity: it will show historical PM messages in a
+light color instead of an unreadable black.
+
+To see what changes I made in ian.keytab, do a diff with
+default.keytab.orig. (I also sorted the file). Konsole ignores files not
+named *.keytab. I changed the name of the in the default keybind profile
+file to include trisquel11-iank just to avoid any confusion.
The \E[4d etc were found without exaplanation in a random stackoverflow
comment. It seems to just be an unused and useful pattern, where d could
be any letter. I set them with +AppScreen, but they don't necessarily
need to be, its just thats the only place I use them, and maybe more
-useful to have the duplicates working outside of emacs.
+useful to have the duplicates working outside of emacs. AppScreen
+modifier means that the keybind only works within a program like emacs
+which takes over scroll back, per
+https://docs.kde.org/trunk5/en/konsole/konsole/key-bindings.html.
+
+
+Historical note about change no longer in ian.keytab:
+I saved that in case konsole updates the defaults, which
+happened. Originally saved in 2019, to fix control-backspace not working
+because it wasn't bound to anything, it just emited backspace. I fixed
+it by setting it to ^W, because bash binds ^W to unix-word-rubout. But in 2023 I ran profanity which uses
+readline, and control-backspace didn't work. Poking around, I figured
+out that konsole defaults had been updated to make control-backspace emit ^H, and sakura worked the same, detected by running
+running "stty -icanon; cat" per
+http://www.linusakesson.net/programming/tty/index.php . So, it seems better to set ^H to unix-word-rubout in .inputrc than change the key in konsole.
-keyboard "Default (XFree 4)"
-key Left-Shift+KeyPad+Ansi-AppCursorKeys : "\E[D"
-key Left-Shift+KeyPad+Ansi+AppCursorKeys : "\EOD"
-key Left+Shift+AppScreen : "\E[1;*D"
-key Left-Shift+Ansi+AnyModifier : "\E[1;*D"
-key Left-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[D"
-key Left-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOD"
-key Left-Shift-Ansi : "\ED"
-key Up+Shift-AppScreen : ScrollLineUp
-key Up-Shift+KeyPad+Ansi-AppCursorKeys : "\E[A"
-key Up-Shift+KeyPad+Ansi+AppCursorKeys : "\EOA"
-key Up+Shift+AppScreen : "\E[1;*A"
-key Up-Shift+Ansi+AnyModifier : "\E[1;*A"
-key Up-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[A"
-key Up-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOA"
-key Up-Shift-Ansi : "\EA"
-key Home+Shift-AppScreen : ScrollUpToTop
-key Home+AnyModifier : "\E[1;*H"
-key Home+AppCursorKeys-AnyModifier : "\EOH"
-key Home-AppCursorKeys-AnyModifier : "\E[H"
-key Home+KeyPad-AppCursorKeys : "\E[H"
-key Home+KeyPad+AppCursorKeys : "\EOH"
-key End+Shift-AppScreen : ScrollDownToBottom
-key End+AnyModifier : "\E[1;*F"
-key End+AppCursorKeys-AnyModifier : "\EOF"
-key End-AppCursorKeys-AnyModifier : "\E[F"
-key End+KeyPad-AppCursorKeys : "\E[F"
-key End+KeyPad+AppCursorKeys : "\EOF"
-key PgUp+Shift-AppScreen : ScrollPageUp
-key PgUp-Shift+AnyModifier : "\E[5;*~"
-key PgUp-Shift-AnyModifier : "\E[5~"
-key PgUp-Shift+KeyPad : "\E[5~"
-key PgDown+Shift-AppScreen : ScrollPageDown
-key PgDown-Shift+AnyModifier : "\E[6;*~"
-key PgDown-Shift-AnyModifier : "\E[6~"
-key PgDown-Shift+KeyPad : "\E[6~"
-key Right-Shift+KeyPad+Ansi-AppCursorKeys : "\E[C"
-key Right-Shift+KeyPad+Ansi+AppCursorKeys : "\EOC"
-key Right+Shift+AppScreen : "\E[1;*C"
-key Right-Shift+Ansi+AnyModifier : "\E[1;*C"
-key Right-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[C"
-key Right-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOC"
-key Right-Shift-Ansi : "\EC"
-key Down+Shift-AppScreen : ScrollLineDown
-key Down-Shift+KeyPad+Ansi-AppCursorKeys : "\E[B"
-key Down-Shift+KeyPad+Ansi+AppCursorKeys : "\EOB"
-key Down+Shift+AppScreen : "\E[1;*B"
-key Down-Shift+Ansi+AnyModifier : "\E[1;*B"
-key Down-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[B"
-key Down-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOB"
-key Down-Shift-Ansi : "\EB"
-key Backtab-Ansi : "\t"
+keyboard "iank-trisquel11 - Default (XFree 4)"
+key Backspace+Ctrl : "\b"
+key Backspace-Ctrl : "\x7f"
key Backtab+Ansi : "\E[Z"
-key Backspace : "\x7f"
-key Esc : "\E"
-key Tab+Shift-Ansi : "\t"
-key Tab+Shift+Ansi : "\E[Z"
-key Tab-Shift : "\t"
-key Ins+AnyModifier : "\E[2;*~"
-key Ins-AnyModifier : "\E[2~"
-key Ins+KeyPad : "\E[2~"
+key Backtab-Ansi : "\t"
+key Backtab+Ctrl+Ansi : "\E[27;6;9~"
+key Backtab+Ctrl-Ansi : "\t"
+key Clear+KeyPad : "\E[E"
key Del+AnyModifier : "\E[3;*~"
key Del-AnyModifier : "\E[3~"
key Del+KeyPad : "\E[3~"
-key Return+Shift : "\EOM"
-key Return-Shift+NewLine : "\r\n"
-key Return-Shift-NewLine : "\r"
+key Down-Shift+Ansi+AnyModifier : "\E[1;*B"
+key Down-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[B"
+key Down-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOB"
+key Down-Shift-Ansi : "\EB"
+key Down+Shift+AppScreen : "\E[1;*B"
+key Down+Shift-AppScreen : ScrollLineDown
+key Down-Shift+KeyPad+Ansi-AppCursorKeys : "\E[B"
+key Down-Shift+KeyPad+Ansi+AppCursorKeys : "\EOB"
+key End+AnyModifier : "\E[1;*F"
+key End-AppCursorKeys-AnyModifier : "\E[F"
+key End+AppCursorKeys-AnyModifier : "\EOF"
+key End+KeyPad-AppCursorKeys : "\E[F"
+key End+KeyPad+AppCursorKeys : "\EOF"
+key End+Shift-AppScreen : ScrollDownToBottom
key Enter-NewLine : "\r"
key Enter+NewLine : "\r\n"
+key Esc : "\E"
+key F10+AnyModifier : "\E[21;*~"
+key F10-AnyModifier : "\E[21~"
key F11+AnyModifier : "\E[23;*~"
key F11-AnyModifier : "\E[23~"
key F12+AnyModifier : "\E[24;*~"
key F12-AnyModifier : "\E[24~"
-key F9+AnyModifier : "\E[20;*~"
-key F9-AnyModifier : "\E[20~"
-key F10+AnyModifier : "\E[21;*~"
-key F10-AnyModifier : "\E[21~"
-key F3+AnyModifier : "\EO*R"
-key F3-AnyModifier : "\EOR"
-key F4+AnyModifier : "\EO*S"
-key F4-AnyModifier : "\EOS"
key F1+AnyModifier : "\EO*P"
key F1-AnyModifier : "\EOP"
key F2+AnyModifier : "\EO*Q"
key F2-AnyModifier : "\EOQ"
-key F7+AnyModifier : "\E[18;*~"
-key F7-AnyModifier : "\E[18~"
-key F8+AnyModifier : "\E[19;*~"
-key F8-AnyModifier : "\E[19~"
+key F3+AnyModifier : "\EO*R"
+key F3-AnyModifier : "\EOR"
+key F4+AnyModifier : "\EO*S"
+key F4-AnyModifier : "\EOS"
key F5+AnyModifier : "\E[15;*~"
key F5-AnyModifier : "\E[15~"
key F6+AnyModifier : "\E[17;*~"
key F6-AnyModifier : "\E[17~"
+key F7+AnyModifier : "\E[18;*~"
+key F7-AnyModifier : "\E[18~"
+key F8+AnyModifier : "\E[19;*~"
+key F8-AnyModifier : "\E[19~"
+key F9+AnyModifier : "\E[20;*~"
+key F9-AnyModifier : "\E[20~"
+key Home+AnyModifier : "\E[1;*H"
+key Home-AppCursorKeys-AnyModifier : "\E[H"
+key Home+AppCursorKeys-AnyModifier : "\EOH"
+key Home+KeyPad-AppCursorKeys : "\E[H"
+key Home+KeyPad+AppCursorKeys : "\EOH"
+key Home+Shift-AppScreen : ScrollUpToTop
+key Ins+AnyModifier : "\E[2;*~"
+key Ins-AnyModifier : "\E[2~"
+key Ins+KeyPad : "\E[2~"
+key Left-Shift+Ansi+AnyModifier : "\E[1;*D"
+key Left-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[D"
+key Left-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOD"
+key Left-Shift-Ansi : "\ED"
+key Left+Shift+AppScreen : "\E[1;*D"
+key Left-Shift+KeyPad+Ansi-AppCursorKeys : "\E[D"
+key Left-Shift+KeyPad+Ansi+AppCursorKeys : "\EOD"
+key PgDown-Shift+AnyModifier : "\E[6;*~"
+key PgDown-Shift-AnyModifier : "\E[6~"
+key PgDown+Shift-AppScreen : ScrollPageDown
+key PgDown-Shift+KeyPad : "\E[6~"
+key PgUp-Shift+AnyModifier : "\E[5;*~"
+key PgUp-Shift-AnyModifier : "\E[5~"
+key PgUp+Shift-AppScreen : ScrollPageUp
+key PgUp-Shift+KeyPad : "\E[5~"
+key Return+Shift : "\EOM"
+key Return-Shift-NewLine : "\r"
+key Return-Shift+NewLine : "\r\n"
+key Right-Shift+Ansi+AnyModifier : "\E[1;*C"
+key Right-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[C"
+key Right-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOC"
+key Right-Shift-Ansi : "\EC"
+key Right+Shift+AppScreen : "\E[1;*C"
+key Right-Shift+KeyPad+Ansi-AppCursorKeys : "\E[C"
+key Right-Shift+KeyPad+Ansi+AppCursorKeys : "\EOC"
key Space+Ctrl : "\x00"
+key Tab+Ctrl+Ansi : "\E[27;5;9~"
+key Tab+Ctrl-Ansi : "\t"
+key Tab+Shift+Ansi : "\E[Z"
+key Tab+Shift-Ansi : "\t"
+key Tab-Shift : "\t"
+key Up-Shift+Ansi+AnyModifier : "\E[1;*A"
+key Up-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[A"
+key Up-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOA"
+key Up-Shift-Ansi : "\EA"
+key Up+Shift+AppScreen : "\E[1;*A"
+key Up+Shift-AppScreen : ScrollLineUp
+key Up-Shift+KeyPad+Ansi-AppCursorKeys : "\E[A"
+key Up-Shift+KeyPad+Ansi+AppCursorKeys : "\EOA"
keyboard "ian"
-key F7+AnyModifier : "\E[18;*~"
-key F7-AnyModifier : "\E[18~"
-key F8+AnyModifier : "\E[19;*~"
-key F8-AnyModifier : "\E[19~"
-key F5+AnyModifier : "\E[15;*~"
-key F5-AnyModifier : "\E[15~"
-key F6+AnyModifier : "\E[17;*~"
-key F6-AnyModifier : "\E[17~"
-key F3+AnyModifier : "\EO*R"
-key F3-AnyModifier : "\EOR"
-key F4+AnyModifier : "\EO*S"
-key F4-AnyModifier : "\EOS"
-key F1+AnyModifier : "\EO*P"
-key F1-AnyModifier : "\EOP"
-key F2+AnyModifier : "\EO*Q"
-key F2-AnyModifier : "\EOQ"
+key Backspace+Ctrl : "\b"
+key Backspace-Ctrl : "\x7f"
+key Backtab+Ansi : "\E[Z"
+key Backtab-Ansi : "\t"
+key Backtab+Ctrl+Ansi : "\E[27;6;9~"
+key Backtab+Ctrl-Ansi : "\t"
+key Clear+KeyPad : "\E[E"
+key .+Ctrl+AppScreen : "\E[4c"
+key Del+AnyModifier : "\E[3;*~"
+key Del-AnyModifier : "\E[3~"
+key Del+KeyPad : "\E[3~"
+key Down-Shift+Ansi+AnyModifier : "\E[1;*B"
+key Down-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[B"
+key Down-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOB"
+key Down-Shift-Ansi : "\EB"
+key Down+Shift+AppScreen : "\E[1;*B"
+key Down+Shift-AppScreen : ScrollLineDown
+key Down-Shift+KeyPad+Ansi-AppCursorKeys : "\E[B"
+key Down-Shift+KeyPad+Ansi+AppCursorKeys : "\EOB"
+key End+AnyModifier : "\E[1;*F"
+key End-AppCursorKeys-AnyModifier : "\E[F"
+key End+AppCursorKeys-AnyModifier : "\EOF"
+key End+KeyPad-AppCursorKeys : "\E[F"
+key End+KeyPad+AppCursorKeys : "\EOF"
+key End+Shift-AppScreen : ScrollDownToBottom
+key Enter-NewLine : "\r"
+key Enter+NewLine : "\r\n"
+key Esc : "\E"
+key F10+AnyModifier : "\E[21;*~"
+key F10-AnyModifier : "\E[21~"
key F11+AnyModifier : "\E[23;*~"
key F11-AnyModifier : "\E[23~"
key F12+AnyModifier : "\E[24;*~"
key F12-AnyModifier : "\E[24~"
+key F1+AnyModifier : "\EO*P"
+key F1-AnyModifier : "\EOP"
+key F2+AnyModifier : "\EO*Q"
+key F2-AnyModifier : "\EOQ"
+key F3+AnyModifier : "\EO*R"
+key F3-AnyModifier : "\EOR"
+key F4+AnyModifier : "\EO*S"
+key F4-AnyModifier : "\EOS"
+key F5+AnyModifier : "\E[15;*~"
+key F5-AnyModifier : "\E[15~"
+key F6+AnyModifier : "\E[17;*~"
+key F6-AnyModifier : "\E[17~"
+key F7+AnyModifier : "\E[18;*~"
+key F7-AnyModifier : "\E[18~"
+key F8+AnyModifier : "\E[19;*~"
+key F8-AnyModifier : "\E[19~"
key F9+AnyModifier : "\E[20;*~"
key F9-AnyModifier : "\E[20~"
-key F10+AnyModifier : "\E[21;*~"
-key F10-AnyModifier : "\E[21~"
+key Home+AnyModifier : "\E[1;*H"
+key Home-AppCursorKeys-AnyModifier : "\E[H"
+key Home+AppCursorKeys-AnyModifier : "\EOH"
+key Home+KeyPad-AppCursorKeys : "\E[H"
+key Home+KeyPad+AppCursorKeys : "\EOH"
+key Home+Shift-AppScreen : ScrollUpToTop
+key I+Ctrl+AppScreen : "\E[4d"
key Ins+AnyModifier : "\E[2;*~"
key Ins-AnyModifier : "\E[2~"
key Ins+KeyPad : "\E[2~"
-key Del+AnyModifier : "\E[3;*~"
-key Del-AnyModifier : "\E[3~"
-key Del+KeyPad : "\E[3~"
-key Return+Shift : "\EOM"
-key Return-Shift+NewLine : "\r\n"
-key Return-Shift-NewLine : "\r"
-key Enter-NewLine : "\r"
-key Enter+NewLine : "\r\n"
-key Backtab-Ansi : "\t"
-key Backtab+Ansi : "\E[Z"
-key Backspace+Ctrl+AppScreen : "\E[4b"
-key Backspace-AnyModifier : "\x7f"
-key Backspace+Ctrl-AppScreen : "\x17"
-key Esc : "\E"
-key Tab+Shift-Ansi : "\t"
-key Tab+Shift+Ansi : "\E[Z"
-key Tab-Shift : "\t"
-key PgUp+Shift-AppScreen : ScrollPageUp
-key PgUp-Shift+AnyModifier : "\E[5;*~"
-key PgUp-Shift-AnyModifier : "\E[5~"
-key PgUp-Shift+KeyPad : "\E[5~"
-key PgDown+Shift-AppScreen : ScrollPageDown
+key Left-Shift+Ansi+AnyModifier : "\E[1;*D"
+key Left-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[D"
+key Left-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOD"
+key Left-Shift-Ansi : "\ED"
+key Left+Shift+AppScreen : "\E[1;*D"
+key Left-Shift+KeyPad+Ansi-AppCursorKeys : "\E[D"
+key Left-Shift+KeyPad+Ansi+AppCursorKeys : "\EOD"
+key M+Ctrl+AppScreen : "\E[4e"
key PgDown-Shift+AnyModifier : "\E[6;*~"
key PgDown-Shift-AnyModifier : "\E[6~"
+key PgDown+Shift-AppScreen : ScrollPageDown
key PgDown-Shift+KeyPad : "\E[6~"
-key Right-Shift+KeyPad+Ansi-AppCursorKeys : "\E[C"
-key Right-Shift+KeyPad+Ansi+AppCursorKeys : "\EOC"
-key Right+Shift+AppScreen : "\E[1;*C"
+key PgUp-Shift+AnyModifier : "\E[5;*~"
+key PgUp-Shift-AnyModifier : "\E[5~"
+key PgUp+Shift-AppScreen : ScrollPageUp
+key PgUp-Shift+KeyPad : "\E[5~"
+key Return+Shift : "\EOM"
+key Return-Shift-NewLine : "\r"
+key Return-Shift+NewLine : "\r\n"
key Right-Shift+Ansi+AnyModifier : "\E[1;*C"
key Right-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[C"
key Right-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOC"
key Right-Shift-Ansi : "\EC"
-key Down+Shift-AppScreen : ScrollLineDown
-key Down-Shift+KeyPad+Ansi-AppCursorKeys : "\E[B"
-key Down-Shift+KeyPad+Ansi+AppCursorKeys : "\EOB"
-key Down+Shift+AppScreen : "\E[1;*B"
-key Down-Shift+Ansi+AnyModifier : "\E[1;*B"
-key Down-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[B"
-key Down-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOB"
-key Down-Shift-Ansi : "\EB"
-key Left-Shift+KeyPad+Ansi-AppCursorKeys : "\E[D"
-key Left-Shift+KeyPad+Ansi+AppCursorKeys : "\EOD"
-key Left+Shift+AppScreen : "\E[1;*D"
-key Left-Shift+Ansi+AnyModifier : "\E[1;*D"
-key Left-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[D"
-key Left-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOD"
-key Left-Shift-Ansi : "\ED"
+key Right+Shift+AppScreen : "\E[1;*C"
+key Right-Shift+KeyPad+Ansi-AppCursorKeys : "\E[C"
+key Right-Shift+KeyPad+Ansi+AppCursorKeys : "\EOC"
key Space+Ctrl : "\x00"
-key Up+Shift-AppScreen : ScrollLineUp
-key Up-Shift+KeyPad+Ansi-AppCursorKeys : "\E[A"
-key Up-Shift+KeyPad+Ansi+AppCursorKeys : "\EOA"
-key Up+Shift+AppScreen : "\E[1;*A"
+key Tab+Ctrl+Ansi : "\E[27;5;9~"
+key Tab+Ctrl-Ansi : "\t"
+key Tab+Shift+Ansi : "\E[Z"
+key Tab+Shift-Ansi : "\t"
+key Tab-Shift : "\t"
key Up-Shift+Ansi+AnyModifier : "\E[1;*A"
key Up-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[A"
key Up-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOA"
key Up-Shift-Ansi : "\EA"
-key Home+Shift-AppScreen : ScrollUpToTop
-key Home+AnyModifier : "\E[1;*H"
-key Home+AppCursorKeys-AnyModifier : "\EOH"
-key Home-AppCursorKeys-AnyModifier : "\E[H"
-key Home+KeyPad-AppCursorKeys : "\E[H"
-key Home+KeyPad+AppCursorKeys : "\EOH"
-key .+Ctrl+AppScreen : "\E[4c"
-key I+Ctrl+AppScreen : "\E[4d"
-key M+Ctrl+AppScreen : "\E[4e"
-key End+Shift-AppScreen : ScrollDownToBottom
-key End+AnyModifier : "\E[1;*F"
-key End+AppCursorKeys-AnyModifier : "\EOF"
-key End-AppCursorKeys-AnyModifier : "\E[F"
-key End+KeyPad-AppCursorKeys : "\E[F"
-key End+KeyPad+AppCursorKeys : "\EOF"
+key Up+Shift+AppScreen : "\E[1;*A"
+key Up+Shift-AppScreen : ScrollLineUp
+key Up-Shift+KeyPad+Ansi-AppCursorKeys : "\E[A"
+key Up-Shift+KeyPad+Ansi+AppCursorKeys : "\EOA"
--- /dev/null
+[Appearance]
+ColorScheme=Linux
+Font=DejaVu Sans Mono,12,-1,5,50,0,0,0,0,0
+
+[General]
+LocalTabTitleFormat=%w
+Name=profanity
+Parent=FALLBACK/
+RemoteTabTitleFormat=%w
+
+[Keyboard]
+KeyBindings=ian
+
+[Scrolling]
+HistorySize=100000
[Appearance]
-ColorScheme=BlackOnRandomLight
+ColorScheme=BlackOnLightYellow
Font=DejaVu Sans Mono,12,-1,5,50,0,0,0,0,0
[General]
fi
} | $new_shell bash -s
-$old_shell bash -s <<'EOF'
+if ! $mail_only; then
+ $old_shell bash -s <<'EOF'
+set -e
if pgrep -G iank -u iank -f 'emacs --daemon' &>/dev/null; then
bufs="$(sudo -u iank env XDG_RUNTIME_DIR=/run/user/1000 emacsclient --eval "$(cat /a/bin/ds/unsaved-buffers.el)"| sed '/^"nil"$/d;s/^"(/E: /;s/)"$//')"
if [[ $bufs ]]; then
exit 1
fi
fi
+
+# Try to prevent emacs from saving stale data it has in memory to disk. eg: files, recentf list, etc.
+# But if emacs ignores the signal, let it live.
+killall -q emacs ||:
+
+if [[ -e /p/profanity-here ]]; then
+ systemctl disable --now profanity
+fi
EOF
+fi
# previously, I was checking to see if the new mail host
# is on my home network, then changing my home dns
m $old_shell systemctl --now disable btrbk.timer
fi
m $new_shell systemctl --now enable btrbk.timer
+ if [[ -e /p/profanity-here ]]; then
+ m $new_shell systemctl --now enable profanity
+ fi
exit 0
fi
exit $ret
fi
-# Try to prevent emacs from saving stale data it has in memory to disk. eg: files, recentf list, etc.
-# But if emacs ignores the signal, let it live.
-m $new_shell killall -q emacs ||:
e Running main btrbk
m btrbk-run -v --fast $bbk_args $force_arg $incremental_arg -m /o || ret=$?
exit $ret
fi
+if ! $mail_only && [[ -e /p/profanity-here ]]; then
+ m $new_shell systemctl --now enable profanity || ret=$?
+ if (( ret )); then
+ err "failed final systemctl --now enable profanity, just fix and rerun"
+ exit $ret
+ fi
+fi
+
m exit 0
# set -x
# PS4='+ $(date "+%2N") '
# allow failure in case there are no snapshots yet.
- # shellcheck disable=SC2012
shopt -s nullglob
files=($btrbk_root/$vol.20*)
shopt -u nullglob
- if (( ! ${#files[@]} )); then
- continue
- fi
- snaps=($(ls -1avdr "${files[@]}" 2>/dev/null |head -n1 || : ))
- now=$EPOCHSECONDS
- maxtime=0
- for s in ${snaps[@]}; do
- file=${s##*/}
- t=$(date -d $(sed -r 's/(.{4})(..)(.{5})(..)(.*)/\1-\2-\3:\4:\5/' <<<${file#$vol.}) +%s)
- if (( t > maxtime )); then
- maxtime=$t
- fi
- done
- snapshotmsg=
- last_snap_age=$(( now - maxtime ))
- last_snap_hours=$(( last_snap_age / 60 / 60 ))
- if (( last_snap_age > old_snap_limit )); then
- chars+=(OLD-SNAP-${last_snap_hours}h)
- snapshotmsg="/$vol snapshot older than 4 hours"
- if [[ $MAIL_HOST == "$HOSTNAME" ]]; then
- p "$snapshotmsg" | lo -1 old-snapshot
+ if (( ${#files[@]} )); then
+ # shellcheck disable=SC2012 # using ls version sort. not sure this is needed.
+ snaps=("$(ls -1avdr "${files[@]}" 2>/dev/null |head -n1 || : )")
+ now=$EPOCHSECONDS
+ maxtime=0
+ for s in ${snaps[@]}; do
+ file=${s##*/}
+ t=$(date -d "$(sed -r 's/(.{4})(..)(.{5})(..)(.*)/\1-\2-\3:\4:\5/' <<<${file#"$vol."})" +%s)
+ if (( t > maxtime )); then
+ maxtime=$t
+ fi
+ done
+ snapshotmsg=
+ last_snap_age=$(( now - maxtime ))
+ last_snap_hours=$(( last_snap_age / 60 / 60 ))
+ if (( last_snap_age > old_snap_limit )); then
+ chars+=(OLD-SNAP-${last_snap_hours}h)
+ snapshotmsg="/$vol snapshot older than 4 hours"
+ if [[ $MAIL_HOST == "$HOSTNAME" ]]; then
+ p "$snapshotmsg" | lo -1 old-snapshot
+ fi
+ # not bothering to get info on all volumes if we find an old one.
fi
- # not bothering to get info on all volumes if we find an old one.
fi
for mid in $(exiqgrep -o 2400 -zi); do
if exim -Mvh $mid | awk 'tolower($2) == "fdate:"' | grep -q .; then
qlen=$(( qlen - 1 ))
+ # shellcheck disable=SC2016 # exim var, not a bash bar
if (( $(date -d "$(exim -Mset $mid -be <<<'$h_date:' | sed -n 's/^> *//;/./p')" +%s) < EPOCHSECONDS )); then
if ip a show veth0-mail &>/dev/null; then
pid=$(pgrep -f "/usr/sbin/exim4 -bd -q30m -C /etc/exim4/my.conf"|head -n1);