bunch of new stuff, a few fixes
[distro-setup] / distro-end
index 593e91e598b89b510802fcb9f67a5fd3c43bfa67..f2eef439a8dc74c97e3e3f99aaa4be6754e98f7a 100755 (executable)
@@ -569,15 +569,27 @@ esac
 ##### begin automatic upgrades (after checkrestart has been installed) ####
 # if apt-config-auto-update is installed,
 # it also has similar config, in a file 10something,
-# but i think his overrides it since its higher number.
+# but i think this overrides it since its higher number.
 # This file was part of the automatic-updates package,
-# and it has a configu option to not get new package lists,
+# and it has a config option to not get new package lists,
 # which seems pretty stupid to me, you cant actually upgrade
 # anything if you dont have the new package list.
 sd /etc/apt/apt.conf.d/20auto-upgrades <<'EOF'
+# note: man apt.conf says
+# /usr/share/doc/apt/examples/configure-index.gz is a configuration file showing
+# example values for all possible options.
+# but that is a incorrect.
+# Periodic and other options are only documented in
+# /usr/lib/apt/apt.systemd.daily
+# That filename can be found through poking around in apt daily cronjob.
 APT::Periodic::Update-Package-Lists "1";
 APT::Periodic::Download-Upgradeable-Packages "1";
-APT::Periodic::AutocleanInterval "7";
+# 0 means disabled. I used to set this to 7, however, trisquel doesn't
+# have an archive of old package versions, so I want to
+# keep around old versions so I can easily downgrade.
+APT::Periodic::AutocleanInterval "0";
+# daily expire old files /var/cache/apt if it gets above this MB
+APT::Periodic::MaxSize "50000";
 APT::Periodic::Unattended-Upgrade "1";
 EOF
 
@@ -619,7 +631,7 @@ case $HOSTNAME in
       dnsb8
     fi
 
-    s /c/roles/prom-export/files/simple/usr/local/bin/fsf-install-node-exporter -l
+    s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter -l 127.0.0.1
 
     # ex for exporter
     web-conf -p 9101 -f 9100 - apache2 ${HOSTNAME}ex.b8.nz <<'EOF'
@@ -650,6 +662,22 @@ EOF
     ;;
   li)
 
+    p build-dep eggdrop
+    if [[ ! -L ~/eggdrop/eggdrop ]]; then
+      cd
+      git clone https://github.com/eggheads/eggdrop eggdrop-src
+      cd eggdrop-src
+      ./configure
+      make config
+      make
+      make install
+    fi
+
+    # dunno if this is really needed. it was part of the documented eggdrop systemd install script
+    sudo loginctl enable-linger
+    systemctl --user enable fsysbot
+    systemctl --user start fsysbot
+
     m /a/h/setup.sh iankelling.org
 
     # start mumble only when im going to use it, since i dont use it much
@@ -1277,6 +1305,24 @@ fi
 
 ####### begin misc packages ###########
 
+# old location, 2023.
+sudo rm -fv /etc/systemd/system/profanity.service
+case $HOSTNAME in
+  kd)
+    ln -sfT /d/p/profanity ~/.local/share/profanity
+    ln -sfT /d/p/profanity-config ~/.config/profanity
+    source /a/bin/bash_unpublished/source-state
+    if [[ $HOSTNAME == "$HOST2" || ! -e /p/profanity-here ]]; then
+      systemctl --user --now enable profanity
+    fi
+    ;;
+  *)
+
+    ln -sfT /p/profanity ~/.local/share/profanity
+    ln -sfT /p/profanity-config ~/.config/profanity
+    ;;
+esac
+
 # template
 case $codename in
   flidas)
@@ -1689,7 +1735,7 @@ sudo gpasswd -a $USER lpadmin # based on ubuntu wiki
 
 m /a/bin/buildscripts/go
 # only needed for rg. cargo takes up 11 gigs, filled up the disk on je.
-#m /a/bin/buildscripts/rust
+m /a/bin/buildscripts/rust
 m /a/bin/buildscripts/misc
 m /a/bin/buildscripts/pithosfly
 #m /a/bin/buildscripts/alacritty
@@ -1787,6 +1833,11 @@ DEVICESCAN -a -o on -S on -n standby,q $sched \
 
 ########### misc stuff
 
+
+xdg-settings set default-web-browser abrowser.desktop
+# see current with:
+# xdg-settings get default-web-browser
+
 # pressing tab after sdf here:
 # scp sdfbash: set +o noglob: command not found
 # in t11, bash 5.1.16. this fixes it.
@@ -1950,28 +2001,20 @@ sgo dynamicipupdate
 if grep -xFq $HOSTNAME /a/bin/ds/machine_specific/btrbk.hosts; then
   sgo btrbk.timer
 fi
-if [[ $HOSTNAME == kd ]]; then
-  sgo btrbk-spread.timer
-fi
 
-# note: to see when it was last run,
+# note: to see when a timer was last run,
 # ser list-timers
 
-case $HOSTNAME in
-  kd)
-    sgo btrbkrust.timer
-    ;;
-esac
 
 ### begin prometheus ###
 
-
-
 case $HOSTNAME in
   kd)
     # Font awesome is needed for the alertmanager ui.
     pi prometheus-alertmanager prometheus fonts-font-awesome
     /c/roles/prom/files/simple/usr/local/bin/fsf-install-prometheus
+    # make it available for other machines
+    rsync -a /usr/local/bin/amtool /a/opt/bin
     web-conf -p 9091 -f 9090 - apache2 i.b8.nz <<'EOF'
 <Location "/">
 AuthType Basic
@@ -2007,7 +2050,7 @@ EOF
       ser restart prometheus-alertmanager
     fi
 
-    s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter -l
+    s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter -l 127.0.0.1
 
     for ser in prometheus-node-exporter prometheus-alertmanager prometheus; do
       sysd-prom-fail-install $ser
@@ -2015,7 +2058,7 @@ EOF
 
     ;;
   *)
-    s /c/roles/prom-export/files/simple/usr/local/bin/fsf-install-node-exporter
+    s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter
     ;;
 esac
 
@@ -2178,6 +2221,10 @@ case $HOSTNAME in
     sudo usermod -a -G bitcoin iank
     # todo: make bitcoin have a stable uid/gid
     if [[ ! $(readlink -f /var/lib/bitcoind/wallets) == /q/wallets ]]; then
+      mkdir -p /var/lib/bitcoind
+      chown bitcoin:bitcoin /var/lib/bitcoind
+      # 710 comes from the upstream bitcoin unit file
+      chmod 710 /var/lib/bitcoind
       s lnf /q/wallets /var/lib/bitcoind
       sudo chown -h bitcoin:bitcoin /var/lib/bitcoind/wallets
     fi
@@ -2191,7 +2238,7 @@ esac
 case $HOSTNAME in
   kw|x3)
     sd /etc/cups/client.conf <<'EOF'
-ServerName printserver0.office.fsf.org
+ServerName printserver1.office.fsf.org
 EOF
     ;;
 esac