From ba26d323744b727fbbf9e031012a40c35cc8ad2b Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sat, 28 Feb 2026 09:51:20 -0500 Subject: [PATCH] annoying fixes --- brc | 6 +- brc2 | 19 +++- conflink | 2 + distro-end | 19 +--- filesystem/etc/cron.d/ian | 2 +- filesystem/usr/local/bin/btrbk-run | 17 ++-- filesystem/usr/local/bin/mount-latest-subvol | 95 +------------------ filesystem/usr/local/bin/prof-notify | 2 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- .../frodo/filesystem/etc/btrbk/r5.conf | 4 +- .../etc/systemd/system/btrbkr5.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- .../systemd/system/wg-quick-tr-pre@.service | 4 +- subdir_files/.config/konsolerc | 43 +++++++++ 21 files changed, 109 insertions(+), 144 deletions(-) create mode 100644 subdir_files/.config/konsolerc diff --git a/brc b/brc index 05a44b5..2f88b8a 100644 --- a/brc +++ b/brc @@ -3995,6 +3995,7 @@ if [[ $- == *i* ]]; then # so I've thrown a bunch of things at the wall to speed it up. prompt-command() { local return=$? # this MUST COME FIRST + local h local jobs_char PS1='\w' @@ -4029,7 +4030,10 @@ if [[ $- == *i* ]]; then # save history. if our filesystem went read-only or something, continue on if history -a; then if [[ $SSH_CLIENT && $NOT_MAIL_HOST_P == t ]]; then - history 1 | sed -r 's/^([^ ]+ +){4}//' | nc -N localhost 36660 ||: + h="$(history 1)" + if [[ $h ]]; then + sed -r 's/^([^ ]+ +){4}//' <<<"$h" | nc -w 1 -N localhost 36660 ||: + fi fi fi diff --git a/brc2 b/brc2 index 0268d26..2812415 100644 --- a/brc2 +++ b/brc2 @@ -2282,8 +2282,8 @@ Description=Initial setup of netns for wg-quick-tr %I [Service] Type=oneshot -ExecStart=/usr/bin/flock -w 20 /tmp/newns.flock /usr/local/bin/newns/newns -n 10.174.$ipsuf start %i -ExecStop=/usr/bin/flock -w 20 /tmp/newns.flock /usr/local/bin/newns/newns stop %i +ExecStart=/usr/bin/flock -w 20 /tmp/newns.flock /usr/local/bin/newns -n 10.174.$ipsuf start %i +ExecStop=/usr/bin/flock -w 20 /tmp/newns.flock /usr/local/bin/newns stop %i RemainAfterExit=yes [Install] @@ -3973,8 +3973,9 @@ um() { m pactl set-sink-mute @DEFAULT_SINK@ false rm -f /tmp/ianknap } +unmute() { um "$@"; } -nap() { +mute() { local sink card sink=$(pactl get-default-sink) card="${sink%.*}" @@ -4344,6 +4345,18 @@ fi # noticably slows bash startup. +### persistent pyenv setup. started 2026-02-28 +# git clone https://github.com/pyenv/pyenv.git /a/opt/pyenv +# mypyenvinit +# pyenv install 3.13 +# pyenv global 3.13 +# # from pipx install instructions +# python3 -m pip install --user pipx +# python3 -m pipx ensurepath +# # from beets install instructions. +# # in brackets are nondefault plugins +# pipx install 'beets[lyrics,discogs,mbsync]' + mypyenvinit () { if [[ $EUID == 0 || ! -e ~/.pyenv/bin ]]; then diff --git a/conflink b/conflink index 1a302b3..ca1deae 100755 --- a/conflink +++ b/conflink @@ -359,6 +359,8 @@ case $user in fi done + ln -sf /a/opt/pyenv ~/.pyenv + # disabled # if [[ -d /var/lib/bitcoind && -d /p/c/user-specific/bitcoin ]]; then # s rsync -clpgoDiSAX --chown=bitcoin:bitcoin /p/c/user-specific/bitcoin/settings.json /var/lib/bitcoind diff --git a/distro-end b/distro-end index 9d06ff0..ee294aa 100755 --- a/distro-end +++ b/distro-end @@ -1772,20 +1772,6 @@ esac -if [[ ! -d ~/.pyenv/.git ]]; then - git clone https://github.com/pyenv/pyenv.git ~/.pyenv - . /b/ds/brc2 - mypyenvinit - pyenv install 3.13 - pyenv global 3.13 - # from pipx install instructions - python3 -m pip install --user pipx - python3 -m pipx ensurepath - # from beets install instructions. - # in brackets are nondefault plugins - pipx install 'beets[lyrics,discogs,mbsync]' -fi - ##### end beets ##### @@ -2098,6 +2084,11 @@ if [[ ! -e /etc/apt/sources.list.d/pgdg.sources ]]; then # when we run it, do: #sudo -u postgres createuser -d iank sudo usermod -a -G postgres iank + if ! out=$(psql -XAtq -Pfieldsep=' ' -vON_ERROR_STOP=on postgres <<<"select 1 from pg_user where usename = 'iank';" 2>/dev/null) || [[ $out != 1 ]]; then + sudo -u postgres createuser -d iank + fi + # initial db creation with: + # createdb -O iank db_name fi ##### diff --git a/filesystem/etc/cron.d/ian b/filesystem/etc/cron.d/ian index 3684db2..28470fe 100644 --- a/filesystem/etc/cron.d/ian +++ b/filesystem/etc/cron.d/ian @@ -34,7 +34,7 @@ MAILTO=root 4 20 * * 5 iank check-lets-encrypt-ssl-settings 4 21 * * 5 iank auto-commit-changes /a /p 4 23 * * 5 iank failmail eggdrop-upgrade -12 22 * * 5 iank failmail /b/bash_unpublished/cron-misc +12 22 * * * iank failmail /b/bash_unpublished/cron-misc # avoid dnssec expirations. This is a hack, what we should diff --git a/filesystem/usr/local/bin/btrbk-run b/filesystem/usr/local/bin/btrbk-run index 3f2fd62..f4088d4 100755 --- a/filesystem/usr/local/bin/btrbk-run +++ b/filesystem/usr/local/bin/btrbk-run @@ -152,7 +152,7 @@ set-location() { kd|frodo) at_home=true ;; - x2|x3|sy|so) + x2|x3|sy|so|sf) laptop=true if [[ $(timeout 1 dig +short @10.2.0.1 -x 10.2.0.2 2>&1 ||:) == kd.b8.nz. ]] \ && ip n show 10.2.0.1 | grep . &>/dev/null; then @@ -169,7 +169,7 @@ exit-if-no-default-targets() { mexit 0 fi case $HOSTNAME in - kw|kd|frodo|x2|x3|sy|so) : ;; + kw|kd|frodo|x2|x3|sy|so|sf) : ;; *) die "error: no default targets for this host, use -t" ;; @@ -610,7 +610,7 @@ if $kd_spread; then fi cmd_arg=resume preserve_arg=-p - add-wireless-target sy so + add-wireless-target sf so fi if [[ ! $cmd_arg ]]; then @@ -679,9 +679,10 @@ set-location if [[ ! -v targets && ! $source ]]; then exit-if-no-default-targets if $at_home; then - if ! $kd_spread && [[ $HOSTNAME != x3 ]]; then - add-x3-target - fi + ## x3 needs reinstall + # if ! $kd_spread && [[ $HOSTNAME != x3 ]]; then + # add-x3-target + # fi if [[ $HOSTNAME != frodo ]]; then targets+=(frodo.b8.nz) fi @@ -689,7 +690,7 @@ if [[ ! -v targets && ! $source ]]; then targets+=(kd.b8.nz) fi wireless_home_hosts=( - sy + sf so ) for h in ${wireless_home_hosts[@]}; do @@ -913,7 +914,7 @@ else sshfail=() remote_str_cmd="mkdir -p /mnt/root/btrbk /mnt/o/btrbk && \ date +%z && \ -df --output=size,pcent / | tail -n1" +df --output=size,pcent /mnt/root | tail -n1" for h in ${targets[@]}; do if $fast || $conf_only; then diff --git a/filesystem/usr/local/bin/mount-latest-subvol b/filesystem/usr/local/bin/mount-latest-subvol index aa3798b..bfa79b0 100755 --- a/filesystem/usr/local/bin/mount-latest-subvol +++ b/filesystem/usr/local/bin/mount-latest-subvol @@ -104,14 +104,13 @@ mnt() { fi done } -# write piped lines to fstab, wiping out any existing lines that have +# write piped lines to fstab, unless any existing lines have # the same first 2 fields. fstab() { local mount_source mpoint line_end l while read -r mount_source mpoint line_end; do l="$mount_source $mpoint $line_end" - # kill off any lines that duplicate the mount point. - sed --follow-symlinks -ri "\%$l%b;\%^\s*\S+\s+$mpoint\s%d" /etc/fstab + if grep -rq "^[[:space:]]*$mount_source[[:space:]]+$mpoint[[:space:]]+" /etc/fstab; then continue; fi tu /etc/fstab <<<"$l" done } @@ -296,93 +295,6 @@ setup-root2() { fi } -# Setup fstab for subvols we care about. -# Input vars: none -setup-fstab() { - local root_dev o_dev crypt_dev mopts dev f fa - root_dev=$(awk '$2 == "/mnt/root" {print $1}' /etc/mtab) - mapper-dev root_dev - o_dev=$(awk '$2 == "/mnt/o" {print $1}' /etc/mtab) - mapper-dev o_dev - - - # root2_dev=$(awk '$2 == "/mnt/root2" {print $1}' /etc/mtab) - # mapper-dev root2_dev - # # dont bother with the above for crypt2_dev - # crypt2_dev=$root2_dev - - - if cryptsetup status $root_dev &>/dev/null; then - crypt_dev=$root_dev - else # if we are in a recovery boot, find the next best crypt device - mopts=,noauto - # todo: I think I had an idea to not setup /o in this case, - # but never finished implementing it - for dev in $(dmsetup ls --target crypt | awk '{print $1}'); do - dev=/dev/mapper/$dev - if awk '{print $1}' /etc/mtab | grep -Fx $dev &>/dev/null; then - crypt_dev=$dev - break - fi - done - fi - - # dont tax the cpus of old laptops - if (( $(nproc) > 2)); then - mopts+=,compress=zstd - fi - if grep -qF ,nodiscard,flushoncommit /etc/fstab; then - mopts+=,nodiscard,flushoncommit - fi - - - fstab <