mostly new system fixes
authorIan Kelling <ian@iankelling.org>
Wed, 4 Dec 2024 04:47:45 +0000 (23:47 -0500)
committerIan Kelling <ian@iankelling.org>
Wed, 4 Dec 2024 04:47:45 +0000 (23:47 -0500)
distro-begin
distro-end
fsfsys-recent
primary-setup

index 54e2e9c9d67cc1673bc59f89e913bf7b4f7d9400..08abcd0f2f0ff1a98b1903b5dcc065ec9ff05dea 100755 (executable)
@@ -278,9 +278,6 @@ sudo /a/exe/lnf -T /a/bin /b
 sudo /a/exe/lnf -T /a/f /f
 sudo /a/exe/lnf -T /var/log/exim4 /el
 sudo /a/exe/lnf -T /a/f/ans /c
-sudo chown iank:iank /nocow/t
-sudo chmod 700 /nocow/t
-sudo /a/exe/lnf -T /nocow/t /t
 if has_p; then
   lnf -T /p/News ~/News
 fi
@@ -477,9 +474,13 @@ done
 if (( ${#dirs[@]} )); then
   # mkdir -p on a mounted directory will fail. so will chown if its an ro mount
   sudo mkdir -p "${dirs[@]}"
-  sudo chown $USER:$USER  "${dirs[@]}"
 fi
 
+sudo chown iank:iank /nocow/t
+sudo chmod 700 /nocow/t
+sudo /a/exe/lnf -T /nocow/t /t
+
+
 
 # disabled temporarily
 ###### setup /i
@@ -681,7 +682,14 @@ EOF
   sudo sed -i.orig '/key *<KPMU> *{/,/}/s/KP_Multiply/underscore/g' /usr/share/X11/xkb/symbols/keypad
 
   ##### basic graphical packages
-  pi konsole suckless-tools ssh-askpass
+  pi suckless-tools ssh-askpass
+
+  # currently, t12 lacks a konsole recommended package, but I probably
+  # don't use them anyways so no recommends.
+  #
+  # The following packages have unmet dependencies:
+  # libkf5iconthemes5 : Depends: libqt5svg5 (>= 5.15.2~) but it is not installable
+  pi --no-install-recommends konsole
 fi
 
 
index 7d16f81638d24014a865499d278a0ba4746df0d2..6b60fd4a0996a0e080f1b3bb9aa03a58001e6739 100755 (executable)
@@ -168,13 +168,20 @@ esac
 
 
 
-
-
 pi debootstrap
-######### begin universal pinned packages ######
-case $(debian-codename) in
-  etiona|flidas|nabia|aramo)
-    sudo rm -fv /etc/apt/preferences.d/etiona-buster
+# get the latest version from ubuntu. note: this could backfire if we
+# use a new version which targets a new release which our system is too
+# old for.
+if [[ ! -e /usr/share/debootstrap/scripts/noble ]]; then
+  mkct
+  wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap
+  pkg=$(grep -Eo '\bdebootstrap_[^" >]*_all.deb' debootstrap |sort -Vur | head -n1)
+  wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/$pkg
+  ex $pkg
+  sudo rsync -ra ./usr/share/debootstrap/scripts/ /usr/share/debootstrap/scripts
+fi
+
+# example prefs file for if we were going japanese.
     sd /etc/apt/preferences.d/trisquel-debian <<EOF
 Explanation: Debian* includes Debian + Debian Backports
 Package: *
@@ -186,185 +193,12 @@ Package: debian-archive-keyring
 Pin: release o=Debian*
 Pin-Priority: 1000
 EOF
-    ;;&
-
-  aramo|nabia|etiona)
-    # for ziva
-    #p install --no-install-recommends minetest/buster libleveldb1d/buster libncursesw6/buster libtinfo6/buster
-    doupdate=false
-    # shellcheck disable=SC2043 # in case we want more than 1 in the loop later.
-    for n in bookworm; do
-      f=/etc/apt/sources.list.d/$n.list
-      t=$(mktemp)
-      case $n in
-        bookworm)
-          cat >$t <<EOF
-deb http://deb.debian.org/debian bookworm main
-deb-src http://deb.debian.org/debian bookworm main
-
-deb http://deb.debian.org/debian-security/ bookworm-security main
-deb-src http://deb.debian.org/debian-security/ bookworm-security main
-
-deb http://deb.debian.org/debian bookworm-updates main
-deb-src http://deb.debian.org/debian bookworm-updates main
-
-deb http://http.debian.net/debian bookworm-backports main
-deb-src http://http.debian.net/debian bookworm-backports main
-EOF
-          ;;
-      esac
-
-      if ! diff -q $t $f; then
-        doupdate=true
-        s cp $t $f
-        s chmod 644 $f
-      fi
-    done
-    if $doupdate; then
-      tmpdir=$(mktemp -d)
-      (
-        cd $tmpdir
-        # cant apt get the keyring without doing an update, can't update
-        # without the keyring, this is a stupid chicken and egg problem
-        # that apt should have some feature to solve, but doesn't as far
-        # as I know.
-        f=debian-archive-keyring_2023.3+deb12u1_all.deb
-        wget http://ftp.debian.org/debian/pool/main/d/debian-archive-keyring/$f
-        sudo dpkg -i $f
-      )
-      p update
-      rm -rf $tmpdir
-    fi
-
-    if [[ ! -e /usr/share/debootstrap/scripts/noble ]]; then
-      # dir from within /a/opt/debootstrap_1.0.134ubuntu1_all.deb noble debootstrap as of 2024-07-05. not going to bother
-      # adding a whole repo for one package which doesn't seem to generally change within a single distro version.
-      rsync -ra /a/opt/debootstrap_1.0.134ubuntu1_all-scripts/ /usr/share/debootstrap/scripts
-    fi
-
-    ;;&
-  etiona)
-    sd /etc/apt/preferences.d/focal <<'EOF'
-Package: *
-Pin: release n=focal,o=Ubuntu
-Pin-Priority: -100
-EOF
-
-    sd /etc/apt/preferences.d/spamassassin <<'EOF'
-Package: spamassassin sa-compile spamc
-Pin: release n=focal,o=Ubuntu
-Pin-Priority: 500
-EOF
-    sd /etc/apt/preferences.d/spamassassin <<'EOF'
-Package: spamassassin sa-compile spamc
-Pin: release n=focal,o=Ubuntu
-Pin-Priority: 500
-EOF
-    sd /etc/apt/preferences.d/psd <<'EOF'
-Package: profile-sync-daemon
-Pin: release n=focal,o=Ubuntu
-Pin-Priority: 500
-EOF
-
-    f=/etc/apt/sources.list.d/focal.list
-    t=$(mktemp)
-    cat >$t <<'EOF'
-deb http://us.archive.ubuntu.com/ubuntu/ focal main universe
-deb http://us.archive.ubuntu.com/ubuntu/ focal-updates main universe
-deb http://us.archive.ubuntu.com/ubuntu/ focal-security main universe
-EOF
-    if ! diff -q $t $f; then
-      sudo dd if=$t of=$f status=none
-      p update
-    fi
-
-
-
-    sd /etc/apt/preferences.d/nabia-etiona <<'EOF'
-Package: *
-Pin: release n=nabia*,o=Trisquel
-Pin-Priority: -100
-EOF
-
-    f=/etc/apt/sources.list.d/nabia.list
-    t=$(mktemp)
-    cat >$t <<'EOF'
-deb http://mirror.fsf.org/trisquel/ nabia main
-deb-src http://mirror.fsf.org/trisquel/ nabia main
-
-deb http://mirror.fsf.org/trisquel/ nabia-updates main
-deb-src http://mirror.fsf.org/trisquel/ nabia-updates main
-
-deb http://archive.trisquel.info/trisquel/ nabia-security main
-deb-src http://archive.trisquel.info/trisquel/ nabia-security main
 
-# Uncomment this lines to enable the backports optional repository
-deb http://mirror.fsf.org/trisquel/ nabia-backports main
-deb-src http://mirror.fsf.org/trisquel/ nabia-backports main
-EOF
-    if ! diff -q $t $f; then
-      sudo dd if=$t of=$f status=none
-      p update
-    fi
-
-    # duplicated in fai. Pin for bionic + ubuntu so that ppas dont get
-    # matched.
-    sd /etc/apt/preferences.d/etiona-bionic <<'EOF'
-Package: *
-Pin: release n=bionic,o=Ubuntu
-Pin-Priority: -100
-Package: firefox
-Pin: release n=bionic,o=Ubuntu
-Pin-Priority: 500
-EOF
-
-    sd /etc/apt/preferences.d/etiona-sa <<'EOF'
-Package: *
-Pin: release n=bionic,o=Ubuntu
-Pin-Priority: -100
-EOF
-
-    ;;&
-  nabia)
-    sd /etc/apt/preferences.d/aramo-nabia <<'EOF'
-Package: *
-Pin: release n=aramo*,o=Trisquel
-Pin-Priority: -100
-EOF
-    f=/etc/apt/sources.list.d/aramo.list
-    t=$(mktemp)
-    cat >$t <<'EOF'
-deb http://mirror.fsf.org/trisquel/ aramo main
-deb-src http://mirror.fsf.org/trisquel/ aramo main
-
-deb http://mirror.fsf.org/trisquel/ aramo-updates main
-deb-src http://mirror.fsf.org/trisquel/ aramo-updates main
-
-deb http://archive.trisquel.info/trisquel/ aramo-security main
-deb-src http://archive.trisquel.info/trisquel/ aramo-security main
-
-# Uncomment this lines to enable the backports optional repository
-deb http://mirror.fsf.org/trisquel/ aramo-backports main
-deb-src http://mirror.fsf.org/trisquel/ aramo-backports main
-EOF
-    if ! diff -q $t $f; then
-      sudo dd if=$t of=$f status=none
-      p update
-    fi
-
-    ;;&
-  *)
-    if isdeb; then
-      pi debian-goodies shellcheck
-    fi
-    ;;
-esac
+if isdeb; then
+  pi debian-goodies shellcheck
+  s systemctl enable --now ssh-agent-iank
+fi
 
-case $codename_compat in
-  jammy|noble)
-    s systemctl enable --now ssh-agent-iank
-    ;;
-esac
 
 case $codename_compat in
   focal)
@@ -1309,7 +1143,8 @@ sudo update-alternatives --set pinentry /usr/bin/pinentry-gtk-2
 # sakura config is owned by ian
 m reset-sakura
 m reset-konsole
-m sudo -u user2 -i reset-konsole
+## not bothering with user2 atm.
+#m sudo -u user2 -i reset-konsole
 # user2 xscreensaver we don't want to reset
 m reset-xscreensaver
 
@@ -1925,38 +1760,6 @@ fi
 # leftover cleanup for t9
 pu resolvconf
 
-case $codename in
-  # needed for debootstrap scripts for fai since fai requires debian
-  flidas)
-    pi dnsmasq
-    pi-nostart network-manager
-    # i hate networkmanager. noo, of course disabling it doesnt work
-    # unless you add a hack. found this by doing
-    # systemd-analyze dot > x.dot
-    # less x.dot
-    # /networkman
-    soff NetworkManager
-    soff NetworkManager-wait-online.service
-    # make networkmanager use resolvconf instead of its own dnsmasq which
-    # conflicts with the normal dnsmasq package.
-    f=/etc/NetworkManager/NetworkManager.conf
-    m=$(md5sum $f)
-    sudo sed -ri '/ *\[main\]/,/^ *\[[^]]+\]/{/^\s*dns[[:space:]=]/d}' $f
-    sudo sed -ri '/ *\[main\]/a dns=default' $f
-    if [[ $m != $(md5sum $f) ]]; then
-      srestart NetworkManager
-    fi
-    # networkmanager has this nasty behavior on flidas: if the machine
-    # crashes with dnsmasq running, on subsequent boot, it adds an entry to
-    # resolvconf for 127.0.0.1 in some stupid attempt to restore
-    # nameservers.
-    # This can be manually fixed by stoping dnsmasq,
-    # then based on whats in /run/dnsmasq/, i see we can run
-    # s resolvconf -d NetworkManager
-    # oh ya, and stoping NetworkManager leaves this crap behind without cleaning it up.
-    ser disable NetworkManager
-    ;;
-esac
 
 # I have no use for avahi,
 # had to run this twice when doing manually, i dunno why
index f2b1ad49e828ba2e0a6f9ed1d328cc998151975b..9d63090130ea8ab953d93f448c44a9d99af02e5a 100755 (executable)
@@ -52,6 +52,6 @@ date0=$(date +%Y-%m-%d)
 date1=$(date +%Y-%m-%d -d yesterday)
 f0="$d/$date0.log"
 f1="$d/$date1.log"
-url=$( { sed "s/^/$date1 /" $f1; sed "s/^/$date0 /" $f0; } | /a/opt/fpaste/fpaste -x 60 |& grep -i '^http' | sed -r 's,/view/,/view/raw/,' )
+url=$( { if [[ -e $f1 ]]; then sed "s/^/$date1 /" $f1; fi; sed "s/^/$date0 /" $f0; } | /a/opt/fpaste/fpaste -x 60 |& grep -i '^http' | sed -r 's,/view/,/view/raw/,' )
 notice='This url is not public and this message does not not imply permission to share it publicly. It expires in 60 minutes. Related: the "Public logging" section at https://libera.chat/policies/.'
 printf "%s %s\n" "$url" "$notice" | tee /tmp/fsfsys-recent
index 5f415c9267db7e2fd7dbe3b7b1f596303e1e2c78..5155722a0cdf4f5177e8105d68b5304b86a212d6 100755 (executable)
@@ -55,7 +55,7 @@ source /a/bin/bash_unpublished/source-state
 
 # fixing up a bad state that servers got in.
 if [[ -e /dev/shm/iank-status ]]; then
-  chown iank.iank /dev/shm/iank-status
+  chown iank:iank /dev/shm/iank-status
 fi
 
 
@@ -73,7 +73,6 @@ EOF
 fi
 
 
-
 if [[ $HOSTNAME == "$MAIL_HOST" || $HOSTNAME == kd ]]; then
   m systemctl --now enable btrbk.timer
 else
@@ -83,8 +82,6 @@ fi
 
 if dpkg -s rss2email &>/dev/null; then
   if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
-    # arbtt disabled for now
-    #DISPLAY=:0 arbtt-capture --sample-rate=10 &
     m systemctl --now enable rss2email.timer
   else
     files=(/sysd-mail-once/btrbk*)
@@ -94,17 +91,16 @@ if dpkg -s rss2email &>/dev/null; then
 
     serm systemctl stop rss2email.service
     serm systemctl --now disable rss2email.timer
-    # arbtt disabled for now
-    # for ((i=0; i<10; i++)); do
-    #   killall arbtt-capture || break
-    #   sleep 1
-    #   if [[ $i == 9 ]]; then
-    #     exit 1
-    #   fi
-    # done
   fi
 fi
 
+if [[ $HOSTNAME == "$HOST2" ]]; then
+  /a/opt/activity-watch/aw-qt &
+else
+  pkill -f '^/a/opt/activity-watch/aw-qt$'
+fi
+
+
 # todo: whats going on here? figure out if this should be removed.
 
 # if dpkg -s radicale &>/dev/null; then
@@ -125,18 +121,6 @@ fi
 # fi
 
 
-# todo: this needs to be disabled earlier than primary-setup in switch-mail-host
-
-# if dpkg -s profile-sync-daemon &>/dev/null; then
-#   if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
-#     m systemctl --user start psd
-#     m systemctl --user enable psd
-#   else
-#     m systemctl --user stop psd
-#     m systemctl --user disable psd
-#   fi
-# fi
-
 
 m /a/exe/mail-setup
 exit 0