From: Ian Kelling Date: Fri, 16 May 2025 16:15:29 +0000 (-0400) Subject: mostly fixes, btrbk changes due to data growth X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=3bf42b2dad1e8d4e9cccd5daf46058c42e17653e;p=distro-setup mostly fixes, btrbk changes due to data growth --- diff --git a/beetag b/beetag index efc3c5f..1a7006f 100755 --- 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 47c2431..5d7ec44 100644 --- 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 7865d23..16d951e 100644 --- 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 "$@"; } diff --git a/distro-end b/distro-end index 83380ba..67629bf 100755 --- a/distro-end +++ b/distro-end @@ -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 diff --git a/filesystem/etc/needrestart/conf.d/iank.conf b/filesystem/etc/needrestart/conf.d/iank.conf index b1025fa..8477546 100644 --- a/filesystem/etc/needrestart/conf.d/iank.conf +++ b/filesystem/etc/needrestart/conf.d/iank.conf @@ -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 index 0000000..57d24ab --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/btrbk/r2.conf @@ -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 diff --git a/machine_specific/frodo/filesystem/etc/btrbk/rust.conf b/machine_specific/frodo/filesystem/etc/btrbk/r3.conf similarity index 72% rename from machine_specific/frodo/filesystem/etc/btrbk/rust.conf rename to machine_specific/frodo/filesystem/etc/btrbk/r3.conf index 7199baf..4b293e7 100644 --- a/machine_specific/frodo/filesystem/etc/btrbk/rust.conf +++ b/machine_specific/frodo/filesystem/etc/btrbk/r3.conf @@ -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 index 0000000..18712fc --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/btrbk/rbackup.conf @@ -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 index 0000000..2b51b53 --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr2.service @@ -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 diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.timer b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr2.timer 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 66af876..77bb04a 100644 --- a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.timer +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr2.timer @@ -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 index 0000000..54890b4 --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr3.service @@ -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 index 0000000..8db2086 --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkr3.timer @@ -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 index 0000000..122291f --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrbackup.service @@ -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 index 0000000..d110eee --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrbackup.timer @@ -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 index 053bed5..0000000 --- a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkrust.service +++ /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 diff --git a/mail-setup b/mail-setup index 2d62531..af8bc7e 100755 --- a/mail-setup +++ b/mail-setup @@ -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 e56d2be..c6ec1c8 100644 --- 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 diff --git a/subdir_files/.config/mpv/mpv.conf b/subdir_files/.config/mpv/mpv.conf index b4487c2..fdb32f3 100644 --- a/subdir_files/.config/mpv/mpv.conf +++ b/subdir_files/.config/mpv/mpv.conf @@ -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