mostly nabia fixes
authorIan Kelling <ian@iankelling.org>
Fri, 19 Feb 2021 10:15:56 +0000 (05:15 -0500)
committerIan Kelling <ian@iankelling.org>
Fri, 19 Feb 2021 10:15:56 +0000 (05:15 -0500)
15 files changed:
bk-backup
brc
btrbk-run
check-subvol-stale
distro-begin
distro-end
filesystem/etc/cron.d/ian
filesystem/usr/local/bin/abrowser [new file with mode: 0755]
filesystem/usr/local/bin/firefox [new symlink]
i3-sway/common.conf
mount-latest-subvol
pkgs
subdir_files/.config/i3/config
subdir_files/.config/sway/config
subdir_files/.local/share/kxmlgui5/konsole/sessionui.rc

index 67759fa9d3ed6d2ff2444a7343a53e0996239fcf..4050b5bb11e3b1faef5e50beca04948090633cb0 100755 (executable)
--- a/bk-backup
+++ b/bk-backup
@@ -5,7 +5,7 @@ shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4
 set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?. PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
 
-# need root for rsync pull of file ownership/perms
+# need root for rsync  pull of file ownership/perms
 [[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
 
 host=bk.b8.nz
@@ -39,13 +39,13 @@ if [[ $HOSTNAME == $MAIL_HOST ]]; then
     ncbase=${ncdir##*/}
     mkdir -p /p/bkbackup/$ncbase
     ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on
-    rsync -rai --delete root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$?
+    rsync -ra --exclude=testignore --delete root@$host:$ncdir/{config,data,themes} /p/bkbackup/$ncbase || ret=$?
     ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --off
     if (( $ret )); then
        echo "$0: error: failed rsync $ncdir"
        ret=1
     fi
   done
-  rsync -rai --delete root@$host:/m /p/bkbackup
+  rsync -ra --delete root@$host:/m /p/bkbackup
 fi
 exit $ret
diff --git a/brc b/brc
index 92bb54302e9743ab08255e5ce8cdd92b0e4d7e00..685d6f2c61fd7d60da047ffa5be43b82d6e6efcb 100644 (file)
--- a/brc
+++ b/brc
@@ -1138,7 +1138,7 @@ rsu() { # [OPTS] HOST PATH
   # rync here uses checksum instead of time so we dont mess with
   # unison relying on time as much. g is for group, same reason
   # to keep up with unison.
-  sudo rsync -rlpchviog --relative "${opts[@]}" "$path" "root@$host:/";
+  m s rsync -rlpchviog --relative "${opts[@]}" "$path" "root@$host:/";
 }
 ccomp rsync rsd rsa rst rsu
 
index 2b21e82608fee2cdcfe9fb2795ee1cd36e81490f..d6de66ae882b1d27987e708f190ad4a6815ceac4 100644 (file)
--- a/btrbk-run
+++ b/btrbk-run
@@ -426,15 +426,15 @@ EOF
   fi
 done
 
-if $amy; then
-  # to manually backup amy,
-  # bbk -e -s amy -m root_ubuntubionic
-  cat >>/etc/btrbk.conf <<'EOF'
-volume ssh://amy/mnt/root
-subvolume root_ubuntubionic
-target send-receive /mnt/root/btrbk
-EOF
-fi
+if $amy; then
+  # to manually backup amy,
+  # bbk -e -s amy -m root_ubuntubionic
+  cat >>/etc/btrbk.conf <<'EOF'
+volume ssh://amy/mnt/root
+subvolume root_ubuntubionic
+target send-receive /mnt/root/btrbk
+EOF
+fi
 
 # todo: umount first to ensure we don't have any errors
 # todo: do some kill fuser stuff to make umount more reliable
index 84530269901dbcf2dc2216cb3bf6d3b27502623e..7758df7c2fc2eae2697b89eda1e7fa1241e62188 100644 (file)
@@ -85,6 +85,9 @@ for d; do
 
   d dev=$dev
   subvol_dir=$(sed -rn "s,^\s*[^#]\S*\s+$d\s.*\bsubvol=([a-zA-A/]+).*,\1,p" /etc/fstab /etc/mtab|head -n1)
+  if [[ ! $subvol_dir ]]; then
+    continue
+  fi
   d subvol_dir=$subvol_dir
   # note, we need $dev because $d might not be mounted, and we do this loop
   # because the device in fstab for the rootfs can be different.
index 144d8a5e67067982701547664e7d3c4645eb7ab0..30ecb9b915a678a2cb0d31ae510173e83d68a479 100755 (executable)
@@ -345,6 +345,16 @@ if bitfolk; then
   sudo sed -ri "/^127\./n;/[[:space:]]$HOSTNAME\$/d" /etc/hosts
 fi
 
+# firefox exists but is 2 versions outdated
+if isdeb && [[ $(debian-codename) == nabia ]]; then
+  sudo dd of=/etc/apt/preferences.d/nabia-focal-missing <<'EOF'
+Explanation: libkf5* are for konsole libilmbase* are needed for emacs
+Package: libkf5solid5 libkf5solid5-data libilmbase-dev libilmbase24 ansible unrar-free genisoimage pidgin pidgin-* libpurple0 linux-doc p7zip genisoimage mumble hplip cups-filters libcupsfilters1 libfontembed1 cups-filters-core-drivers tor lightdm mate-desktop-environment mate-desktop-environment-* mate-menus mate-panel mate-panel-* mate-session-manager libmate-* libgoa-* ubuntu-mate-default-settings mate-control-center mate-control-center-common gir1.2-matemenu-* lightdm-gtk-greeter liblightdm-gobject-* firefox
+Pin: release n=focal,o=Ubuntu
+Pin-Priority: 500
+EOF
+fi
+
 
 #### setup firefox backport
 ## ian: disabled. backports are not being published atm due to rust packaging issue
index 9d207e3f32f3a59423a06ffeb1c9942c462a04a5..3c3733051d90dc74bafc344ec0cee5e0ae35955f 100755 (executable)
@@ -326,6 +326,37 @@ Pin-Priority: 1005
 EOF
 
 
+    ;;&
+  nabia|etiona)
+    # for ziva
+    #p install --no-install-recommends minetest/buster libleveldb1d/buster libncursesw6/buster libtinfo6/buster
+    f=/etc/apt/sources.list.d/buster.list
+    t=$(mktemp)
+    cat >$t <<EOF
+deb http://http.us.debian.org/debian buster main
+deb-src http://http.us.debian.org/debian buster main
+
+deb http://security.debian.org/ buster/updates main
+deb-src http://security.debian.org/ buster/updates main
+
+deb http://http.us.debian.org/debian buster-updates main
+deb-src http://http.us.debian.org/debian buster-updates main
+EOF
+    if ! diff -q $t $f; then
+      curl -s https://ftp-master.debian.org/keys/archive-key-10-security.asc | sudo apt-key add -
+      curl -s https://ftp-master.debian.org/keys/archive-key-10.asc | sudo apt-key add -
+      s cp $t $f
+      s chmod 644 $f
+      p update
+    fi
+    if [[ ! -e /usr/share/debootstrap/scripts/buster ]]; then
+      t=$(mktemp -d)
+      cd $t
+      m aptitude download debootstrap/buster
+      m ex ./*
+      sudo cp ./usr/share/debootstrap/scripts/* /usr/share/debootstrap/scripts
+    fi
+
     ;;&
   etiona)
     sd /etc/apt/preferences.d/focal <<'EOF'
@@ -391,35 +422,6 @@ EOF
       p update
     fi
 
-    # for ziva
-    #p install --no-install-recommends minetest/buster libleveldb1d/buster libncursesw6/buster libtinfo6/buster
-    f=/etc/apt/sources.list.d/buster.list
-    t=$(mktemp)
-    cat >$t <<EOF
-deb http://http.us.debian.org/debian buster main
-deb-src http://http.us.debian.org/debian buster main
-
-deb http://security.debian.org/ buster/updates main
-deb-src http://security.debian.org/ buster/updates main
-
-deb http://http.us.debian.org/debian buster-updates main
-deb-src http://http.us.debian.org/debian buster-updates main
-EOF
-    if ! diff -q $t $f; then
-      curl -s https://ftp-master.debian.org/keys/archive-key-10-security.asc | sudo apt-key add -
-      curl -s https://ftp-master.debian.org/keys/archive-key-10.asc | sudo apt-key add -
-      s cp $t $f
-      s chmod 644 $f
-      p update
-    fi
-    if [[ ! -e /usr/share/debootstrap/scripts/buster ]]; then
-      t=$(mktemp -d)
-      cd $t
-      m aptitude download debootstrap/buster
-      m ex ./*
-      sudo cp ./usr/share/debootstrap/scripts/* /usr/share/debootstrap/scripts
-    fi
-
     # duplicated in fai. Pin for bionic + ubuntu so that ppas dont get
     # matched.
     sd /etc/apt/preferences.d/etiona-bionic <<'EOF'
@@ -721,7 +723,7 @@ case $codename_compat in
     pi lightdm-gtk-greeter
     # ok, this is really weird
     # normally this file has
-    cat >/etc/X11/Xsession.d/99x11-common_start <<'EOF'
+    sd /etc/X11/Xsession.d/99x11-common_start <<'EOF'
 # this is very odd.
 # this file normally just has: exec $STARTUP
 # but then ~/.xsession-errors
@@ -1306,7 +1308,7 @@ EOF
 
 
 case $HOSTNAME in
-  kd|rp)
+  kd)
     sgo transmission-daemon-nn
     ;;
 esac
index 3e18e3356e04ef0c0ad8f2b93d4622b59f269687..7df6705008e9c50244ced96d8c31700b4db4dfd1 100644 (file)
@@ -1,5 +1,6 @@
 SHELL=/bin/bash
 PATH=/usr/bin:/bin:/usr/local/bin:/a/exe
+MAILTO=root
 */10 * * * *   iank rootsshsync |& log-once -15 rootsshsync
 # this goes into bash prompt, does in cron for more efficient shell
 * * * * *   iank system-status |& log-once system-status
diff --git a/filesystem/usr/local/bin/abrowser b/filesystem/usr/local/bin/abrowser
new file mode 100755 (executable)
index 0000000..520380a
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# https://stackoverflow.com/a/2108540
+tmp=:$PATH:
+del=/usr/local/bin
+tmp=${tmp//:$del:/:}
+tmp=${tmp%:}
+tmp=${tmp#:}
+PATH=$tmp
+
+rm -f {/p/c/firefox-main-profile,/p/c/firefox-main-profile,/p/c/firefox-vpn2-profile,/mnt/z/firefox-vpn-profile}/compatibility.ini
+
+if type -P abrowser &>/dev/null; then
+  abrowser "$@"
+else
+  firefox "$@"
+fi
diff --git a/filesystem/usr/local/bin/firefox b/filesystem/usr/local/bin/firefox
new file mode 120000 (symlink)
index 0000000..3a5d9d4
--- /dev/null
@@ -0,0 +1 @@
+abrowser
\ No newline at end of file
index f263a3bd9c228132e2290a43e541dfa8aea89222..48346c7783e3bf7b2b9100fcd775769d6e62efca 100644 (file)
@@ -7,8 +7,8 @@
 set $mod Mod4
 
 bindsym $mod+2 exec "pavucontrol"
-bindsym $mod+3 exec "x-www-browser"
-bindsym $mod+4 exec "x-www-browser -no-remote -P firefox-main-profile"
+bindsym $mod+3 exec "abrowser"
+bindsym $mod+4 exec "abrowser -no-remote -P firefox-main-profile"
 bindsym $mod+5 exec "/usr/local/bin/start-tor-browser"
 bindsym $mod+6 exec "/a/bin/redshift.sh"
 # bindsym $mod+equal exec "t s w; t in"
index 64e22f19c5bb1c1915c77fa948f7fd1cd2049ceb..7764b75ff3f788112d53469222b791f99ea694d4 100644 (file)
@@ -321,12 +321,17 @@ for vol in q a o i; do
                     grep -vxF "Found a valid Btrfs stream header, version 1" | \
                     grep -cv "^[^;]*;snapshot: ") ||:
           if [[ $lines == 0 ]]; then
-            # the snapshot diff is broken, it deleted a snapshot that was different.
-            # I need some examples to test on.
-            # also, why are we ignoring the error code in the snapshot diff,
-            # seems like we shouldnt do that
+            # rotate in case we find a bug, weve got 2 old ones
+            tmpleaf=($vol.tmpleaf2.*)
+            if (( ${#tmpleaf[@]} )); then
+              x btrfs sub del ${tmpleaf[@]}
+            fi
+            tmpleaf=($vol.tmpleaf1.*)
+            if (( ${#tmpleaf[@]} )); then
+              x mv ${tmpleaf[0]} $vol.tmpleaf2.${tmpleaf[0]#$vol.tmpleaf1.}
+            fi
             echo suspected identical: $bsub $leaf
-            #x btrfs sub del $leaf
+            x mv $leaf $vol.tmpleaf1.${leaf#$vol.leaf.}
           fi
         fi
       fi
@@ -342,7 +347,7 @@ for vol in q a o i; do
     # the order gets screwed up or something.
     for leaf in ${leaf_vols[@]}; do
       leaf_time=$(date -d ${leaf#$vol.leaf.} +%s)
-      if (( leaf_limit_time > leaf_time || ( leaf_new_limit_time > leaf_time && count > 100 ) )); then
+      if (( leaf_limit_time > leaf_time || ( leaf_new_limit_time > leaf_time && count > 15 ) )); then
         x btrfs sub del $leaf
       fi
       count=$((count-1))
diff --git a/pkgs b/pkgs
index 094d7b219b11fa092627107027a74da6754ff10e..e059147302becf3bd30240601fa3c49631b958b5 100644 (file)
--- a/pkgs
+++ b/pkgs
@@ -46,6 +46,8 @@ p2=(
 # gnat-5 doesnt exist in nabia, might not even be needed for coreboot anymore so removed it
 # python3-dnspython is needed by some ansible module
 
+# python3-autopep8 is nice, etiona only has python2 version, not bothering
+# to setup a conditional or pin to nabia.
 
 
 p3=(
@@ -172,7 +174,6 @@ p3=(
   pixz
   pry
   pv
-  python3-autopep8
   python3-doc
   qemu-user-static
   qrencode
index 9948f389fa4cd7b892e2586fac1083a73c68feb4..5b1faa5dc02531587db20fe367b657280d5d1f9a 100644 (file)
@@ -7,8 +7,8 @@
 set $mod Mod4
 
 bindsym $mod+2 exec "pavucontrol"
-bindsym $mod+3 exec "x-www-browser"
-bindsym $mod+4 exec "x-www-browser -no-remote -P firefox-main-profile"
+bindsym $mod+3 exec "abrowser"
+bindsym $mod+4 exec "abrowser -no-remote -P firefox-main-profile"
 bindsym $mod+5 exec "/usr/local/bin/start-tor-browser"
 bindsym $mod+6 exec "/a/bin/redshift.sh"
 # bindsym $mod+equal exec "t s w; t in"
index bb9712ef384cdcbf00ae5ae7506021c1335a4ce2..4e3014eedbe38a48dfeaa1fce89b12cb3081848d 100644 (file)
@@ -7,8 +7,8 @@
 set $mod Mod4
 
 bindsym $mod+2 exec "pavucontrol"
-bindsym $mod+3 exec "x-www-browser"
-bindsym $mod+4 exec "x-www-browser -no-remote -P firefox-main-profile"
+bindsym $mod+3 exec "abrowser"
+bindsym $mod+4 exec "abrowser -no-remote -P firefox-main-profile"
 bindsym $mod+5 exec "/usr/local/bin/start-tor-browser"
 bindsym $mod+6 exec "/a/bin/redshift.sh"
 # bindsym $mod+equal exec "t s w; t in"
index 1a8d337b4ba34ab178cf8abe97dba1acd02b503a..1d1449adc52d8c5c45f36c825d75a4fbd1594add 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartgui version="24" name="session">
+<kpartgui version="27" name="session">
  <MenuBar>
   <Menu name="file">
    <Action group="session-operations" name="file_save_as"/>
    <Action group="session-view-operations" name="monitor-silence"/>
    <Action group="session-view-operations" name="monitor-activity"/>
    <Separator group="session-view-operations"/>
+   <Action group="session-view-operations" name="view-readonly"/>
+   <Separator group="session-view-operations"/>
    <Action group="session-view-operations" name="enlarge-font"/>
+   <Action group="session-view-operations" name="reset-font-size"/>
    <Action group="session-view-operations" name="shrink-font"/>
    <Action group="session-view-operations" name="set-encoding"/>
    <Separator group="session-view-operations"/>
   <Action name="clear-history"/>
   <Action name="adjust-history"/>
   <Separator/>
+  <Action name="view-readonly"/>
   <Action name="switch-profile"/>
   <Action name="edit-current-profile"/>
-  <Separator/>
-  <Action name="close-session"/>
  </Menu>
- <ActionProperties scheme="Default">
-  <Action shortcut="Ctrl+@" name="open-browser"/>
+ <ActionProperties>
   <Action shortcut="Ctrl+Shift+R" name="edit_find_next"/>
   <Action shortcut="Ctrl+Shift+E" name="edit_find_prev"/>
   <Action shortcut="Ctrl++; " name="enlarge-font"/>
+  <Action shortcut="Ctrl+@" name="open-browser"/>
   <Action shortcut="" name="rename-session"/>
   <Action shortcut="" name="zmodem-upload"/>
  </ActionProperties>