mostly fixes, btrbk changes due to data growth
authorIan Kelling <ian@iankelling.org>
Fri, 16 May 2025 16:15:29 +0000 (12:15 -0400)
committerIan Kelling <ian@iankelling.org>
Fri, 16 May 2025 16:15:33 +0000 (12:15 -0400)
18 files changed:
beetag
brc
brc2
distro-end
filesystem/etc/needrestart/conf.d/iank.conf
machine_specific/frodo/filesystem/etc/btrbk/r2.conf [new file with mode: 0644]
machine_specific/frodo/filesystem/etc/btrbk/r3.conf [moved from machine_specific/frodo/filesystem/etc/btrbk/rust.conf with 72% similarity]
machine_specific/frodo/filesystem/etc/btrbk/rbackup.conf [new file with mode: 0644]
machine_specific/frodo/filesystem/etc/systemd/system/btrbkr2.service [new file with mode: 0644]
machine_specific/frodo/filesystem/etc/systemd/system/btrbkr2.timer [moved from machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.timer with 76% similarity]
machine_specific/frodo/filesystem/etc/systemd/system/btrbkr3.service [new file with mode: 0644]
machine_specific/frodo/filesystem/etc/systemd/system/btrbkr3.timer [new file with mode: 0644]
machine_specific/frodo/filesystem/etc/systemd/system/btrbkrbackup.service [new file with mode: 0644]
machine_specific/frodo/filesystem/etc/systemd/system/btrbkrbackup.timer [new file with mode: 0644]
machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.service [deleted file]
mail-setup
pkgs
subdir_files/.config/mpv/mpv.conf

diff --git a/beetag b/beetag
index efc3c5f634fcb1332e4370b8d390af4ccd601bd7..1a7006fe920bac39a4ff6f83a19ab6fd62eec358 100755 (executable)
--- a/beetag
+++ b/beetag
@@ -346,26 +346,42 @@ beetag-track-select() {
   j=$new_j
 }
 
-# tag with beets.
-# usage: beetag [-r] [-s] QUERY
-# it lists the query, reads an input char for tagging one by one.
-#
-# note, you may want to change the play command for doing rapid taging
-# by immediately jumping forward into the song. this is set in the beets
-# config yaml.
-#
-# (available buttons: ` ) ] [ and non-printing chars, see
-# https://stackoverflow.com/questions/10679188/casing-arrow-keys-in-bash
-#
-#
-# note: after foregrounding the player, must quit it to get back. can't ctrl-c.
-#
-# keys I dont need help to remember:
-# 1-5 rate
-# q quit
-# ret next
-#
-# todo: enter should also unpause
+
+beetag-usage() {
+  cat <<'EOF'
+tag with beets.
+usage: beetag [OPTIONS] QUERY
+
+-r   Randomize.
+-s   Do not randomize.
+-x   Randomize & do not reuse previous seed.
+-h|--help             Print help and exit.
+
+It lists/plays the query, reads an input char for tagging one by one.
+
+note, you may want to change the play command for doing rapid taging
+by immediately jumping forward into the song. this is set in the beets
+config yaml.
+
+(available buttons: ` ) ] [ and non-printing chars, see
+https://stackoverflow.com/questions/10679188/casing-arrow-keys-in-bash
+
+
+note: after foregrounding the player, must quit it to get back. can't ctrl-c.
+
+keys I dont need help to remember:
+1-5 rate
+q quit
+ret next
+
+todo: enter should also unpause
+
+
+Note: Uses GNU getopt options parsing style
+EOF
+  return 0
+}
+
 beetag()  {
   source /a/bin/ds/beet-data
 
@@ -402,29 +418,47 @@ beetag()  {
   local -i scrolled=999 # more than any $LINES
   local -i i ret line_int skip_start skip_lookback overflow_lines overflow
 
-  ### begin arg processing ###
+
+  ##### begin command line parsing ########
+
   random=false
   new_random=false
-  case $1 in
-    -r)
-      random=true
-      shift
-      ;;
-    -s)
-      random=false
-      shift
-      ;;
-    -x)
-      new_random=true
-      shift
-      ;;
-  esac
+  if ! temp=$(getopt -l help hrsx "$@"); then
+    e "BAD OPTION! expected is: getopt -l help hrsx"
+    return 1
+  fi
+  eval set -- "$temp"
+  while true; do
+    case $1 in
+      -r)
+        random=true
+        ;;
+      -s)
+        random=false
+        ;;
+      -x)
+        random=true
+        new_random=true
+        ;;
+      -h|--help) beetag-usage; return 0 ;;
+      --) shift; break ;;
+      *) echo "$0: Internal error! unexpected args: $*" ; return 1 ;;
+    esac
+    shift
+  done
+  arg1="$1"
+  arg2="$2"
+  if (( $# != 2 )); then
+    echo "$0: error: expected 2 options, got $#." >&2
+    exit 1
+  fi
+
   if (( ! $# )); then
     echo beetag: error expected a query arg >&2
     return 1
   fi
   beet_query=("$@")
-  ### end arg processing ###
+  ##### end command line parsing ########
 
   escape_char=$(printf "\u1b")
   readonly escape_char
diff --git a/brc b/brc
index 47c24310cacf39b939120ae89f7150757f09fadd..5d7ec44de1ea15fccdd9622ebb68712f6fc60799 100644 (file)
--- a/brc
+++ b/brc
@@ -3677,10 +3677,14 @@ vim() {
 
 # ls count. usage: pass a directory, get the number of files.
 # https://unix.stackexchange.com/questions/90106/whats-the-most-resource-efficient-way-to-count-how-many-files-are-in-a-director
-lsc() {
+lswc() {
   # shellcheck disable=SC2790 disable=SC2012 # intentional
   ls -Uq "$@"|wc -l
 }
+# count files recursively
+fndwc() {
+  find "$@" -type f -printf a | wc -c
+}
 
 # run then notify. close notification after the next prompt.
 rn() {
diff --git a/brc2 b/brc2
index 7865d23ab1392017fe1a29483784893d9f16523e..16d951e8a13b57337f419e5a71664a261d8d0c02 100644 (file)
--- a/brc2
+++ b/brc2
@@ -616,7 +616,7 @@ bpl() {
     return 1
   fi
   # all but last arg as options
-  eval beetag -r "${*:1:$# - 1}" "${bpla[$playlist]}"
+  e eval beetag -r "${*:1:$# - 1}" "${bpla[$playlist]}"
 }
 complete -W "${!bpla[*]}" bpl
 
@@ -2838,6 +2838,9 @@ mpvd() {
 mpva() {
   mpv --profile=a "$@";
 }
+mpvk() {
+  mpv --profile=k "$@";
+}
 mpvl() {
   mpv --profile=l "$@";
 }
index 83380ba0ae5b3012e723e5db5a527a6c2c38aaab..67629bf5505ea4c7926deb6743494a2fb261ac32 100755 (executable)
@@ -1183,15 +1183,6 @@ case $HOSTNAME in
     ;;
 esac
 
-case $HOSTNAME in
-  $d_host)
-    sgo btrbkrust.timer
-    ;;
-  *)
-    soff btrbkrust.timer
-    s rm -f /etc/systemd/system/btrbkrust*
-    ;;
-esac
 
 
 # template
@@ -1710,12 +1701,12 @@ DEVICESCAN -a -o on -S on -n standby,q $sched \
 # if the value is too aggressive, could cause problems.
 case $codename_compat in
   noble)
-    usermod -aG pipewire iank
+    sudo usermod -aG pipewire iank
     ;;
 esac
 
 # x200 on t12, this unit fails on boot. no idea why, but it seems harmless
-systemctl mask wacom-inputattach@ttyS4.service
+sudo systemctl mask wacom-inputattach@ttyS4.service
 
 
 # see current with:
@@ -2278,10 +2269,14 @@ case $codename_compat in
     ;;
 esac
 
+
 case $HOSTNAME in
-  frodo)
-    systemctl enable btrbkrust.timer
-    systemctl enable btrbkr.timer
+  $d_host)
+    sgo btrbkr{backup,2,3}.timer
+    ;;
+  *)
+    soff btrbkr{backup,2,3}.timer
+    s rm -f /etc/systemd/system/btrbkr*
     ;;
 esac
 
index b1025fad98027d2a55948935584b650eb2fc72fc..8477546ff4019691bd906536740520adb7925595 100644 (file)
@@ -11,5 +11,7 @@ $nrconf{ucodehints} = 0;
 # note, we can verify this works as expected by adding
 # print join(", ", @{$nrconf{blacklist}}), "\n";
 # and running it with perl. @{} dereferences the array reference.
-push(@{$nrconf{blacklist}}, qr(^/usr/local/bin/emacs$));
+#
+# Emacs is a symlink to a file like emacs-31.0.50.
+push(@{$nrconf{blacklist}}, qr(^/usr/local/bin/emacs[0-9.-]*$));
 push(@{$nrconf{blacklist}}, qr(^/usr/local/bin/emacsclient$));
diff --git a/machine_specific/frodo/filesystem/etc/btrbk/r2.conf b/machine_specific/frodo/filesystem/etc/btrbk/r2.conf
new file mode 100644 (file)
index 0000000..57d24ab
--- /dev/null
@@ -0,0 +1,22 @@
+transaction_syslog local7
+
+lockfile                   /var/lock/btrbk-r2.lock
+
+timestamp_format long-iso
+
+snapshot_create onchange
+
+snapshot_preserve 18h 14d 8w 12m
+snapshot_preserve_min 2d
+snapshot_dir btrbk
+
+target_preserve 18h 14d 8w 12m
+target_preserve_min 2d
+
+rate_limit no
+volume /mnt/r2
+subvolume p
+subvolume fsf-mailrec
+# moved
+#subvolume ar
+#subvolume roverflow
similarity index 72%
rename from machine_specific/frodo/filesystem/etc/btrbk/rust.conf
rename to machine_specific/frodo/filesystem/etc/btrbk/r3.conf
index 7199bafe2a7da0cd826f6fb9b414ff22bd08b679..4b293e73066bd49531c7e283a0bb20484c439595 100644 (file)
@@ -1,6 +1,6 @@
 transaction_syslog local7
 
-lockfile                   /var/lock/btrbk-rust.lock
+lockfile                   /var/lock/btrbk-r3.lock
 
 timestamp_format long-iso
 
@@ -14,7 +14,8 @@ target_preserve 18h 14d 8w 12m
 target_preserve_min 2d
 
 rate_limit no
-volume /mnt/rbackup
+volume /mnt/r3
+subvolume d-r3
+subvolume siterip
 subvolume ar
-subvolume d
 subvolume roverflow
diff --git a/machine_specific/frodo/filesystem/etc/btrbk/rbackup.conf b/machine_specific/frodo/filesystem/etc/btrbk/rbackup.conf
new file mode 100644 (file)
index 0000000..18712fc
--- /dev/null
@@ -0,0 +1,21 @@
+transaction_syslog local7
+
+lockfile                   /var/lock/btrbk-rbackup.lock
+
+timestamp_format long-iso
+
+snapshot_create onchange
+
+snapshot_preserve 18h 14d 8w 12m
+snapshot_preserve_min 2d
+snapshot_dir btrbk
+
+target_preserve 18h 14d 8w 12m
+target_preserve_min 2d
+
+rate_limit no
+volume /mnt/rbackup
+subvolume d
+# moved
+#subvolume ar
+#subvolume roverflow
diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr2.service b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr2.service
new file mode 100644 (file)
index 0000000..2b51b53
--- /dev/null
@@ -0,0 +1,7 @@
+[Unit]
+Description=Btrbk to r2
+After=multi-user.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/sysd-mail-once btrbkr2 btrbk -c /etc/btrbk/r2.conf run
similarity index 76%
rename from machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.timer
rename to machine_specific/frodo/filesystem/etc/systemd/system/btrbkr2.timer
index 66af87694de54e88024053ea9e3265c3ece7e36d..77bb04a03db664bfb62fbed6a73540ecf96e6f42 100644 (file)
@@ -1,5 +1,5 @@
 [Unit]
-Description=Btrbk rust timer
+Description=Btrbk r2 timer
 
 [Timer]
 OnCalendar=*-*-* 07:00:00 America/New_York
diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr3.service b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr3.service
new file mode 100644 (file)
index 0000000..54890b4
--- /dev/null
@@ -0,0 +1,7 @@
+[Unit]
+Description=Btrbk to r3
+After=multi-user.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/sysd-mail-once btrbkr3 btrbk -c /etc/btrbk/r3.conf run
diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr3.timer b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr3.timer
new file mode 100644 (file)
index 0000000..8db2086
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Btrbk r3 timer
+
+[Timer]
+OnCalendar=*-*-* 07:00:00 America/New_York
+
+[Install]
+WantedBy=timers.target
diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrbackup.service b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrbackup.service
new file mode 100644 (file)
index 0000000..122291f
--- /dev/null
@@ -0,0 +1,7 @@
+[Unit]
+Description=Btrbk to rbackup
+After=multi-user.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/sysd-mail-once btrbkrbackup btrbk -c /etc/btrbk/rbackup.conf run
diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrbackup.timer b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrbackup.timer
new file mode 100644 (file)
index 0000000..d110eee
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Btrbk rbackup timer
+
+[Timer]
+OnCalendar=*-*-* 07:00:00 America/New_York
+
+[Install]
+WantedBy=timers.target
diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.service b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.service
deleted file mode 100644 (file)
index 053bed5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-[Unit]
-Description=Btrbk to rust
-After=multi-user.target
-
-[Service]
-Type=oneshot
-ExecStart=/usr/local/bin/sysd-mail-once btrbkrust btrbk -c /etc/btrbk/rust.conf run
index 2d62531f8a24a2dd404243fc52094bff75187c66..af8bc7ea06859aab8f6747ad809dbcc85003e75b 100755 (executable)
@@ -411,9 +411,11 @@ sre() {
   done
 }
 sgo() {
-  local service=$1
-  systemctl restart $service
-  systemctl enable $service
+  local service
+  for service; do
+    systemctl restart $service
+    systemctl enable $service
+  done
 }
 mailhost() {
   [[ $HOSTNAME == "$MAIL_HOST" ]]
@@ -1035,6 +1037,7 @@ BindsTo=mailnn.service
 StartLimitIntervalSec=0
 
 [Service]
+ExecStartPre=/usr/local/bin/joins-namespace-of-check mailnn
 PrivateNetwork=true
 # note the nsswitch bind is actually not needed for bk, but
 # its the same file so it does no harm.
diff --git a/pkgs b/pkgs
index e56d2bee3be677e67705098d172fd9da87c417cd..c6ec1c868061987e16c16e86fcd9eb5b87944bdd 100644 (file)
--- a/pkgs
+++ b/pkgs
@@ -125,7 +125,8 @@ p3=(
   debconf-doc
   devscripts
   dillo
-  digikam
+  # using self-compiled version
+  #digikam
   # used by digikam for icons
   breeze-icon-theme
   dirmngr
index b4487c2d36949e22e3d751e59387eb207a6467df..fdb32f33f6caf08ab9f720a62132cc0886c06a33 100644 (file)
@@ -14,6 +14,13 @@ replaygain=track
 # the /etc one.
 hwdec=vdpau
 
+# like [l] but shuffled
+[k]
+loop-file=inf
+save-position-on-quit
+resume-playback
+shuffle
+
 # loop. saves playlist position. good for looking at gifs
 [l]
 loop-file=inf
@@ -22,10 +29,6 @@ resume-playback
 #no-resume-playback
 #no-save-position-on-quit
 
-[m]
-loop-file=inf
-save-position-on-quit
-shuffle
 
 
 # use --profile d