improvements
authorIan Kelling <ian@iankelling.org>
Sun, 1 Mar 2026 08:32:09 +0000 (03:32 -0500)
committerIan Kelling <ian@iankelling.org>
Sun, 1 Mar 2026 08:32:09 +0000 (03:32 -0500)
brc
brc2
distro-end
i3-sway/gen
machine_specific/frodo/filesystem/etc/btrbk/r5.conf
script-files
subdir_files/.config/konsolerc

diff --git a/brc b/brc
index 2f88b8a02cd72aeca17f0a9a94233319ce6cc9dc..b1b3fe32bd24016d23879abb2f97c5a84fe1dba0 100644 (file)
--- a/brc
+++ b/brc
@@ -2347,17 +2347,17 @@ k() {
   local grep_out1 grep_out2 histf1 histf2
   local -a lines1 lines2
   histf1=${HISTFILE:-~/.bash_history}
-  grep_out1=$(grep -iP --binary-files=text "$@" $histf1  | tail -n 80) || [[ $? == 1 ]]
+  grep_out1=$(grep -iP --binary-files=text "$*" $histf1  | tail -n 80) || [[ $? == 1 ]]
   if [[ $EUID == 0 ]]; then
     histf2="/home/iank/.bh"
-    grep_out2=$(grep -iP --binary-files=text "$@" $histf2  | tail -n 80) || [[ $? == 1 ]]
+    grep_out2=$(grep -iP --binary-files=text "$*" $histf2  | tail -n 80) || [[ $? == 1 ]]
   elif sudo -nv 2>/dev/null; then
     histf2="/root/.bh"
-    grep_out2=$(sudo grep -iP --binary-files=text "$@" $histf2  | tail -n 80) || [[ $? == 1 ]]
+    grep_out2=$(sudo grep -iP --binary-files=text "$*" $histf2  | tail -n 80) || [[ $? == 1 ]]
   fi
+  mapfile -t lines1 <<<"$grep_out1"
+  mapfile -t lines2 <<<"$grep_out2"
   if [[ $grep_out1 && $grep_out2 ]]; then
-    mapfile -t lines1 <<<"$grep_out1"
-    mapfile -t lines2 <<<"$grep_out2"
     # in this case, just insert a chunk of secondary results in the middle.
     if (( ${#lines1[@]} > 20 )); then
       printf "%s\n" "${lines1[@]:20}"; printf "############ ^ %s #############\n"  $histf1
@@ -3446,11 +3446,7 @@ sl() {
       # But, since we are doing all this, lets source it because we can.
       cat <(echo . $sync_dirname/.bashrc) - | command ssh "${args[@]}" "$remote" LC_USEBASHRC=t bash
     else
-      # random deletable note: This ssh corresponds to the one below
-      # with reverse tunnel below, and it would make sense to add it
-      # here too, but I'm mainly interested in collecting history from
-      # skip type hosts,so leaving it out for now.
-      mq command ssh -t "${args[@]}" "$remote" LC_USEBASHRC=t INPUTRC=$sync_dirname/.inputrc bash --rcfile $sync_dirname/.bashrc
+      mq command ssh -R localhost:36660:localhost:36661 -t "${args[@]}" "$remote" LC_USEBASHRC=t INPUTRC=$sync_dirname/.inputrc bash --rcfile $sync_dirname/.bashrc
     fi
   else
     if [[ -t 0 ]]; then
@@ -3473,8 +3469,10 @@ hist-catcher() {
   local cmd_regex='[[:alnum:]]'
 
   while true; do
-    cmd=$(nc -l 36661) ||:
-    e "cmd:'$cmd'";
+    cmd=$(nc -l 36661) || sleep 1
+    if [[ $verbose == true ]]; then
+      e "cmd:'$cmd'";
+    fi
     if [[ ! $cmd =~ $cmd_regex ]]; then
       continue
     fi
diff --git a/brc2 b/brc2
index 2812415957188d3bfeb5e4178524eccda70646d6..b862fbbebcb89442d566568536ce0efb6b2a8a63 100644 (file)
--- a/brc2
+++ b/brc2
@@ -2579,6 +2579,20 @@ sudm() {
   fi
 }
 
+_in_rootns() {
+  local tmps a b
+  tmps=$(s readlink /proc/1/ns/net /proc/$$/ns/net)
+  { read -r a; read -r b; } <<<"$tmps"
+  if [[ ! $b ]]; then
+    e "error: _in_rootns failed to get current netns"
+    return 1
+    fi
+  if [[ $a != "$b" ]]; then
+    e "error: _in_rootns: not in the root netns. return 1"
+    return 1
+  fi
+}
+
 mns-setup() {
   local ns
   ns=$1
@@ -2603,6 +2617,8 @@ mns-no-setup() {
   local ns
   ns=$1
   shift
+  _in_rootns
+
   m sudm /usr/bin/nsenter --mount=/root/mount_namespaces/$ns "$@"
 }
 
@@ -2610,13 +2626,17 @@ mns() { # mount namespace
   local ns
   ns=$1
   shift
+  _in_rootns
+
   mns-setup $ns
   m sudm /usr/bin/nsenter --mount=/root/mount_namespaces/$ns "$@"
 }
 
 
 mnsr() { # mns run (as normal user)
-  local ns pre_check tmpf user alt_user=false
+  local ns pre_check tmpf user alt_user=false tmps
+  _in_rootns
+
   user=$USER
   while [[ $1 ]]; do
     case $1 in
@@ -2657,6 +2677,7 @@ mnsr() { # mns run (as normal user)
 mnsd() { # mount namespace + systemd network namespace
   local ns unit user tmpf pre_check pid alt_user=false
   local -a final_args
+  _in_rootns
 
   ## begin command line args ##
   user=$USER
@@ -2699,6 +2720,7 @@ mnsd() { # mount namespace + systemd network namespace
 
 mnsnonetroot() {
   ns=$1
+  _in_rootns
   lomh
   if ! s ip netns list | grep -Fx nonet &>/dev/null; then
     s ip netns add nonet
@@ -2709,6 +2731,7 @@ mnsnonetroot() {
 
 mnsnonet() {
   ns=$1
+  _in_rootns
   lomh
   if ! s ip netns list | grep -Fx nonet &>/dev/null; then
     s ip netns add nonet
@@ -2721,6 +2744,7 @@ mnsnonet() {
 lom() {
   # l = the loopback device
   local l base
+  _in_rootns
   # get sudo pass cached right away
   if ! sudo -nv 2>/dev/null; then
     sudo -v
index ee294aac6ad79a12f0c67bc5ec0c3eb0c8e2b5de..ffdaf3e9964cd8313421594bb48e44e8afd4557d 100755 (executable)
@@ -2235,6 +2235,22 @@ case $HOSTNAME in
     ;;
 esac
 
+# misc
+sgo system-status
+sgo hist-catcher
+
+# console font size
+if [[ $HOSTNAME == sf ]] && ! grep -q '^FONTFACE="TER"' /etc/default/console-setup; then
+  sudo sed -i '/^FONTFACE/s/^/#/' /etc/default/console-setup # comment out the old value
+  sudo sed -i '/^FONTSIZE/s/^/#/' /etc/default/console-setup # comment out the old value
+  echo 'FONTFACE="TER"' | sudo tee -a /etc/default/console-setup # Set font to Terminus
+  echo 'FONTSIZE="16x32"' | sudo tee -a /etc/default/console-setup # Set font size
+  pi xfonts-terminus
+  update-initramfs -u
+fi
+
+sudo chown -R iank:iank /etc/i3
+
 ### Anki notes
 # Distro version is too old to be compatible with f-droid, so I installed upstream.
 # However, the way the recommend doing that is annoying to automate, so I'm leaving it
index 2a6c3a8ea7f155c4cd78fd0a813f19a42f4bd160..2ddd98dbdff61bc3de5dd57bb314584087778be3 100755 (executable)
@@ -43,7 +43,11 @@ rm -f ~/.config/i3/config
 
 f=/etc/i3/config
 if [[ -e /etc/i3 && ! -w /etc/i3 ]]; then
-  sudo chown -R iank:iank /etc/i3
+  if [[ -t 0 ]]; then
+    sudo chown -R iank:iank /etc/i3
+  else
+    echo "error: please chown -R iank:iank /etc/i3"
+  fi
 fi
 cat common.conf i3.conf "$(if [[ -s ~/i3-myx.conf ]]; then echo ~/i3-myx.conf; fi)" >$f
 
index 3689b26316d383bd9cbeb9fdb9bb288b760430d9..e3e3129a9ee7293b07f6c9bc47e52304fc622d7b 100644 (file)
@@ -17,3 +17,6 @@ rate_limit no
 volume /mnt/r5
 subvolume d
 subvolume r
+subvolume rbase
+subvolume rjson
+subvolume mhot
index b245ef28cb83d680e95f712561f73a624d7703f5..ce48c9eb289c0c5edf6c6c37278daa74b3c05ff1 100644 (file)
@@ -39,6 +39,7 @@ done
 my_service_scripts=(
   epanic-clean
   system-status
+  hist-catcher
   btrfsmaint
   mailtest-check
   dynamic-ip-update
index c123beec6aee18dde8546b94c2618a98a5f7328e..d81c9ce3e3b4151fb8e5631dcdb02daf4af36d05 100644 (file)
@@ -23,6 +23,11 @@ ShowMenuBarByDefault=false
 2 screens: Width=1916
 2 screens: XPosition=2
 2 screens: YPosition=2
+3840x2160 screen: Height=2156
+3840x2160 screen: Width=1276
+3840x2160 screen: XPosition=1282
+3840x2160 screen: YPosition=2
+DP-0=DP-0
 DP-1 eDP-1=DP-1
 DP-1-1 eDP-1=DP-1-1
 DP-1-3 eDP-1=eDP-1