From 66f005d0fd0c88a31b8c798243f090fe0090418c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 30 Dec 2024 00:06:04 +0200 Subject: Update content for html --- gemfeed/atom.xml | 1400 +++++++++++++++++++++++++++--------------------------- 1 file changed, 700 insertions(+), 700 deletions(-) (limited to 'gemfeed/atom.xml') diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 05bc3df2..ea39a1f6 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2024-12-18T23:28:38+02:00 + 2024-12-29T23:48:55+02:00 foo.zone feed To be in the .zone! @@ -243,9 +243,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
[paul@earth]~/Downloads% sudo dd \
-  if=FreeBSD-14.1-RELEASE-amd64-bootonly.iso \
-  of=/dev/sda conv=sync
+
[paul@earth]~/Downloads% sudo dd \
+  if=FreeBSD-14.1-RELEASE-amd64-bootonly.iso \
+  of=/dev/sda conv=sync
 

Next, I plugged the Beelinks (one after another) into my monitor via HDMI (the resolution of the FreeBSD text console seems strangely stretched, as I am using the LG Dual Up monitor), connected Ethernet, an external USB keyboard, and the FreeBSD USB stick, and booted the devices up. With F7, I entered the boot menu and selected the USB stick for the FreeBSD installation.
@@ -271,9 +271,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
root@f0:~ # freebsd-update fetch
-root@f0:~ # freebsd-update install
-root@f0:~ # freebsd-update reboot
+
root@f0:~ # freebsd-update fetch
+root@f0:~ # freebsd-update install
+root@f0:~ # freebsd-update reboot
 

I also added the following entries for the three FreeBSD boxes to the /etc/hosts file:
@@ -281,11 +281,11 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
root@f0:~ # cat <<END >>/etc/hosts
-192.168.1.130 f0 f0.lan f0.lan.buetow.org
-192.168.1.131 f1 f1.lan f1.lan.buetow.org
-192.168.1.132 f2 f2.lan f2.lan.buetow.org
-END
+
root@f0:~ # cat <<END >>/etc/hosts
+192.168.1.130 f0 f0.lan f0.lan.buetow.org
+192.168.1.131 f1 f1.lan f1.lan.buetow.org
+192.168.1.132 f2 f2.lan f2.lan.buetow.org
+END
 

After install


@@ -296,7 +296,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
root@f0:~ # pkg install helix doas zfs-periodic uptimed
+
root@f0:~ # pkg install helix doas zfs-periodic uptimed
 

Helix editor


@@ -313,7 +313,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
root@f0:~ # cp /usr/local/etc/doas.conf.sample /usr/local/etc/doas.conf
+
root@f0:~ # cp /usr/local/etc/doas.conf.sample /usr/local/etc/doas.conf
 

https://man.openbsd.org/doas
@@ -326,24 +326,24 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
root@f0:~ # sysrc daily_zfs_snapshot_enable=YES
-daily_zfs_snapshot_enable:  -> YES
-root@f0:~ # sysrc daily_zfs_snapshot_pools=zroot
-daily_zfs_snapshot_pools:  -> zroot
-root@f0:~ # sysrc daily_zfs_snapshot_keep=7
-daily_zfs_snapshot_keep:  -> 7
-root@f0:~ # sysrc weekly_zfs_snapshot_enable=YES
-weekly_zfs_snapshot_enable:  -> YES
-root@f0:~ # sysrc weekly_zfs_snapshot_pools=zroot
-weekly_zfs_snapshot_pools:  -> zroot
-root@f0:~ # sysrc weekly_zfs_snapshot_keep=5
-weekly_zfs_snapshot_keep:  -> 5
-root@f0:~ # sysrc monthly_zfs_snapshot_enable=YES
-monthly_zfs_snapshot_enable:  -> YES
-root@f0:~ # sysrc monthly_zfs_snapshot_pools=zroot
-monthly_zfs_snapshot_pools:  -> zroot
-root@f0:~ # sysrc monthly_zfs_snapshot_keep=6
-monthly_zfs_snapshot_keep: 2 -> 6
+
root@f0:~ # sysrc daily_zfs_snapshot_enable=YES
+daily_zfs_snapshot_enable:  -> YES
+root@f0:~ # sysrc daily_zfs_snapshot_pools=zroot
+daily_zfs_snapshot_pools:  -> zroot
+root@f0:~ # sysrc daily_zfs_snapshot_keep=7
+daily_zfs_snapshot_keep:  -> 7
+root@f0:~ # sysrc weekly_zfs_snapshot_enable=YES
+weekly_zfs_snapshot_enable:  -> YES
+root@f0:~ # sysrc weekly_zfs_snapshot_pools=zroot
+weekly_zfs_snapshot_pools:  -> zroot
+root@f0:~ # sysrc weekly_zfs_snapshot_keep=5
+weekly_zfs_snapshot_keep:  -> 5
+root@f0:~ # sysrc monthly_zfs_snapshot_enable=YES
+monthly_zfs_snapshot_enable:  -> YES
+root@f0:~ # sysrc monthly_zfs_snapshot_pools=zroot
+monthly_zfs_snapshot_pools:  -> zroot
+root@f0:~ # sysrc monthly_zfs_snapshot_keep=6
+monthly_zfs_snapshot_keep: 2 -> 6
 

https://github.com/ross/zfs-periodic
@@ -356,9 +356,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
root@f0:~ # cp /usr/local/mimecast/etc/uptimed.conf-dist \
-  /usr/local/mimecast/etc/uptimed.conf 
-root@f0:~ # hx /usr/local/mimecast/etc/uptimed.conf
+
root@f0:~ # cp /usr/local/mimecast/etc/uptimed.conf-dist \
+  /usr/local/mimecast/etc/uptimed.conf 
+root@f0:~ # hx /usr/local/mimecast/etc/uptimed.conf
 

In the Helix editor session, I changed LOG_MAXIMUM_ENTRIES to 0 to keep all uptime entries forever and not cut off at 50 (the default config). After that, I enabled and started uptimed:
@@ -367,8 +367,8 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
root@f0:~ # service uptimed enable
-root@f0:~ # service uptimed start
+
root@f0:~ # service uptimed enable
+root@f0:~ # service uptimed start
 

To check the current uptime stats, I can now run uprecords:
@@ -377,15 +377,15 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
 root@f0:~ # uprecords
-     #               Uptime | System                                     Boot up
-----------------------------+---------------------------------------------------
-->   1     0 days, 00:07:34 | FreeBSD 14.1-RELEASE      Mon Dec  2 12:21:44 2024
-----------------------------+---------------------------------------------------
-NewRec     0 days, 00:07:33 | since                     Mon Dec  2 12:21:44 2024
-    up     0 days, 00:07:34 | since                     Mon Dec  2 12:21:44 2024
-  down     0 days, 00:00:00 | since                     Mon Dec  2 12:21:44 2024
-   %up              100.000 | since                     Mon Dec  2 12:21:44 2024
+
 root@f0:~ # uprecords
+     #               Uptime | System                                     Boot up
+----------------------------+---------------------------------------------------
+->   1     0 days, 00:07:34 | FreeBSD 14.1-RELEASE      Mon Dec  2 12:21:44 2024
+----------------------------+---------------------------------------------------
+NewRec     0 days, 00:07:33 | since                     Mon Dec  2 12:21:44 2024
+    up     0 days, 00:07:34 | since                     Mon Dec  2 12:21:44 2024
+  down     0 days, 00:00:00 | since                     Mon Dec  2 12:21:44 2024
+   %up              100.000 | since                     Mon Dec  2 12:21:44 2024
 

This is how I track the uptimes for all of my host:
@@ -403,17 +403,17 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
paul@f0:~ % ifconfig re0
-re0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
-        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
-        ether e8:ff:1e:d7:1c:ac
-        inet 192.168.1.130 netmask 0xffffff00 broadcast 192.168.1.255
-        inet6 fe80::eaff:1eff:fed7:1cac%re0 prefixlen 64 scopeid 0x1
-        inet6 fd22:c702:acb7:0:eaff:1eff:fed7:1cac prefixlen 64 detached autoconf
-        inet6 2a01:5a8:304:1d5c:eaff:1eff:fed7:1cac prefixlen 64 autoconf pltime 10800 vltime 14400
-        media: Ethernet autoselect (1000baseT <full-duplex>)
-        status: active
-        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
+
paul@f0:~ % ifconfig re0
+re0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
+        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
+        ether e8:ff:1e:d7:1c:ac
+        inet 192.168.1.130 netmask 0xffffff00 broadcast 192.168.1.255
+        inet6 fe80::eaff:1eff:fed7:1cac%re0 prefixlen 64 scopeid 0x1
+        inet6 fd22:c702:acb7:0:eaff:1eff:fed7:1cac prefixlen 64 detached autoconf
+        inet6 2a01:5a8:304:1d5c:eaff:1eff:fed7:1cac prefixlen 64 autoconf pltime 10800 vltime 14400
+        media: Ethernet autoselect (1000baseT <full-duplex>)
+        status: active
+        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
 

RAM


@@ -424,8 +424,8 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
paul@f0:~ % sysctl hw.physmem
-hw.physmem: 16902905856
+
paul@f0:~ % sysctl hw.physmem
+hw.physmem: 16902905856
 
 

@@ -437,11 +437,11 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
paul@f0:~ % sysctl dev.cpu | grep freq:
-dev.cpu.3.freq: 705
-dev.cpu.2.freq: 705
-dev.cpu.1.freq: 604
-dev.cpu.0.freq: 604
+
paul@f0:~ % sysctl dev.cpu | grep freq:
+dev.cpu.3.freq: 705
+dev.cpu.2.freq: 705
+dev.cpu.1.freq: 604
+dev.cpu.0.freq: 604
 

CPU throttling


@@ -452,14 +452,14 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
paul@f0:~ % doas pkg install ubench
-paul@f0:~ % rehash # For tcsh to find the newly installed command
-paul@f0:~ % ubench &
-paul@f0:~ % sysctl dev.cpu | grep freq:
-dev.cpu.3.freq: 2922
-dev.cpu.2.freq: 2922
-dev.cpu.1.freq: 2923
-dev.cpu.0.freq: 2922
+
paul@f0:~ % doas pkg install ubench
+paul@f0:~ % rehash # For tcsh to find the newly installed command
+paul@f0:~ % ubench &
+paul@f0:~ % sysctl dev.cpu | grep freq:
+dev.cpu.3.freq: 2922
+dev.cpu.2.freq: 2922
+dev.cpu.1.freq: 2923
+dev.cpu.0.freq: 2922
 

Idle, all three Beelinks plus the switch consumed 26.2W. But with ubench stressing all the CPUs, it went up to 38.8W.
@@ -910,7 +910,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
declare -xr HTML_THEME_DIR=./extras/html/themes/simple
+
declare -xr HTML_THEME_DIR=./extras/html/themes/simple
 

To customize the theme or create your own, simply copy the theme directory and modify it as needed. This makes it also much easier to switch between layouts.
@@ -1431,11 +1431,11 @@ jgs \\`_..---.Y.---.._`//

-

Got sets you up for a challenge


+

God sets you up for a challenge



Gods set you up for a challenge to see how resilient you are. Is getting angry worth the price? If you stay calm then you can find the optimal workaround for the obstacle. Stay calm even with big setbacks. Practice minimalism of negative emotions.

@@ -1535,38 +1535,38 @@ WHOA!! ( o.o ) by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% traceroute bad.horse
-traceroute to bad.horse (162.252.205.157), 30 hops max, 60 byte packets
- 1  dsldevice.lan (192.168.1.1)  5.712 ms  5.800 ms  6.466 ms
- 2  87-243-116-2.ip.btc-net.bg (87.243.116.2)  8.017 ms  7.506 ms  8.432 ms
- 3  * * *
- 4  * * *
- 5  xe-1-2-0.mpr1.fra4.de.above.net (80.81.194.26)  39.952 ms  40.155 ms  40.139 ms
- 6  ae12.cs1.fra6.de.eth.zayo.com (64.125.26.172)  128.014 ms * *
- 7  * * *
- 8  * * *
- 9  ae10.cs1.lhr15.uk.eth.zayo.com (64.125.29.17)  120.625 ms  121.117 ms  121.050 ms
-10  * * *
-11  * * *
-12  * * *
-13  ae5.mpr1.tor3.ca.zip.zayo.com (64.125.23.118)  192.605 ms  205.741 ms  203.607 ms
-14  64.124.217.237.IDIA-265104-ZYO.zip.zayo.com (64.124.217.237)  204.673 ms  134.674 ms  131.442 ms
-15  * * *
-16  67.223.96.90 (67.223.96.90)  128.245 ms  127.844 ms  127.843 ms
-17  bad.horse (162.252.205.130)  128.194 ms  122.854 ms  121.786 ms
-18  bad.horse (162.252.205.131)  128.831 ms  128.341 ms  186.559 ms
-19  bad.horse (162.252.205.132)  185.716 ms  180.121 ms  180.042 ms
-20  bad.horse (162.252.205.133)  203.170 ms  203.076 ms  203.168 ms
-21  he.rides.across.the.nation (162.252.205.134)  203.115 ms  141.830 ms  141.799 ms
-22  the.thoroughbred.of.sin (162.252.205.135)  147.965 ms  148.230 ms  170.478 ms
-23  he.got.the.application (162.252.205.136)  165.161 ms  164.939 ms  159.085 ms
-24  that.you.just.sent.in (162.252.205.137)  162.310 ms  158.569 ms  158.896 ms
-25  it.needs.evaluation (162.252.205.138)  162.927 ms  163.046 ms  163.085 ms
-26  so.let.the.games.begin (162.252.205.139)  233.363 ms  233.545 ms  233.317 ms
-27  a.heinous.crime (162.252.205.140)  237.745 ms  233.614 ms  233.740 ms
-28  a.show.of.force (162.252.205.141)  237.974 ms  176.085 ms  175.927 ms
-29  a.murder.would.be.nice.of.course (162.252.205.142)  181.838 ms  181.858 ms  182.059 ms
-30  bad.horse (162.252.205.143)  187.731 ms  187.416 ms  187.532 ms
+
% traceroute bad.horse
+traceroute to bad.horse (162.252.205.157), 30 hops max, 60 byte packets
+ 1  dsldevice.lan (192.168.1.1)  5.712 ms  5.800 ms  6.466 ms
+ 2  87-243-116-2.ip.btc-net.bg (87.243.116.2)  8.017 ms  7.506 ms  8.432 ms
+ 3  * * *
+ 4  * * *
+ 5  xe-1-2-0.mpr1.fra4.de.above.net (80.81.194.26)  39.952 ms  40.155 ms  40.139 ms
+ 6  ae12.cs1.fra6.de.eth.zayo.com (64.125.26.172)  128.014 ms * *
+ 7  * * *
+ 8  * * *
+ 9  ae10.cs1.lhr15.uk.eth.zayo.com (64.125.29.17)  120.625 ms  121.117 ms  121.050 ms
+10  * * *
+11  * * *
+12  * * *
+13  ae5.mpr1.tor3.ca.zip.zayo.com (64.125.23.118)  192.605 ms  205.741 ms  203.607 ms
+14  64.124.217.237.IDIA-265104-ZYO.zip.zayo.com (64.124.217.237)  204.673 ms  134.674 ms  131.442 ms
+15  * * *
+16  67.223.96.90 (67.223.96.90)  128.245 ms  127.844 ms  127.843 ms
+17  bad.horse (162.252.205.130)  128.194 ms  122.854 ms  121.786 ms
+18  bad.horse (162.252.205.131)  128.831 ms  128.341 ms  186.559 ms
+19  bad.horse (162.252.205.132)  185.716 ms  180.121 ms  180.042 ms
+20  bad.horse (162.252.205.133)  203.170 ms  203.076 ms  203.168 ms
+21  he.rides.across.the.nation (162.252.205.134)  203.115 ms  141.830 ms  141.799 ms
+22  the.thoroughbred.of.sin (162.252.205.135)  147.965 ms  148.230 ms  170.478 ms
+23  he.got.the.application (162.252.205.136)  165.161 ms  164.939 ms  159.085 ms
+24  that.you.just.sent.in (162.252.205.137)  162.310 ms  158.569 ms  158.896 ms
+25  it.needs.evaluation (162.252.205.138)  162.927 ms  163.046 ms  163.085 ms
+26  so.let.the.games.begin (162.252.205.139)  233.363 ms  233.545 ms  233.317 ms
+27  a.heinous.crime (162.252.205.140)  237.745 ms  233.614 ms  233.740 ms
+28  a.show.of.force (162.252.205.141)  237.974 ms  176.085 ms  175.927 ms
+29  a.murder.would.be.nice.of.course (162.252.205.142)  181.838 ms  181.858 ms  182.059 ms
+30  bad.horse (162.252.205.143)  187.731 ms  187.416 ms  187.532 ms
 

2. ASCII cinema


@@ -1594,20 +1594,20 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#include <stdio.h>
+
#include <stdio.h>
 
-int main(void) {
-  int array[5] = { 1, 2, 3, 4, 5 };
+int main(void) {
+  int array[5] = { 1, 2, 3, 4, 5 };
 
-  for (int i = 0; i < 5; i++)
-    printf("%d\n", array[i]);
+  for (int i = 0; i < 5; i++)
+    printf("%d\n", array[i]);
 
-  for (int i = 0; i < 5; i++)
-    printf("%d\n", i[array]);
+  for (int i = 0; i < 5; i++)
+    printf("%d\n", i[array]);
 
-  for (int i = 0; i < 5; i++)
-    printf("%d\n", *(i + array));
-}
+  for (int i = 0; i < 5; i++)
+    printf("%d\n", *(i + array));
+}
 

5. Variables with prefix $


@@ -1618,20 +1618,20 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#include <stdio.h>
+
#include <stdio.h>
 
-int main(void) {
-  int $array[5] = { 1, 2, 3, 4, 5 };
+int main(void) {
+  int $array[5] = { 1, 2, 3, 4, 5 };
 
-  for (int $i = 0; $i < 5; $i++)
-    printf("%d\n", $array[$i]);
+  for (int $i = 0; $i < 5; $i++)
+    printf("%d\n", $array[$i]);
 
-  for (int $i = 0; $i < 5; $i++)
-    printf("%d\n", $i[$array]);
+  for (int $i = 0; $i < 5; $i++)
+    printf("%d\n", $i[$array]);
 
-  for (int $i = 0; $i < 5; $i++)
-    printf("%d\n", *($i + $array));
-}
+  for (int $i = 0; $i < 5; $i++)
+    printf("%d\n", *($i + $array));
+}
 

6. Object oriented shell scripts using ksh


@@ -1642,40 +1642,40 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/ksh93
- 
-typeset -T Point_t=(
-    integer -h 'x coordinate' x=0
-    integer -h 'y coordinate' y=0
-    typeset -h 'point color'  color="red"
-
-    function getcolor {
-        print -r ${_.color}
-    }
-
-    function setcolor {
-        _.color=$1
-    }
-
-    setxy() {
-        _.x=$1; _.y=$2
-    }
-
-    getxy() {
-        print -r "(${_.x},${_.y})"
-    }
-)
- 
-Point_t point
- 
-echo "Initial coordinates are (${point.x},${point.y}). Color is ${point.color}"
- 
-point.setxy 5 6
-point.setcolor blue
- 
-echo "New coordinates are ${point.getxy}. Color is ${point.getcolor}"
- 
-exit 0
+
#!/usr/bin/ksh93
+ 
+typeset -T Point_t=(
+    integer -h 'x coordinate' x=0
+    integer -h 'y coordinate' y=0
+    typeset -h 'point color'  color="red"
+
+    function getcolor {
+        print -r ${_.color}
+    }
+
+    function setcolor {
+        _.color=$1
+    }
+
+    setxy() {
+        _.x=$1; _.y=$2
+    }
+
+    getxy() {
+        print -r "(${_.x},${_.y})"
+    }
+)
+ 
+Point_t point
+ 
+echo "Initial coordinates are (${point.x},${point.y}). Color is ${point.color}"
+ 
+point.setxy 5 6
+point.setcolor blue
+ 
+echo "New coordinates are ${point.getxy}. Color is ${point.getcolor}"
+ 
+exit 0
 

Using types to create object oriented Korn shell 93 scripts
@@ -1688,18 +1688,18 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
package main
+
package main
 
-import "fmt"
+import "fmt"
 
-func main() {
-	var i int
-	f := func() *int {
-		return &i
-	}
-	*f()++
-	fmt.Println(i)
-}
+func main() {
+	var i int
+	f := func() *int {
+		return &i
+	}
+	*f()++
+	fmt.Println(i)
+}
 

Go playground
@@ -1950,13 +1950,13 @@ jgs `-=========-`() by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
alias tm=tmux
-alias tl='tmux list-sessions'
-alias tn=tmux::new
-alias ta=tmux::attach
-alias tx=tmux::remote
-alias ts=tmux::search
-alias tssh=tmux::cluster_ssh
+
alias tm=tmux
+alias tl='tmux list-sessions'
+alias tn=tmux::new
+alias ta=tmux::attach
+alias tx=tmux::remote
+alias ts=tmux::search
+alias tssh=tmux::cluster_ssh
 

Note all tmux::...; those are custom shell functions doing certain things, and they aren't part of the Tmux distribution. But let's run through every aliases one by one.
@@ -1971,23 +1971,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
# Create new session and if alread exists attach to it
-tmux::new () {
-    readonly session=$1
-    local date=date
-    if where gdate &>/dev/null; then
-        date=gdate
-    fi
-
-    tmux::cleanup_default
-    if [ -z "$session" ]; then
-        tmux::new T$($date +%s)
-    else
-        tmux new-session -d -s $session
-        tmux -2 attach-session -t $session || tmux -2 switch-client -t $session
-    fi
-}
-alias tn=tmux::new
+
# Create new session and if alread exists attach to it
+tmux::new () {
+    readonly session=$1
+    local date=date
+    if where gdate &>/dev/null; then
+        date=gdate
+    fi
+
+    tmux::cleanup_default
+    if [ -z "$session" ]; then
+        tmux::new T$($date +%s)
+    else
+        tmux new-session -d -s $session
+        tmux -2 attach-session -t $session || tmux -2 switch-client -t $session
+    fi
+}
+alias tn=tmux::new
 

There is a lot going on here. Let's have a detailed look at what it is doing. As a note, the function relies on GNU Date, so MacOS is looking for the gdate commands to be available. Otherwise, it will fall back to date. You need to install GNU Date for Mac, as it isn't installed by default there. As I use Fedora Linux on my personal Laptop and a MacBook for work, I have to make it work for both.
@@ -2002,14 +2002,14 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
tmux::cleanup_default () {
-    local s
-    tmux list-sessions | grep '^T.*: ' | grep -F -v attached |
-    cut -d: -f1 | while read -r s; do
-        echo "Killing $s"
-        tmux kill-session -t "$s"
-    done
-}
+
tmux::cleanup_default () {
+    local s
+    tmux list-sessions | grep '^T.*: ' | grep -F -v attached |
+    cut -d: -f1 | while read -r s; do
+        echo "Killing $s"
+        tmux kill-session -t "$s"
+    done
+}
 

The cleanup function kills all open Tmux sessions that haven't been renamed properly yet—but only if they aren't attached (e.g., don't run in the foreground in any terminal). Cleaning them up automatically keeps my Tmux sessions as neat and tidy as possible.
@@ -2026,16 +2026,16 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
tmux::attach () {
-    readonly session=$1
-
-    if [ -z "$session" ]; then
-        tmux attach-session || tmux::new
-    else
-        tmux attach-session -t $session || tmux::new $session
-    fi
-}
-alias ta=tmux::attach
+
tmux::attach () {
+    readonly session=$1
+
+    if [ -z "$session" ]; then
+        tmux attach-session || tmux::new
+    else
+        tmux attach-session -t $session || tmux::new $session
+    fi
+}
+alias ta=tmux::attach
 

If no session is specified (as the argument of the function), it will try to attach to the first open session. If no Tmux server is running, it will create a new one with tmux::new. Otherwise, with a session name given as the argument, it will attach to it. If unsuccessful (e.g., the session doesn't exist), it will be created and attached to.
@@ -2048,12 +2048,12 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
tmux::remote () {
-    readonly server=$1
-    tmux new -s $server "ssh -t $server 'tmux attach-session || tmux'" || \
-        tmux attach-session -d -t $server
-}
-alias tr=tmux::remote
+
tmux::remote () {
+    readonly server=$1
+    tmux new -s $server "ssh -t $server 'tmux attach-session || tmux'" || \
+        tmux attach-session -d -t $server
+}
+alias tr=tmux::remote
 

Change of the Tmux prefix for better nesting


@@ -2076,15 +2076,15 @@ set-option -g prefix C-g by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
tmux::search () {
-    local -r session=$(tmux list-sessions | fzf | cut -d: -f1)
-    if [ -z "$TMUX" ]; then
-        tmux attach-session -t $session
-    else
-        tmux switch -t $session
-    fi
-}
-alias ts=tmux::search
+
tmux::search () {
+    local -r session=$(tmux list-sessions | fzf | cut -d: -f1)
+    if [ -z "$TMUX" ]; then
+        tmux attach-session -t $session
+    else
+        tmux switch -t $session
+    fi
+}
+alias ts=tmux::search
 

All it does is list all currently open sessions in fzf, where one of them can be searched and selected through fuzzy find, and then either switch (if already inside a session) to the other session or attach to the other session (if not yet in Tmux).
@@ -2111,15 +2111,15 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
tmux::cluster_ssh () {
-    if [ -f "$1" ]; then
-        tmux::tssh_from_file $1
-        return
-    fi
+
tmux::cluster_ssh () {
+    if [ -f "$1" ]; then
+        tmux::tssh_from_file $1
+        return
+    fi
 
-    tmux::tssh_from_argument $@
-}
-alias tssh=tmux::cluster_ssh
+    tmux::tssh_from_argument $@
+}
+alias tssh=tmux::cluster_ssh
 

This function is just a wrapper around the more complex tmux::tssh_from_file and tmux::tssh_from_argument functions, as you have learned already. Most of the magic happens there.
@@ -2132,23 +2132,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
tmux::tssh_from_argument () {
-    local -r session=$1; shift
-    local first_server=$1; shift
-
-    tmux new-session -d -s $session "ssh -t $first_server"
-    if ! tmux list-session | grep "^$session:"; then
-        echo "Could not create session $session"
-        return 2
-    fi
-
-    for server in "${@[@]}"; do
-        tmux split-window -t $session "tmux select-layout tiled; ssh -t $server"
-    done
-
-    tmux setw -t $session synchronize-panes on
-    tmux -2 attach-session -t $session | tmux -2 switch-client -t $session
-}
+
tmux::tssh_from_argument () {
+    local -r session=$1; shift
+    local first_server=$1; shift
+
+    tmux new-session -d -s $session "ssh -t $first_server"
+    if ! tmux list-session | grep "^$session:"; then
+        echo "Could not create session $session"
+        return 2
+    fi
+
+    for server in "${@[@]}"; do
+        tmux split-window -t $session "tmux select-layout tiled; ssh -t $server"
+    done
+
+    tmux setw -t $session synchronize-panes on
+    tmux -2 attach-session -t $session | tmux -2 switch-client -t $session
+}
 

It expects at least two arguments. The first argument is the session name to create for the clustered SSH session. All other arguments are server hostnames or FQDNs to which to connect. The first one is used to make the initial session. All remaining ones are added to that session with tmux split-window -t $session.... At the end, we enable synchronized panes by default, so whenever you type, the commands will be sent to every SSH connection, thus allowing the neat ClusterSSH feature to run commands on multiple servers simultaneously. Once done, we attach (or switch, if already in Tmux) to it.
@@ -2168,12 +2168,12 @@ bind-key P setw synchronize-panes on by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
tmux::tssh_from_file () {
-    local -r serverlist=$1; shift
-    local -r session=$(basename $serverlist | cut -d. -f1)
+
tmux::tssh_from_file () {
+    local -r serverlist=$1; shift
+    local -r session=$(basename $serverlist | cut -d. -f1)
 
-    tmux::tssh_from_argument $session $(awk '{ print $1} ' $serverlist | sed 's/.lan./.lan/g')
-}
+    tmux::tssh_from_argument $session $(awk '{ print $1} ' $serverlist | sed 's/.lan./.lan/g')
+}
 

tssh examples


@@ -2521,12 +2521,12 @@ Art by Laura Brown by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
Cluster :UK, :uk01 do
-  Customer.C1A1.segments.volumes.each do |volume|
-    puts volume.usage_stats
-    volume.move_off! if volume.over_subscribed?
-  end
-end
+
Cluster :UK, :uk01 do
+  Customer.C1A1.segments.volumes.each do |volume|
+    puts volume.usage_stats
+    volume.move_off! if volume.over_subscribed?
+  end
+end
 

I am abandoning this project because my workplace has stopped the annual pet project competition, and I have other more important projects to work on at the moment.
@@ -2900,38 +2900,38 @@ _____|_:_:_| (o)-(o) |_:_:_|--'`-. ,--. ksh under-water (((\'/ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/bin/ksh
-
-ZONES_DIR=/var/nsd/zones/master/
-DEFAULT_MASTER=fishfinger.buetow.org
-DEFAULT_STANDBY=blowfish.buetow.org
-
-determine_master_and_standby () {
-    local master=$DEFAULT_MASTER
-    local standby=$DEFAULT_STANDBY
-
-    .
-    .
-    .
-    
-    local -i health_ok=1
-    if ! ftp -4 -o - https://$master/index.txt | grep -q "Welcome to $master"; then
-        echo "https://$master/index.txt IPv4 health check failed"
-        health_ok=0
-    elif ! ftp -6 -o - https://$master/index.txt | grep -q "Welcome to $master"; then
-        echo "https://$master/index.txt IPv6 health check failed"
-        health_ok=0
-    fi
-    if [ $health_ok -eq 0 ]; then
-        local tmp=$master
-        master=$standby
-        standby=$tmp
-    fi
-
-    .
-    .
-    .
-}
+
#!/bin/ksh
+
+ZONES_DIR=/var/nsd/zones/master/
+DEFAULT_MASTER=fishfinger.buetow.org
+DEFAULT_STANDBY=blowfish.buetow.org
+
+determine_master_and_standby () {
+    local master=$DEFAULT_MASTER
+    local standby=$DEFAULT_STANDBY
+
+    .
+    .
+    .
+    
+    local -i health_ok=1
+    if ! ftp -4 -o - https://$master/index.txt | grep -q "Welcome to $master"; then
+        echo "https://$master/index.txt IPv4 health check failed"
+        health_ok=0
+    elif ! ftp -6 -o - https://$master/index.txt | grep -q "Welcome to $master"; then
+        echo "https://$master/index.txt IPv6 health check failed"
+        health_ok=0
+    fi
+    if [ $health_ok -eq 0 ]; then
+        local tmp=$master
+        master=$standby
+        standby=$tmp
+    fi
+
+    .
+    .
+    .
+}
 

The failover scripts looks for the ; Enable failover string in the DNS zone files and swaps the A and AAAA records of the DNS entries accordingly:
@@ -2940,42 +2940,42 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
fishfinger$ grep failover /var/nsd/zones/master/foo.zone.zone
-        300 IN A 46.23.94.99 ; Enable failover
-        300 IN AAAA 2a03:6000:6f67:624::99 ; Enable failover
-www     300 IN A 46.23.94.99 ; Enable failover
-www     300 IN AAAA 2a03:6000:6f67:624::99 ; Enable failover
-standby  300 IN A 23.88.35.144 ; Enable failover
-standby  300 IN AAAA 2a01:4f8:c17:20f1::42 ; Enable failover
+
fishfinger$ grep failover /var/nsd/zones/master/foo.zone.zone
+        300 IN A 46.23.94.99 ; Enable failover
+        300 IN AAAA 2a03:6000:6f67:624::99 ; Enable failover
+www     300 IN A 46.23.94.99 ; Enable failover
+www     300 IN AAAA 2a03:6000:6f67:624::99 ; Enable failover
+standby  300 IN A 23.88.35.144 ; Enable failover
+standby  300 IN AAAA 2a01:4f8:c17:20f1::42 ; Enable failover
 

-
transform () {
-  sed -E '
-	/IN A .*; Enable failover/ {
-	    /^standby/! {
-	        s/^(.*) 300 IN A (.*) ; (.*)/\1 300 IN A '$(cat /var/nsd/run/master_a)' ; \3/;
-	    }
-	    /^standby/ {
-	        s/^(.*) 300 IN A (.*) ; (.*)/\1 300 IN A '$(cat /var/nsd/run/standby_a)' ; \3/;
-	    }
-	}
-	/IN AAAA .*; Enable failover/ {
-	    /^standby/! {
-	        s/^(.*) 300 IN AAAA (.*) ; (.*)/\1 300 IN AAAA '$(cat /var/nsd/run/master_aaaa)' ; \3/;
-	    }
-	    /^standby/ {
-	        s/^(.*) 300 IN AAAA (.*) ; (.*)/\1 300 IN AAAA '$(cat /var/nsd/run/standby_aaaa)' ; \3/;
-	    }
-	}
-	/ ; serial/ {
-	    s/^( +) ([0-9]+) .*; (.*)/\1 '$(date +%s)' ; \3/;
-	}
-  '
-}
+
transform () {
+  sed -E '
+	/IN A .*; Enable failover/ {
+	    /^standby/! {
+	        s/^(.*) 300 IN A (.*) ; (.*)/\1 300 IN A '$(cat /var/nsd/run/master_a)' ; \3/;
+	    }
+	    /^standby/ {
+	        s/^(.*) 300 IN A (.*) ; (.*)/\1 300 IN A '$(cat /var/nsd/run/standby_a)' ; \3/;
+	    }
+	}
+	/IN AAAA .*; Enable failover/ {
+	    /^standby/! {
+	        s/^(.*) 300 IN AAAA (.*) ; (.*)/\1 300 IN AAAA '$(cat /var/nsd/run/master_aaaa)' ; \3/;
+	    }
+	    /^standby/ {
+	        s/^(.*) 300 IN AAAA (.*) ; (.*)/\1 300 IN AAAA '$(cat /var/nsd/run/standby_aaaa)' ; \3/;
+	    }
+	}
+	/ ; serial/ {
+	    s/^( +) ([0-9]+) .*; (.*)/\1 '$(date +%s)' ; \3/;
+	}
+  '
+}
 

After the failover, the script reloads nsd and performs a sanity check to see if DNS still works. If not, a rollback will be performed:
@@ -2984,48 +2984,48 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#! Race condition !#
-   
-if [ -f $zone_file.bak ]; then
-    mv $zone_file.bak $zone_file
-fi
-
-cat $zone_file | transform > $zone_file.new.tmp 
-
-grep -v ' ; serial' $zone_file.new.tmp > $zone_file.new.noserial.tmp
-grep -v ' ; serial' $zone_file > $zone_file.old.noserial.tmp
-
-echo "Has zone $zone_file changed?"
-if diff -u $zone_file.old.noserial.tmp $zone_file.new.noserial.tmp; then
-    echo "The zone $zone_file hasn't changed"
-    rm $zone_file.*.tmp
-    return 0
-fi
-
-cp $zone_file $zone_file.bak
-mv $zone_file.new.tmp $zone_file
-rm $zone_file.*.tmp
-echo "Reloading nsd"
-nsd-control reload
-
-if ! zone_is_ok $zone; then
-    echo "Rolling back $zone_file changes"
-    cp $zone_file $zone_file.invalid
-    mv $zone_file.bak $zone_file
-    echo "Reloading nsd"
-    nsd-control reload
-    zone_is_ok $zone
-    return 3
-fi
-
-for cleanup in invalid bak; do
-    if [ -f $zone_file.$cleanup ]; then
-        rm $zone_file.$cleanup
-    fi
-done
-
-echo "Failover of zone $zone to $MASTER completed"
-return 1
+
#! Race condition !#
+   
+if [ -f $zone_file.bak ]; then
+    mv $zone_file.bak $zone_file
+fi
+
+cat $zone_file | transform > $zone_file.new.tmp 
+
+grep -v ' ; serial' $zone_file.new.tmp > $zone_file.new.noserial.tmp
+grep -v ' ; serial' $zone_file > $zone_file.old.noserial.tmp
+
+echo "Has zone $zone_file changed?"
+if diff -u $zone_file.old.noserial.tmp $zone_file.new.noserial.tmp; then
+    echo "The zone $zone_file hasn't changed"
+    rm $zone_file.*.tmp
+    return 0
+fi
+
+cp $zone_file $zone_file.bak
+mv $zone_file.new.tmp $zone_file
+rm $zone_file.*.tmp
+echo "Reloading nsd"
+nsd-control reload
+
+if ! zone_is_ok $zone; then
+    echo "Rolling back $zone_file changes"
+    cp $zone_file $zone_file.invalid
+    mv $zone_file.bak $zone_file
+    echo "Reloading nsd"
+    nsd-control reload
+    zone_is_ok $zone
+    return 3
+fi
+
+for cleanup in invalid bak; do
+    if [ -f $zone_file.$cleanup ]; then
+        rm $zone_file.$cleanup
+    fi
+done
+
+echo "Failover of zone $zone to $MASTER completed"
+return 1
 

A non-zero return code (here, 3 when a rollback and 1 when a DNS failover was performed) will cause CRON to send an E-Mail with the whole script output.
@@ -3082,13 +3082,13 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
# Weekly auto-failover for Let's Encrypt automation
-local -i -r week_of_the_year=$(date +%U)
-if [ $(( week_of_the_year % 2 )) -eq 0 ]; then
-    local tmp=$master
-    master=$standby
-    standby=$tmp
-fi
+
# Weekly auto-failover for Let's Encrypt automation
+local -i -r week_of_the_year=$(date +%U)
+if [ $(( week_of_the_year % 2 )) -eq 0 ]; then
+    local tmp=$master
+    master=$standby
+    standby=$tmp
+fi
 

This way, a DNS failover is performed weekly so that the ACME automation can update the Let's Encrypt certificates (for master and standby) before they expire on each VM.
@@ -3462,8 +3462,8 @@ SSFISHKISSFISHKISSFISHKISSFISHKIS SFIS by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
$ doas installboot sd0 # Update the bootloader (not for every upgrade required)
-$ doas sysupgrade # Update all binaries (including Kernel)
+
$ doas installboot sd0 # Update the bootloader (not for every upgrade required)
+$ doas sysupgrade # Update all binaries (including Kernel)
 

sysupgrade downloaded and upgraded to the next release and rebooted the system. After the reboot, I run:
@@ -3472,9 +3472,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
$ doas sysmerge # Update system configuration files
-$ doas pkg_add -u # Update all packages
-$ doas reboot # Just in case, reboot one more time
+
$ doas sysmerge # Update system configuration files
+$ doas pkg_add -u # Update all packages
+$ doas reboot # Just in case, reboot one more time
 

That's it! Took me around 5 minutes in total! No issues, only these few comands, only 5 minutes! It just works! No problems, no conflicts, no tons (actually none) config file merge conflicts.
@@ -3640,24 +3640,24 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-log () {
-    local -r level="$1"; shift
-    local -r message="$1"; shift
-    local -i pid="$$"
+log () {
+    local -r level="$1"; shift
+    local -r message="$1"; shift
+    local -i pid="$$"
 
-    local -r callee=${FUNCNAME[1]}
-    local -r stamp=$(date +%Y%m%d-%H%M%S)
+    local -r callee=${FUNCNAME[1]}
+    local -r stamp=$(date +%Y%m%d-%H%M%S)
 
-    echo "$level|$stamp|$pid|$callee|$message" >&2
-}
+    echo "$level|$stamp|$pid|$callee|$message" >&2
+}
 
-at_home_friday_evening () {
-    log INFO 'One Peperoni Pizza, please'
-}
+at_home_friday_evening () {
+    log INFO 'One Peperoni Pizza, please'
+}
 
-at_home_friday_evening
+at_home_friday_evening
 

The output is as follows:
@@ -3666,8 +3666,8 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
./logexample.sh
-INFO|20231210-082732|123002|at_home_friday_evening|One Peperoni Pizza, please
+
❯ ./logexample.sh
+INFO|20231210-082732|123002|at_home_friday_evening|One Peperoni Pizza, please
 

:(){ :|:& };:


@@ -3701,18 +3701,18 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-outer() {
-  inner() {
-    echo 'Intel inside!'
-  }
-  inner
-}
+outer() {
+  inner() {
+    echo 'Intel inside!'
+  }
+  inner
+}
 
-inner
-outer
-inner
+inner
+outer
+inner
 

And let's execute it:
@@ -3730,26 +3730,26 @@ Intel inside! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-outer1() {
-  inner() {
-    echo 'Intel inside!'
-  }
-  inner
-}
+outer1() {
+  inner() {
+    echo 'Intel inside!'
+  }
+  inner
+}
 
-outer2() {
-  inner() {
-    echo 'Wintel inside!'
-  }
-  inner
-}
+outer2() {
+  inner() {
+    echo 'Wintel inside!'
+  }
+  inner
+}
 
-outer1
-inner
-outer2
-inner
+outer1
+inner
+outer2
+inner
 

And let's run it:
@@ -3770,14 +3770,14 @@ Wintel inside! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-some_expensive_operations() {
-  echo "Doing expensive operations with '$1' from pid $$"
-}
+some_expensive_operations() {
+  echo "Doing expensive operations with '$1' from pid $$"
+}
 
-for i in {0..9}; do echo $i; done \
-  | xargs -P10 -I{} bash -c 'some_expensive_operations "{}"'
+for i in {0..9}; do echo $i; done \
+  | xargs -P10 -I{} bash -c 'some_expensive_operations "{}"'
 

We try here to run ten parallel processes; each of them should run the some_expensive_operations function with a different argument. The arguments are provided to xargs through STDIN one per line. When executed, we get this:
@@ -3802,15 +3802,15 @@ bash: line 1: some_expensive_operations: command not found by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-some_expensive_operations() {
-  echo "Doing expensive operations with '$1' from pid $$"
-}
-export -f some_expensive_operations
+some_expensive_operations() {
+  echo "Doing expensive operations with '$1' from pid $$"
+}
+export -f some_expensive_operations
 
-for i in {0..9}; do echo $i; done \
-  | xargs -P10 -I{} bash -c 'some_expensive_operations "{}"'
+for i in {0..9}; do echo $i; done \
+  | xargs -P10 -I{} bash -c 'some_expensive_operations "{}"'
 

When we run this now, we get:
@@ -3835,19 +3835,19 @@ Doing expensive operations with '9' from pid 132840 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-some_other_function() {
-  echo "$1"
-}
+some_other_function() {
+  echo "$1"
+}
 
-some_expensive_operations() {
-  some_other_function "Doing expensive operations with '$1' from pid $$"
-}
-export -f some_expensive_operations
+some_expensive_operations() {
+  some_other_function "Doing expensive operations with '$1' from pid $$"
+}
+export -f some_expensive_operations
 
-for i in {0..9}; do echo $i; done \
-  | xargs -P10 -I{} bash -c 'some_expensive_operations "{}"'
+for i in {0..9}; do echo $i; done \
+  | xargs -P10 -I{} bash -c 'some_expensive_operations "{}"'
 

... because some_other_function isn't exported! You will also need to add an export -f some_other_function!
@@ -3860,22 +3860,22 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-foo() {
-  local foo=bar # Declare local/dynamic variable
-  bar
-  echo "$foo"
-}
+foo() {
+  local foo=bar # Declare local/dynamic variable
+  bar
+  echo "$foo"
+}
 
-bar() {
-  echo "$foo"
-  foo=baz
-}
+bar() {
+  echo "$foo"
+  foo=baz
+}
 
-foo=foo # Declare global variable
-foo # Call function foo
-echo "$foo"
+foo=foo # Declare global variable
+foo # Call function foo
+echo "$foo"
 

Let's pause a minute. What do you think the output would be?
@@ -3900,34 +3900,34 @@ foo by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-declare -r foo=foo
-declare -r bar=bar
+declare -r foo=foo
+declare -r bar=bar
 
-if [ "$foo" = foo ]; then
-  if [ "$bar" = bar ]; then
-    echo ok1
-  fi
-fi
+if [ "$foo" = foo ]; then
+  if [ "$bar" = bar ]; then
+    echo ok1
+  fi
+fi
 
-if [ "$foo" = foo ] && [ "$bar" == bar ]; then
-  echo ok2a
-fi
+if [ "$foo" = foo ] && [ "$bar" == bar ]; then
+  echo ok2a
+fi
 
-[ "$foo" = foo ] && [ "$bar" == bar ] && echo ok2b
+[ "$foo" = foo ] && [ "$bar" == bar ] && echo ok2b
 
-if [[ "$foo" = foo && "$bar" == bar ]]; then
-  echo ok3a
-fi
+if [[ "$foo" = foo && "$bar" == bar ]]; then
+  echo ok3a
+fi
 
- [[ "$foo" = foo && "$bar" == bar ]] && echo ok3b
+ [[ "$foo" = foo && "$bar" == bar ]] && echo ok3b
 
-if test "$foo" = foo && test "$bar" = bar; then
-  echo ok4a
-fi
+if test "$foo" = foo && test "$bar" = bar; then
+  echo ok4a
+fi
 
-test "$foo" = foo && test "$bar" = bar && echo ok4b
+test "$foo" = foo && test "$bar" = bar && echo ok4b
 

The output we get is:
@@ -3951,18 +3951,18 @@ ok4b by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-# Single line comment
+# Single line comment
 
-# These are two single line
-# comments one after another
+# These are two single line
+# comments one after another
 
-: <<COMMENT
-This is another way a
-multi line comment
-could be written!
-COMMENT
+: <<COMMENT
+This is another way a
+multi line comment
+could be written!
+COMMENT
 

I will not demonstrate the execution of this script, as it won't print anything! It's obviously not the most pretty way of commenting on your code, but it could sometimes be handy!
@@ -3975,11 +3975,11 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
#!/usr/bin/env bash
+
#!/usr/bin/env bash
 
-echo foo
-echo echo baz >> $0
-echo bar
+echo foo
+echo echo baz >> $0
+echo bar
 

When it is run, it will do:
@@ -4355,42 +4355,42 @@ photoalbum makemake by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% photoalbum makemake
-You may now customize ./photoalbumrc and run make
-
-% cat Makefile
-all:
-	photoalbum generate photoalbumrc
-clean:
-	photoalbum clean photoalbumrc
-
-% cat photoalbumrc
-# The title of the photoalbum
-TITLE='A simple Photoalbum'
-
-# Thumbnail height geometry
-THUMBHEIGHT=300
-# Normal geometry height (when viewing photo). Uncomment, to keep original size.
-HEIGHT=1200
-# Max previews per page.
-MAXPREVIEWS=40
-# Randomly shuffle all previews.
-# SHUFFLE=yes
-
-# Diverse directories, need to be full paths, not relative!
-INCOMING_DIR=$(pwd)/incoming
-DIST_DIR=$(pwd)/dist
-TEMPLATE_DIR=/usr/share/photoalbum/templates/default
-#TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal
-
-# Includes a .tar of the incoming dir in the dist, can be yes or no
-TARBALL_INCLUDE=yes
-TARBALL_SUFFIX=.tar
-TAR_OPTS='-c'
-
-# Some debugging options
-#set -e
-#set -x
+
% photoalbum makemake
+You may now customize ./photoalbumrc and run make
+
+% cat Makefile
+all:
+	photoalbum generate photoalbumrc
+clean:
+	photoalbum clean photoalbumrc
+
+% cat photoalbumrc
+# The title of the photoalbum
+TITLE='A simple Photoalbum'
+
+# Thumbnail height geometry
+THUMBHEIGHT=300
+# Normal geometry height (when viewing photo). Uncomment, to keep original size.
+HEIGHT=1200
+# Max previews per page.
+MAXPREVIEWS=40
+# Randomly shuffle all previews.
+# SHUFFLE=yes
+
+# Diverse directories, need to be full paths, not relative!
+INCOMING_DIR=$(pwd)/incoming
+DIST_DIR=$(pwd)/dist
+TEMPLATE_DIR=/usr/share/photoalbum/templates/default
+#TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal
+
+# Includes a .tar of the incoming dir in the dist, can be yes or no
+TARBALL_INCLUDE=yes
+TARBALL_SUFFIX=.tar
+TAR_OPTS='-c'
+
+# Some debugging options
+#set -e
+#set -x
 

In the case for irregular.ninja, I changed the defaults to the following:
@@ -4399,38 +4399,38 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
--- photoalbumrc        2023-10-29 21:42:00.894202045 +0200
-+++ photoalbumrc.new 2023-06-04 10:40:08.030994440 +0300
-@@ -1,23 +1,24 @@
- # The title of the photoalbum
--TITLE='A simple Photoalbum'
-+TITLE='Irregular.Ninja'
-
- # Thumbnail height geometry
--THUMBHEIGHT=300
-+THUMBHEIGHT=400
- # Normal geometry height (when viewing photo). Uncomment, to keep original size.
--HEIGHT=1200
-+HEIGHT=1800
- # Max previews per page.
- MAXPREVIEWS=40
--# Randomly shuffle all previews.
--# SHUFFLE=yes
-+# Randomly shuffle
-+SHUFFLE=yes
-
- # Diverse directories, need to be full paths, not relative!
--INCOMING_DIR=$(pwd)/incoming
-+INCOMING_DIR=~/Nextcloud/Photos/irregular.ninja
- DIST_DIR=$(pwd)/dist
- TEMPLATE_DIR=/usr/share/photoalbum/templates/default
- #TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal
-
- # Includes a .tar of the incoming dir in the dist, can be yes or no
--TARBALL_INCLUDE=yes
-+TARBALL_INCLUDE=no
- TARBALL_SUFFIX=.tar
- TAR_OPTS='-c'
+
--- photoalbumrc        2023-10-29 21:42:00.894202045 +0200
++++ photoalbumrc.new 2023-06-04 10:40:08.030994440 +0300
+@@ -1,23 +1,24 @@
+ # The title of the photoalbum
+-TITLE='A simple Photoalbum'
++TITLE='Irregular.Ninja'
+
+ # Thumbnail height geometry
+-THUMBHEIGHT=300
++THUMBHEIGHT=400
+ # Normal geometry height (when viewing photo). Uncomment, to keep original size.
+-HEIGHT=1200
++HEIGHT=1800
+ # Max previews per page.
+ MAXPREVIEWS=40
+-# Randomly shuffle all previews.
+-# SHUFFLE=yes
++# Randomly shuffle
++SHUFFLE=yes
+
+ # Diverse directories, need to be full paths, not relative!
+-INCOMING_DIR=$(pwd)/incoming
++INCOMING_DIR=~/Nextcloud/Photos/irregular.ninja
+ DIST_DIR=$(pwd)/dist
+ TEMPLATE_DIR=/usr/share/photoalbum/templates/default
+ #TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal
+
+ # Includes a .tar of the incoming dir in the dist, can be yes or no
+-TARBALL_INCLUDE=yes
++TARBALL_INCLUDE=no
+ TARBALL_SUFFIX=.tar
+ TAR_OPTS='-c'
 

So I changed the album title, adjusted some image and thumbnail dimensions, and I want all images to be randomly shuffled every time the album is generated! I also have all my photos in my Nextcloud Photo directory and don't want to copy them to the local incoming directory. Also, a tarball containing the whole album as a download isn't provided.
@@ -4603,7 +4603,7 @@ blurs html index.html photos thumbs by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dtail --servers serverlist.txt --grep INFO --files "/var/log/dserver/*.log"
+
% dtail --servers serverlist.txt --grep INFO --files "/var/log/dserver/*.log"
 

Hint: you can also provide a comma separated server list, e.g.: servers server1.example.org,server2.example.org:PORT,...
@@ -4616,7 +4616,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dtail --servers serverlist.txt --grep INFO "/var/log/dserver/*.log"
+
% dtail --servers serverlist.txt --grep INFO "/var/log/dserver/*.log"
 

Aggregating logs


@@ -4629,10 +4629,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dtail --servers serverlist.txt \
-    --files '/var/log/dserver/*.log' \
-    --query 'from STATS select sum($goroutines),sum($cgocalls),
-             last($time),max(lifetimeConnections)'
+
% dtail --servers serverlist.txt \
+    --files '/var/log/dserver/*.log' \
+    --query 'from STATS select sum($goroutines),sum($cgocalls),
+             last($time),max(lifetimeConnections)'
 

Beware: For map-reduce queries to work, you have to ensure that DTail supports your log format. Check out the documentaiton of the DTail query language and the DTail log formats on the DTail homepage for more information.
@@ -4645,10 +4645,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dtail --servers serverlist.txt \
-    --files '/var/log/dserver/*.log' \
-    'from STATS select sum($goroutines),sum($cgocalls),
-     last($time),max(lifetimeConnections)'
+
% dtail --servers serverlist.txt \
+    --files '/var/log/dserver/*.log' \
+    'from STATS select sum($goroutines),sum($cgocalls),
+     last($time),max(lifetimeConnections)'
 

Here is another example:
@@ -4657,10 +4657,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dtail --servers serverlist.txt \
-    --files '/var/log/dserver/*.log' \
-    --query 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
-             lifetimeConnections group by $hostname order by max($cgocalls)'
+
% dtail --servers serverlist.txt \
+    --files '/var/log/dserver/*.log' \
+    --query 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
+             lifetimeConnections group by $hostname order by max($cgocalls)'
 

Tail map-reduce example 2
@@ -4671,9 +4671,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dtail --servers serverlist.txt \
-    --files '/var/log/dserver/*.log' \
-    --query 'from STATS select ... outfile append result.csv'
+
% dtail --servers serverlist.txt \
+    --files '/var/log/dserver/*.log' \
+    --query 'from STATS select ... outfile append result.csv'
 

How to use dcat


@@ -4686,7 +4686,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dcat --servers serverlist.txt --files /etc/hostname
+
% dcat --servers serverlist.txt --files /etc/hostname
 

Cat example
@@ -4697,7 +4697,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dcat --servers serverlist.txt /etc/hostname
+
% dcat --servers serverlist.txt /etc/hostname
 

How to use dgrep


@@ -4708,9 +4708,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dgrep --servers server1.example.org:2223 \
-    --files /etc/passwd \
-    --regex nologin
+
% dgrep --servers server1.example.org:2223 \
+    --files /etc/passwd \
+    --regex nologin
 

Generally, dgrep is also a very useful way to search historic application logs for certain content.
@@ -4727,10 +4727,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dmap --servers serverlist.txt \
-    --files '/var/log/dserver/*.log' \
-    --query 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
-             lifetimeConnections group by $hostname order by max($cgocalls)'
+
% dmap --servers serverlist.txt \
+    --files '/var/log/dserver/*.log' \
+    --query 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
+             lifetimeConnections group by $hostname order by max($cgocalls)'
 

Remember: For that to work, you have to make sure that DTail supports your log format. You can either use the ones already defined in internal/mapr/logformat or add an extension to support a custom log format. The example here works out of the box though, as DTail understands its own log format already.
@@ -4753,9 +4753,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dmap --files /var/log/dserver/dserver.log
-    --query 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
-              lifetimeConnections group by $hostname order by max($cgocalls)'
+
% dmap --files /var/log/dserver/dserver.log
+    --query 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
+              lifetimeConnections group by $hostname order by max($cgocalls)'
 

As a shorthand version the following command can be used:
@@ -4764,9 +4764,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dmap 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
-        lifetimeConnections group by $hostname order by max($cgocalls)' \
-        /var/log/dsever/dserver.log
+
% dmap 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
+        lifetimeConnections group by $hostname order by max($cgocalls)' \
+        /var/log/dsever/dserver.log
 

You can also use a file input pipe as follows:
@@ -4775,9 +4775,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% cat /var/log/dserver/dserver.log | \
-    dmap 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
-          lifetimeConnections group by $hostname order by max($cgocalls)'
+
% cat /var/log/dserver/dserver.log | \
+    dmap 'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,
+          lifetimeConnections group by $hostname order by max($cgocalls)'
 

Aggregating CSV files


@@ -4788,16 +4788,16 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% cat example.csv
-name,lastname,age,profession
-Michael,Jordan,40,Basketball player
-Michael,Jackson,100,Singer
-Albert,Einstein,200,Physician
-% dmap --query 'select lastname,name where age > 40 logformat csv outfile result.csv' example.csv
-% cat result.csv
-lastname,name
-Jackson,Michael
-Einstein,Albert
+
% cat example.csv
+name,lastname,age,profession
+Michael,Jordan,40,Basketball player
+Michael,Jackson,100,Singer
+Albert,Einstein,200,Physician
+% dmap --query 'select lastname,name where age > 40 logformat csv outfile result.csv' example.csv
+% cat result.csv
+lastname,name
+Jackson,Michael
+Einstein,Albert
 

DMap can also be used to query and aggregate CSV files from remote servers.
@@ -4810,44 +4810,44 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
% dtail /var/log/dserver/dserver.log
+
% dtail /var/log/dserver/dserver.log
 

-
% dtail --logLevel trace /var/log/dserver/dserver.log
+
% dtail --logLevel trace /var/log/dserver/dserver.log
 

-
% dcat /etc/passwd
+
% dcat /etc/passwd
 

-
% dcat --plain /etc/passwd > /etc/test
-# Should show no differences.
-diff /etc/test /etc/passwd 
+
% dcat --plain /etc/passwd > /etc/test
+# Should show no differences.
+diff /etc/test /etc/passwd 
 

-
% dgrep --regex ERROR --files /var/log/dserver/dsever.log
+
% dgrep --regex ERROR --files /var/log/dserver/dsever.log
 

-
% dgrep --before 10 --after 10 --max 10 --grep ERROR /var/log/dserver/dsever.log
+
% dgrep --before 10 --after 10 --max 10 --grep ERROR /var/log/dserver/dsever.log
 

Use --help for more available options. Or go to the DTail page for more information! Hope you find DTail useful!
@@ -5017,9 +5017,9 @@ DC on fire: by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
if [ -n "$foo" ]; then
-  echo "$foo"
-fi
+
if [ -n "$foo" ]; then
+  echo "$foo"
+fi
 

Please run source-highlight --lang-list for a list of all supported languages.
@@ -5048,7 +5048,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
declare -xr MASTODON_URI='https://fosstodon.org/@snonux'
+
declare -xr MASTODON_URI='https://fosstodon.org/@snonux'
 

and add the following into your index.gmi:
@@ -5063,7 +5063,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
<a href='https://fosstodon.org/@snonux' rel='me'>Me at Mastodon</a>
+
<a href='https://fosstodon.org/@snonux' rel='me'>Me at Mastodon</a>
 

More


@@ -5563,11 +5563,11 @@ Have a nice day! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
git clone https://codeberg.org/snonux/gogios.git
-cd gogios
-go build -o gogios cmd/gogios/main.go
-doas cp gogios /usr/local/bin/gogios
-doas chmod 755 /usr/local/bin/gogios
+
git clone https://codeberg.org/snonux/gogios.git
+cd gogios
+go build -o gogios cmd/gogios/main.go
+doas cp gogios /usr/local/bin/gogios
+doas chmod 755 /usr/local/bin/gogios
 

You can use cross-compilation if you want to compile Gogios for OpenBSD on a Linux system without installing the Go compiler on OpenBSD. Follow these steps:
@@ -5576,9 +5576,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
export GOOS=openbsd
-export GOARCH=amd64
-go build -o gogios cmd/gogios/main.go
+
export GOOS=openbsd
+export GOARCH=amd64
+go build -o gogios cmd/gogios/main.go
 

On your OpenBSD system, copy the binary to /usr/local/bin/gogios and set the correct permissions as described in the previous section. All steps described here you could automate with your configuration management system of choice. I use Rexify, the friendly configuration management system, to automate the installation, but that is out of the scope of this document.
@@ -5593,11 +5593,11 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
doas adduser -group _gogios -batch _gogios
-doas usermod -d /var/run/gogios _gogios
-doas mkdir -p /var/run/gogios
-doas chown _gogios:_gogios /var/run/gogios
-doas chmod 750 /var/run/gogios
+
doas adduser -group _gogios -batch _gogios
+doas usermod -d /var/run/gogios _gogios
+doas mkdir -p /var/run/gogios
+doas chown _gogios:_gogios /var/run/gogios
+doas chmod 750 /var/run/gogios
 

Please note that creating a user and group might differ depending on your operating system. For other operating systems, consult their documentation for creating system users and groups.
@@ -5610,8 +5610,8 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
doas pkg_add monitoring-plugins
-doas pkg_add nrpe # If you want to execute checks remotely via NRPE.
+
doas pkg_add monitoring-plugins
+doas pkg_add nrpe # If you want to execute checks remotely via NRPE.
 

Once the installation is complete, you can find the monitoring plugins in the /usr/local/libexec/nagios directory, which then can be configured to be used in gogios.json.
@@ -5638,41 +5638,41 @@ echo 'This is a test email from OpenBSD.' | mail -s 'Test Email' by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
{
-  "EmailTo": "paul@dev.buetow.org",
-  "EmailFrom": "gogios@buetow.org",
-  "CheckTimeoutS": 10,
-  "CheckConcurrency": 2,
-  "StateDir": "/var/run/gogios",
-  "Checks": {
-    "Check ICMP4 www.foo.zone": {
-      "Plugin": "/usr/local/libexec/nagios/check_ping",
-      "Args": [ "-H", "www.foo.zone", "-4", "-w", "50,10%", "-c", "100,15%" ],
-      "Retries": 3,
-      "RetryInterval": 10
-    },
-    "Check ICMP6 www.foo.zone": {
-      "Plugin": "/usr/local/libexec/nagios/check_ping",
-      "Args": [ "-H", "www.foo.zone", "-6", "-w", "50,10%", "-c", "100,15%" ],
-      "Retries": 3,
-      "RetryInterval": 10
-    },
-    "www.foo.zone HTTP IPv4": {
-      "Plugin": "/usr/local/libexec/nagios/check_http",
-      "Args": ["www.foo.zone", "-4"],
-      "DependsOn": ["Check ICMP4 www.foo.zone"]
-    },
-    "www.foo.zone HTTP IPv6": {
-      "Plugin": "/usr/local/libexec/nagios/check_http",
-      "Args": ["www.foo.zone", "-6"],
-      "DependsOn": ["Check ICMP6 www.foo.zone"]
-    }
-    "Check NRPE Disk Usage foo.zone": {
-      "Plugin": "/usr/local/libexec/nagios/check_nrpe",
-      "Args": ["-H", "foo.zone", "-c", "check_disk", "-p", "5666", "-4"]
-    }
-  }
-}
+
{
+  "EmailTo": "paul@dev.buetow.org",
+  "EmailFrom": "gogios@buetow.org",
+  "CheckTimeoutS": 10,
+  "CheckConcurrency": 2,
+  "StateDir": "/var/run/gogios",
+  "Checks": {
+    "Check ICMP4 www.foo.zone": {
+      "Plugin": "/usr/local/libexec/nagios/check_ping",
+      "Args": [ "-H", "www.foo.zone", "-4", "-w", "50,10%", "-c", "100,15%" ],
+      "Retries": 3,
+      "RetryInterval": 10
+    },
+    "Check ICMP6 www.foo.zone": {
+      "Plugin": "/usr/local/libexec/nagios/check_ping",
+      "Args": [ "-H", "www.foo.zone", "-6", "-w", "50,10%", "-c", "100,15%" ],
+      "Retries": 3,
+      "RetryInterval": 10
+    },
+    "www.foo.zone HTTP IPv4": {
+      "Plugin": "/usr/local/libexec/nagios/check_http",
+      "Args": ["www.foo.zone", "-4"],
+      "DependsOn": ["Check ICMP4 www.foo.zone"]
+    },
+    "www.foo.zone HTTP IPv6": {
+      "Plugin": "/usr/local/libexec/nagios/check_http",
+      "Args": ["www.foo.zone", "-6"],
+      "DependsOn": ["Check ICMP6 www.foo.zone"]
+    }
+    "Check NRPE Disk Usage foo.zone": {
+      "Plugin": "/usr/local/libexec/nagios/check_nrpe",
+      "Args": ["-H", "foo.zone", "-c", "check_disk", "-p", "5666", "-4"]
+    }
+  }
+}
 

    @@ -5701,7 +5701,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
    doas -u _gogios /usr/local/bin/gogios -cfg /etc/gogios.json
    +
    doas -u _gogios /usr/local/bin/gogios -cfg /etc/gogios.json
     

    To run Gogios via CRON on OpenBSD as the gogios user and check all services once per minute, follow these steps:
    @@ -5951,7 +5951,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
    $ raku guprecords.raku --stats=dir=$HOME/git/uprecords/stats --all
    +
    $ raku guprecords.raku --stats=dir=$HOME/git/uprecords/stats --all
     

    This command will generate a comprehensive uptime report from the collected statistics, making it easy to review and enjoy the data.
    @@ -6363,8 +6363,8 @@ Blablabla... by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
    declare -xr PRE_GENERATE_HOOK=./pre_generate_hook.sh
    -declare -xr POST_PUBLISH_HOOK=./post_publish_hook.sh
    +
    declare -xr PRE_GENERATE_HOOK=./pre_generate_hook.sh
    +declare -xr POST_PUBLISH_HOOK=./post_publish_hook.sh
     

    Use of safer Bash options


    @@ -6381,10 +6381,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
    % cat gemfeed/2023-02-26-title-here.gmi
    -# Title here
    +
    % cat gemfeed/2023-02-26-title-here.gmi
    +# Title here
     
    -The remaining content of the Gemtext file...
    +The remaining content of the Gemtext file...
     

    Gemtexter will add a line starting with > Published at ... now. Any subsequent Atom feed generation will then use that date.
    @@ -6393,12 +6393,12 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
    % cat gemfeed/2023-02-26-title-here.gmi
    -# Title here
    +
    % cat gemfeed/2023-02-26-title-here.gmi
    +# Title here
     
    -> Published at 2023-02-26T21:43:51+01:00
    +> Published at 2023-02-26T21:43:51+01:00
     
    -The remaining content of the Gemtext file...
    +The remaining content of the Gemtext file...
     

    XMLLint support


    @@ -7047,10 +7047,10 @@ Art by \ \_! / __! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
    " Clipboard
    -vnoremap ,y !pbcopy<CR>ugv
    -vnoremap ,i !pbpaste<CR>
    -nmap ,i !wpbpaste<CR>
    +
    " Clipboard
    +vnoremap ,y !pbcopy<CR>ugv
    +vnoremap ,i !pbpaste<CR>
    +nmap ,i !wpbpaste<CR>
     

    That's only a very few lines and does precisely what I want. It's quick and dirty but get's the job done! If VimScript becomes too cumbersome, I can use Lua for NeoVim scripting.
    @@ -7670,23 +7670,23 @@ jgs (________\ \ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
    check_dependencies () {
    -    # At least, Bash 5 is required
    -    local -i required_version=5
    -    IFS=. read -ra version <<< "$BASH_VERSION"
    -    if [ "${version[0]}" -lt $required_version ]; then
    -        log ERROR "ERROR, \"bash\" must be at least at major version $required_version!"
    -        exit 2
    -    fi
    -
    -    # These must be the GNU versions of the commands
    -    for tool in $DATE $SED $GREP; do
    -        if ! $tool --version | grep -q GNU; then
    -            log ERROR "ERROR, \"$tool\" command is not the GNU version, please install!"
    -            exit 2
    -        fi
    -    done
    -}
    +
    check_dependencies () {
    +    # At least, Bash 5 is required
    +    local -i required_version=5
    +    IFS=. read -ra version <<< "$BASH_VERSION"
    +    if [ "${version[0]}" -lt $required_version ]; then
    +        log ERROR "ERROR, \"bash\" must be at least at major version $required_version!"
    +        exit 2
    +    fi
    +
    +    # These must be the GNU versions of the commands
    +    for tool in $DATE $SED $GREP; do
    +        if ! $tool --version | grep -q GNU; then
    +            log ERROR "ERROR, \"$tool\" command is not the GNU version, please install!"
    +            exit 2
    +        fi
    +    done
    +}
     

    Especially macOS users didn't read the README carefully enough to install GNU Grep, GNU Sed and GNU Date before using Gemtexter.
    @@ -7707,7 +7707,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -
    ./gemtexter --generate '.*hello.*'
    +
    ./gemtexter --generate '.*hello.*'
     

    Revamped git support


    -- cgit v1.2.3