<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title>frankie-tales</title><id>https://lovergine.com/feeds/tags/configurations.xml</id><subtitle>Tag: configurations</subtitle><updated>2026-11-11T07:00:02Z</updated><link href="https://lovergine.com/feeds/tags/configurations.xml" rel="self" /><link href="https://lovergine.com" /><entry><title>A decent SSH client for Android is not what one would expect</title><id>https://lovergine.com/a-decent-ssh-client-for-android-is-not-what-one-would-expect.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2026-02-08T16:00:00Z</updated><link href="https://lovergine.com/a-decent-ssh-client-for-android-is-not-what-one-would-expect.html" rel="alternate" /><content type="html">&lt;p&gt;I’m not too happy with using mobile devices as a daily driver for server
connections. When one needs to use a keyboard, in many cases the appropriate
device is inevitably a laptop or a desktop computer. Anyway, sometimes it
happens  that the mobile phone should be used as an SSH client for an emergency
or to perform simple remote tasks. Possibly using an app that is usable, decently
supported, and can share common configurations among multiple devices with a
reasonable level of security.&lt;/p&gt;&lt;p&gt;For years, the most used client on Android has been &lt;em&gt;JuiceSSH&lt;/em&gt;, but unfortunately,
it became abandonware some years ago, and at the end of last year, it was also
delisted from the PlayStore. A few days ago, I changed my smartphone and
finally moved to the latest &lt;a href=&quot;https://shop.fairphone.com/home&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Fairphone&lt;/a&gt; model.
Now, who knows me already knows how
much I hate mobile phones, which are generally the realm of apps with the worst
UX ever conceived. Since then, I discovered that the pro option of JuiceSSH is
also dead, and basically, SSH forwarding cannot be used anymore. Too bad, I
decided to look for a state-of-the-art SSH client application and discovered
that the generally suggested apps (i.e., Termius and Connectbot) are the usual
PITA.&lt;/p&gt;&lt;p&gt;Thanks gosh, &lt;em&gt;Termux&lt;/em&gt; entered the room.&lt;/p&gt;&lt;p&gt;For people who don't know it, it is an Android terminal that emulates a color
xterm, but has some nice features, specifically a damn good
&lt;a href=&quot;https://wiki.termux.com/wiki/Package_Management&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;package management tool&lt;/a&gt;
built in. Of course, it is pure FOSS.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;pkg install openssh git vim&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now it could be nice to access the common storage area by enabling it with&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;termux-setup-storage&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This could be useful for exchanging files with remote hosts and keeping them
available for/from other apps.&lt;/p&gt;&lt;p&gt;Now, a useful &lt;code&gt;.ssh/config&lt;/code&gt; file can be pulled via &lt;code&gt;git&lt;/code&gt;, stored locally, and
possibly customized to simplify ssh network access, with all helpful host
stanzas. Even a local password-protected host key can be created and stored
locally for safety.&lt;/p&gt;&lt;p&gt;So far, so good. Probably, I should simply start giving up on treating Android
as a special beast and treat it as just another Linux host. Fewer apps, more
terminal, and fuck the majority!&lt;/p&gt;</content></entry><entry><title>A Terramaster NAS with Debian, take two.</title><id>https://lovergine.com/a-terramaster-nas-with-debian-take-two.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2026-01-19T13:00:00Z</updated><link href="https://lovergine.com/a-terramaster-nas-with-debian-take-two.html" rel="alternate" /><content type="html">&lt;p&gt;After &lt;a href=&quot;/installing-debian-on-a-usb-stick-for-a-terramaster-nas.html&quot;&gt;experimenting at home&lt;/a&gt;,
the very first professional-grade NAS from
Terramaster arrived at work, too, with 12 HDD bays and possibly a pair of M2s.
NVME cards. In this case, I again installed a plain Debian distribution, but HDD
monitoring required some configuration adjustments to run &lt;code&gt;smartd&lt;/code&gt; properly.&lt;/p&gt;&lt;p&gt;A decent approach to data safety is to run regularly scheduled short and long
SMART tests on all disks to detect potential damage. Running such tests on all
disks at once isn't ideal, so I set up a script to create a staggered
configuration and test multiple groups of disks at different times. Note that it
is mandatory to read the devices at each reboot because their names and order
can change.&lt;/p&gt;&lt;p&gt;Of course, the same principle (short/long test at regular intervals along the
week) should be applied for a simpler configuration, as in the case of my home
NAS with a pair of RAID1 devices.&lt;/p&gt;&lt;p&gt;What follows is a simple script to create a staggered &lt;code&gt;smartd.conf&lt;/code&gt; at boot
time:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#!/bin/bash
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# Save this as /usr/local/bin/create-smartd-conf.sh
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# Dynamically generate smartd.conf with staggered SMART test scheduling
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# at boot time based on discovered ATA devices
&lt;/span&gt;
&lt;span class=&quot;syntax-comment&quot;&gt;# HERE IS A LIST OF DIRECTIVES FOR THIS CONFIGURATION FILE.
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# PLEASE SEE THE smartd.conf MAN PAGE FOR DETAILS
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -d TYPE Set the device type: ata, scsi[+TYPE], nvme[,NSID],
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#           sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,p][,x][,N],
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#           usbprolific, usbsunplus, sntasmedia, sntjmicron[,NSID], sntrealtek,
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#           ... (platform specific)
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -T TYPE Set the tolerance to one of: normal, permissive
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -o VAL  Enable/disable automatic offline tests (on/off)
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -S VAL  Enable/disable attribute autosave (on/off)
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -n MODE No check if: never, sleep[,N][,q], standby[,N][,q], idle[,N][,q]
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -H      Monitor SMART Health Status, report if failed
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -s REG  Do Self-Test at time(s) given by regular expression REG
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -l TYPE Monitor SMART log or self-test status:
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#           error, selftest, xerror, offlinests[,ns], selfteststs[,ns]
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -l scterc,R,W  Set SCT Error Recovery Control
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -e      Change device setting: aam,[N|off], apm,[N|off], dsn,[on|off],
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#           lookahead,[on|off], security-freeze, standby,[N|off], wcache,[on|off]
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -f      Monitor 'Usage' Attributes, report failures
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -m ADD  Send email warning to address ADD
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -M TYPE Modify email warning behavior (see man page)
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -p      Report changes in 'Prefailure' Attributes
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -u      Report changes in 'Usage' Attributes
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -t      Equivalent to -p and -u Directives
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -r ID   Also report Raw values of Attribute ID with -p, -u or -t
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -R ID   Track changes in Attribute ID Raw value with -p, -u or -t
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -i ID   Ignore Attribute ID for -f Directive
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -I ID   Ignore Attribute ID for -p, -u or -t Directive
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -C ID[+] Monitor [increases of] Current Pending Sectors in Attribute ID
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -U ID[+] Monitor [increases of] Offline Uncorrectable Sectors in Attribute ID
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -W D,I,C Monitor Temperature D)ifference, I)nformal limit, C)ritical limit
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -v N,ST Modifies labeling of Attribute N (see man page)
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -P TYPE Drive-specific presets: use, ignore, show, showall
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -a      Default: -H -f -t -l error -l selftest -l selfteststs -C 197 -U 198
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -F TYPE Use firmware bug workaround:
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#           none, nologdir, samsung, samsung2, samsung3, xerrorlba
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#   -c i=N  Set interval between disk checks to N seconds
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#    #      Comment: text after a hash sign is ignored
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#    \      Line continuation character
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# Attribute ID is a decimal integer 1 &amp;lt;= ID &amp;lt;= 255
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# except for -C and -U, where ID = 0 turns them off.
&lt;/span&gt;
set &lt;span class=&quot;syntax-attribute&quot;&gt;-euo&lt;/span&gt; pipefail

&lt;span class=&quot;syntax-comment&quot;&gt;# Test schedule configuration
&lt;/span&gt;BASE_SCHEDULE=&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;L/../../6&amp;quot;&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;# Long test on Saturdays
&lt;/span&gt;TEST_HOURS=&lt;span class=&quot;syntax-special&quot;&gt;(&lt;/span&gt;01 03 05 07&lt;span class=&quot;syntax-special&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;# 4 time slots: 1am, 3am, 5am, 7am
&lt;/span&gt;
DEVICES_PER_GROUP=3

main&lt;span class=&quot;syntax-special&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;)&lt;/span&gt; {
    &lt;span class=&quot;syntax-comment&quot;&gt;# Get array of device names (e.g., sda, sdb, sdc)
&lt;/span&gt;    mapfile &lt;span class=&quot;syntax-attribute&quot;&gt;-t&lt;/span&gt; devices &lt;span class=&quot;syntax-special&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;(&lt;/span&gt;ls &lt;span class=&quot;syntax-attribute&quot;&gt;-l&lt;/span&gt; /dev/disk/by-id/ &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; grep ata &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; awk &lt;span class=&quot;syntax-string&quot;&gt;'{print $11}'&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; grep sd &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; cut &lt;span class=&quot;syntax-attribute&quot;&gt;-d&lt;/span&gt;/ &lt;span class=&quot;syntax-attribute&quot;&gt;-f3&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; sort &lt;span class=&quot;syntax-attribute&quot;&gt;-u&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;syntax-keyword&quot;&gt;if&lt;/span&gt; [[ &lt;span class=&quot;syntax-variable&quot;&gt;${#devices[@]}&lt;/span&gt; &lt;span class=&quot;syntax-attribute&quot;&gt;-eq&lt;/span&gt; 0 ]]&lt;span class=&quot;syntax-special&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;syntax-keyword&quot;&gt;then&lt;/span&gt;
        exit 1
    &lt;span class=&quot;syntax-keyword&quot;&gt;fi&lt;/span&gt;

    &lt;span class=&quot;syntax-comment&quot;&gt;# Start building config file
&lt;/span&gt;    cat &lt;span class=&quot;syntax-special&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; EOF
&lt;span class=&quot;syntax-comment&quot;&gt;# smartd.conf - Auto-generated at boot
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# Generated: $(date '+%Y-%m-%d %H:%M:%S')
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# Staggered SMART test scheduling to avoid concurrent disk load
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# Long tests run on Saturdays at different times per group
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;#
&lt;/span&gt;EOF

    &lt;span class=&quot;syntax-comment&quot;&gt;# Process devices into groups
&lt;/span&gt;    local group=0
    local count_in_group=0

    &lt;span class=&quot;syntax-keyword&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;syntax-keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;${!devices[@]}&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;syntax-keyword&quot;&gt;do&lt;/span&gt;
        local dev=&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;${devices[$i]}&amp;quot;&lt;/span&gt;
        local hour=&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;${TEST_HOURS[$group]}&amp;quot;&lt;/span&gt;

        &lt;span class=&quot;syntax-comment&quot;&gt;# Add group header at start of each group
&lt;/span&gt;        &lt;span class=&quot;syntax-keyword&quot;&gt;if&lt;/span&gt; [[ &lt;span class=&quot;syntax-variable&quot;&gt;$count_in_group&lt;/span&gt; &lt;span class=&quot;syntax-attribute&quot;&gt;-eq&lt;/span&gt; 0 ]]&lt;span class=&quot;syntax-special&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;syntax-keyword&quot;&gt;then&lt;/span&gt;
            echo &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;
            echo &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;# Group $((group + 1)) - Tests at ${hour}:00 on Saturdays&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;syntax-keyword&quot;&gt;fi&lt;/span&gt;

        &lt;span class=&quot;syntax-comment&quot;&gt;# Add device entry
&lt;/span&gt;        &lt;span class=&quot;syntax-comment&quot;&gt;#echo &amp;quot;/dev/${dev} -a -o on -S on -s (${BASE_SCHEDULE}/${hour}) -m root&amp;quot;
&lt;/span&gt;        echo &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/dev/${dev} -a -o on -S on -s (L/../../6/${hour}) -s (S/../.././$(((hour + 12) % 24))) -m root&amp;quot;&lt;/span&gt;

        &lt;span class=&quot;syntax-comment&quot;&gt;# Move to next group when current group is full
&lt;/span&gt;        count_in_group=&lt;span class=&quot;syntax-variable&quot;&gt;$((count_in_group + 1)&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;syntax-keyword&quot;&gt;if&lt;/span&gt; [[ &lt;span class=&quot;syntax-variable&quot;&gt;$count_in_group&lt;/span&gt; &lt;span class=&quot;syntax-attribute&quot;&gt;-ge&lt;/span&gt; &lt;span class=&quot;syntax-variable&quot;&gt;$DEVICES_PER_GROUP&lt;/span&gt; ]]&lt;span class=&quot;syntax-special&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;syntax-keyword&quot;&gt;then&lt;/span&gt;
            count_in_group=0
            group=&lt;span class=&quot;syntax-variable&quot;&gt;$(((group + 1)&lt;/span&gt; % &lt;span class=&quot;syntax-variable&quot;&gt;${#TEST_HOURS[@]}&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;syntax-keyword&quot;&gt;fi&lt;/span&gt;
    &lt;span class=&quot;syntax-keyword&quot;&gt;done&lt;/span&gt;
}

main &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;$@&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To run such a script at boot, add a unit file to the systemd configuration.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo systemctl  edit &lt;span class=&quot;syntax-attribute&quot;&gt;--full&lt;/span&gt; &lt;span class=&quot;syntax-attribute&quot;&gt;--force&lt;/span&gt; regenerate-smartd-conf.service
sudo systemctl enable regenerate-smartd-conf.service&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Where the unit service is the following:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;&lt;span class=&quot;syntax-element&quot;&gt;[Unit]&lt;/span&gt;
&lt;span class=&quot;syntax-attribute&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;Generate smartd.conf with staggered SMART test scheduling
&lt;span class=&quot;syntax-comment&quot;&gt;# Wait for all local filesystems and udev device detection
&lt;/span&gt;&lt;span class=&quot;syntax-attribute&quot;&gt;After&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;local-fs.target systemd-udev-settle.service
&lt;span class=&quot;syntax-attribute&quot;&gt;Before&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;smartd.service
&lt;span class=&quot;syntax-attribute&quot;&gt;Wants&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;systemd-udev-settle.service
&lt;span class=&quot;syntax-attribute&quot;&gt;DefaultDependencies&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;no

&lt;span class=&quot;syntax-element&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;syntax-attribute&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;oneshot
&lt;span class=&quot;syntax-comment&quot;&gt;# Only generate the config file, don't touch smartd here
&lt;/span&gt;&lt;span class=&quot;syntax-attribute&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;/bin/bash -c '/usr/local/bin/create-smartd-config.sh &amp;gt; /etc/smartd.conf'
&lt;span class=&quot;syntax-attribute&quot;&gt;StandardOutput&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;journal
&lt;span class=&quot;syntax-attribute&quot;&gt;StandardError&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;journal
&lt;span class=&quot;syntax-attribute&quot;&gt;RemainAfterExit&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;yes

&lt;span class=&quot;syntax-element&quot;&gt;[Install]&lt;/span&gt;
&lt;span class=&quot;syntax-attribute&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;multi-user.target&lt;/code&gt;&lt;/pre&gt;</content></entry><entry><title>Creating your own Guix substitute server</title><id>https://lovergine.com/creating-your-own-guix-substitute-server.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2025-12-21T16:30:00Z</updated><link href="https://lovergine.com/creating-your-own-guix-substitute-server.html" rel="alternate" /><content type="html">&lt;p&gt;I lately dedicated some time to setting up my own substitute server for Guix on
a foreign distribution. This post is about that experience, after verifying
that such a process is currently quite underdocumented. A substitute server is
clearly a required step in order to cultivate a personal or
unofficial/alternative channel for Guix, at least if one has more than one box
(and possibly one physical location) to manage.&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/images/substs-srv.png&quot; alt=&quot;Sbstitutes server welcome&quot; /&gt;&lt;/p&gt;&lt;p&gt;For people not up to date with the news from these digital bits, in the last
year or so, I elected the Guix package manager and system as my second-preferred
OS, after Debian GNU/Linux. I published more posts about it, all readable under
my &lt;a href=&quot;/tags/guix.html&quot;&gt;dedicated feed&lt;/a&gt;.&lt;/p&gt;&lt;h2 id=&quot;what-is-a-substitute-server&quot;&gt;What is a Substitute Server?&lt;/h2&gt;&lt;p&gt;Guix is mainly a source-level roll-on distribution, so at every pull, there is a
concrete risk of having to build your own binaries if no binary provider is
available to speed up your update process. That is a certainty if you play with
your own packages. This is the concrete reason to possibly have a substitute
server in the LAN, even though the official ones can be subject to problems and
DDoS.
Specifically, I set up a substitute server based on Debian GNU/Linux reachable
both at home and at work. While the Guix manual is currently quite verbose about
how to use a substitute server from a client, it is bit incomplete about the
server side.&lt;/p&gt;&lt;h2 id=&quot;installation-of-guix-on-debian&quot;&gt;Installation of Guix on Debian&lt;/h2&gt;&lt;p&gt;The very first step is to install the Guix package manager on Debian, which is
currently not more possible using a Debian package from the main archive, as in
the past (see &lt;a href=&quot;https://lwn.net/Articles/1035491/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;this LWN post about&lt;/a&gt;).
Currently, a binary provided by the Guix project has to be used for that. It is
quite straightforward if you use the installer script provided with some
caution.&lt;/p&gt;&lt;p&gt;For instance, to install the current Guix version, it is possible to run:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ wget &lt;span class=&quot;syntax-attribute&quot;&gt;-O&lt;/span&gt; /tmp/guix-binary.tar.xz \
    https://ci.guix.gnu.org/search/latest/archive?query=spec:tarball+status:success+system:x86_64-linux+guix-binary.tar.xz
$ wget &lt;span class=&quot;syntax-attribute&quot;&gt;-O&lt;/span&gt; /tmp/guix-install.sh https://guix.gnu.org/install.sh

&lt;span class=&quot;syntax-comment&quot;&gt;# do your homework to check and verify binary and script, then...
&lt;/span&gt;$ sudo &lt;span class=&quot;syntax-attribute&quot;&gt;-i&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;# export GUIX_BINARY_FILE_NAME=/tmp/guix-binary.tar.xz
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# chmod a+x /tmp/guix-install.sh
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# apt install uidmap gnupg
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# /tmp/guix-install.sh
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;# rm -f /tmp/guix-install.sh /tmp/guix-binary.tar.xz
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That will install a daemon for building sources under an unprivileged
&lt;code&gt;guix-daemon&lt;/code&gt; user, which has full control over the guix data store at
&lt;code&gt;/gnu/store&lt;/code&gt;.&lt;/p&gt;&lt;h2 id=&quot;daemon-configuration-and-storage&quot;&gt;Daemon configuration and storage&lt;/h2&gt;&lt;p&gt;Such a daemon is run under &lt;code&gt;systemd&lt;/code&gt; control with a specific unit file. First, the
Guix data store needs plenty of disk space and inodes; I suggest moving the
&lt;code&gt;/gnu/store&lt;/code&gt; tree under an XFS or even a BTRFS filesystem, for that.&lt;/p&gt;&lt;p&gt;Second, the current installer tries to mount &lt;code&gt;/gnu/store&lt;/code&gt; in read-only mode,
which can prevent running the &lt;code&gt;guix&lt;/code&gt; command as an unprivileged user on foreign
distros. This can be disabled if problems occur, as could happen under specific conditions.
Once the &lt;code&gt;guix-daemon&lt;/code&gt; service
is stopped, the &lt;code&gt;gnu-store.mount&lt;/code&gt; can be disabled by ensuring the &lt;code&gt;/gnu/store&lt;/code&gt;
directory is correctly assigned to the &lt;code&gt;guix-daemon&lt;/code&gt; user:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ ls &lt;span class=&quot;syntax-attribute&quot;&gt;-ld&lt;/span&gt; /gnu/store/
drwxrwxr-t 584 guix-daemon guix-daemon 12M 18 dic 07.31 /gnu/store/
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;the-systemd-unit-file-for-the-guix-daemon&quot;&gt;The systemd unit file for the Guix daemon&lt;/h3&gt;&lt;p&gt;This is the proposed unit file for the &lt;code&gt;guix-daemon&lt;/code&gt; process:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;&lt;span class=&quot;syntax-element&quot;&gt;[Unit]&lt;/span&gt;
&lt;span class=&quot;syntax-attribute&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;Build daemon for GNU Guix
&lt;span class=&quot;syntax-comment&quot;&gt;# Start before 'gnu-store.mount' to get a writable view of the store.
&lt;/span&gt;&lt;span class=&quot;syntax-attribute&quot;&gt;Before&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;gnu-store.mount

&lt;span class=&quot;syntax-element&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;syntax-attribute&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
  --discover=yes \
  --substitute-urls='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org'
&lt;span class=&quot;syntax-attribute&quot;&gt;Environment&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;'GUIX_STATE_DIRECTORY=/var/guix' 'GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8
&lt;span class=&quot;syntax-comment&quot;&gt;# Run under a dedicated unprivileged user account.
&lt;/span&gt;&lt;span class=&quot;syntax-attribute&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;guix-daemon
&lt;span class=&quot;syntax-comment&quot;&gt;# Bind-mount the store read-write in a private namespace.
&lt;/span&gt;&lt;span class=&quot;syntax-attribute&quot;&gt;PrivateMounts&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;true
&lt;span class=&quot;syntax-attribute&quot;&gt;BindPaths&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;/gnu/store
&lt;span class=&quot;syntax-attribute&quot;&gt;MountFlags&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;private
&lt;span class=&quot;syntax-attribute&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;exec
&lt;span class=&quot;syntax-attribute&quot;&gt;AmbientCapabilities&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;CAP_CHOWN
&lt;span class=&quot;syntax-attribute&quot;&gt;StandardOutput&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;journal
&lt;span class=&quot;syntax-attribute&quot;&gt;StandardError&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;journal
&lt;span class=&quot;syntax-attribute&quot;&gt;OOMPolicy&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;continue
&lt;span class=&quot;syntax-attribute&quot;&gt;Restart&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;always
&lt;span class=&quot;syntax-attribute&quot;&gt;TasksMax&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;8192

&lt;span class=&quot;syntax-element&quot;&gt;[Install]&lt;/span&gt;
&lt;span class=&quot;syntax-attribute&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;multi-user.target
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that, when building from sources in specific cases, it could be a good idea to provide an additional TMPDIR environment variable to bypass the limited size of the /tmp directory (specifically for tmpfs implementation as for Debian 13+). For instance, building a full Linux kernel could require more than 32 GB of storage available in /tmp, which corresponds by default to at least 64 GB of RAM on the system. A typical personal box can be quite limited for that. So adding &lt;code&gt;TMPDIR=/var/tmp&lt;/code&gt; to
the &lt;em&gt;Environment&lt;/em&gt; variable could be a sane idea.&lt;/p&gt;&lt;h2 id=&quot;setting-up-guix-publish&quot;&gt;Setting up Guix Publish&lt;/h2&gt;&lt;p&gt;To set up the substitute server, a &lt;code&gt;guix publish&lt;/code&gt; process must be started via
systemd. First, create a publishing asymmetric key pair and a destination for
the cache directory:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ sudo &lt;span class=&quot;syntax-attribute&quot;&gt;-i&lt;/span&gt; guix archive &lt;span class=&quot;syntax-attribute&quot;&gt;--generate-key&lt;/span&gt;
$ sudo mkdir &lt;span class=&quot;syntax-attribute&quot;&gt;-p&lt;/span&gt; /var/cache/guix/publish
$ sudo chown guix-daemon:guix-daemon /var/cache/guix/publish
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is the systemd unit file for the &lt;code&gt;guix-publish.service&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;&lt;span class=&quot;syntax-element&quot;&gt;[Unit]&lt;/span&gt;
&lt;span class=&quot;syntax-attribute&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;Guix substitute server
&lt;span class=&quot;syntax-attribute&quot;&gt;After&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;network.target

&lt;span class=&quot;syntax-element&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;syntax-attribute&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;simple
&lt;span class=&quot;syntax-attribute&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;root
&lt;span class=&quot;syntax-attribute&quot;&gt;Environment&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;'GUIX_LOCPATH=/root/.guix-profile/lib/locale'
&lt;span class=&quot;syntax-attribute&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;/var/guix/profiles/per-user/root/current-guix/bin/guix publish \
  --listen=0.0.0.0 \
  --port=8080 \
  --user=guix-daemon \
  --compression=gzip:9 \
  --compression=lzip:9 \
  --cache=/var/cache/guix/publish \
  --ttl=30d --negative-ttl=1h \
  --workers=4
&lt;span class=&quot;syntax-attribute&quot;&gt;Restart&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;always
&lt;span class=&quot;syntax-attribute&quot;&gt;RestartSec&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;10

&lt;span class=&quot;syntax-element&quot;&gt;[Install]&lt;/span&gt;
&lt;span class=&quot;syntax-attribute&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;=&lt;/span&gt;multi-user.target
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will start the service in unprivileged mode on an unprivileged port, which
can be easily routed via an NGINX proxy, for instance (my preferred way). I use
this system to route the service on both the home and the at-work LANs.&lt;/p&gt;&lt;p&gt;Once done, of course, the next point is defining a policy to populate such a
server. While it could be nice running a proper
&lt;a href=&quot;https://guix.gnu.org/cuirass/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;cuirass&lt;/a&gt; build service to run continuously
building from a custom repository, it is also perfectly fine simply using a
manifest file with common packages or the multiple configurations used by
personal boxes.  Here is a series of alternatives to build a handful of
packages.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;guix build gcc
guix system build my-laptop-config.scm
guix build &lt;span class=&quot;syntax-attribute&quot;&gt;-m&lt;/span&gt; manifest.scm
guix build make cmake vim emacs perl
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A simple manifest example:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-scheme&quot;&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;specifications-&amp;gt;manifest&lt;/span&gt;
 &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;gcc-toolchain&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;python&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;emacs&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;git&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;make&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;cmake&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;perl&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;grass&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;gdal&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;geos&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;gawk&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;vim&amp;quot;&lt;/span&gt;
   &lt;span class=&quot;syntax-comment&quot;&gt;;; Add more packages...
&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Of course, a very simple strategy could consist of running regular pulls &amp;amp;
builds for all packages of primary interest and making frequent enough purges
of the data store to avoid excessive storage consumption. That can be avoided
if plenty of space is available for builds.&lt;/p&gt;&lt;p&gt;Once setup the server and populating it, it is possibile to add its URL to the
configurations of all personal/LAN boxes for foreign and native installations,
and live peacefully.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Happy guixing, folks!&lt;/em&gt;&lt;/p&gt;</content></entry><entry><title>Installing Debian on a USB stick for a Terramaster NAS</title><id>https://lovergine.com/installing-debian-on-a-usb-stick-for-a-terramaster-nas.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2025-10-15T18:00:00Z</updated><link href="https://lovergine.com/installing-debian-on-a-usb-stick-for-a-terramaster-nas.html" rel="alternate" /><content type="html">&lt;p&gt;I recently bought a basic NAS for home use. The NAS is a nice &lt;a href=&quot;https://shop.terra-master.com/it-it/products/f2-425&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Terramaster
F2-425&lt;/a&gt;, which is a very
basic RAID1-only NAS with a decent CPU and 2.5Gb network. Terramaster allows
users to either use its custom Linux-based TOS or install any other operating
system supported by the x86_64-based platform. Note that this model does not
mount any NVME unit for the OS, as for the F2-424.&lt;/p&gt;&lt;p&gt;Common choices include TrueNas, Proxmox, or any other Linux-based distribution.
My choice has been a plain Debian stable distribution because I do not have
special requirements and prefer a lightweight CLI-only solution over a
dashboard. The F2-425 does not have NVME cards, only regular HDDs/SSDs.
However, when installing an independent OS, as in my case, you can immediately
use an external USB stick for the system, and dedicate HDDs to data. The unit
even has a tiny (264MB) internal USB stick for installing TOS, but I simply
used a decent 16GB SanDisk thumb drive. The clear advantage is the possibility
of having the base system and data perfectly separated, and multiple copies of
the stick for safety.&lt;/p&gt;&lt;p&gt;Of course, the installation of such a system can be done without using the
Debian installer at all, so I'm describing here how to perform such an
installation for my future reference and for other geeks. Of course, you need a
running Linux system with &lt;em&gt;debootstrap&lt;/em&gt; installed. The process involves
partitioning the stick in GPT mode, installing the base system and EFI, and
configuring the system to finalize a bootable system with the necessary
software to connect the NAS to the network, including OpenSSH.&lt;/p&gt;&lt;p&gt;Note that the 2.5 Gb Ethernet is a RealTek, so a firmware blob
(firmware-realtek package on Trixie) is required to properly work with that.
Alternatively, another of the USB ports could also be used to add a wireless
connection. The OS stick could be simply mounted on the internal port, but it
requires opening the chassis for that and using a tiny stick.&lt;/p&gt;&lt;p&gt;At power-on, the internal TOS dongle automagically boots up, so connecting an
HDMI display and a keyboard is required to change the setup to boot the Debian
EFI image on the stick. On F2-425, press the &lt;code&gt;&amp;lt;F12&amp;gt;&lt;/code&gt; key to access the AMI setup
and change boot priorities. There are always slight differences among AMI BIOS
setups, so it is required to find the right key to access settings and change
boot options.&lt;/p&gt;&lt;p&gt;Let's consider /dev/sde as the name of the USB stick device on the host where
it will be prepared. A GPT partition can be created via GNU parted, as follows:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;parted /dev/sde 	&lt;span class=&quot;syntax-comment&quot;&gt;# to create EFI and root primary partition
&lt;/span&gt;partprobe &lt;span class=&quot;syntax-attribute&quot;&gt;--summary&lt;/span&gt; /dev/sde
sfdisk &lt;span class=&quot;syntax-attribute&quot;&gt;-l&lt;/span&gt; /dev/sde
mkfs.vfat &lt;span class=&quot;syntax-attribute&quot;&gt;-F&lt;/span&gt; 32 /dev/sde1
mkswap /dev/sde2
mkfs.ext4 /dev/sde3&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Once done, installing the base system is immediate.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mount /dev/sde3 /mnt
mount /dev/sde1 /mnt/boot/efi
debootstrap trixie /mnt

mount &lt;span class=&quot;syntax-attribute&quot;&gt;-o&lt;/span&gt; bind /dev /mnt/dev
mount &lt;span class=&quot;syntax-attribute&quot;&gt;-t&lt;/span&gt; devpts devpts /mnt/dev/pts
mount &lt;span class=&quot;syntax-attribute&quot;&gt;-t&lt;/span&gt; proc proc /mnt/proc
mount &lt;span class=&quot;syntax-attribute&quot;&gt;-t&lt;/span&gt; sysfs sysfs /mnt/sys
mount &lt;span class=&quot;syntax-attribute&quot;&gt;-t&lt;/span&gt; tmpfs run /mnt/run

cp /etc/apt/sources.list.d/debian.sources /mnt/etc/apt/sources.list.d/.
cp /etc/resolv.conf /mnt/etc/.

echo &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;nas&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;&amp;gt;&lt;/span&gt; /mnt/etc/hostname
sed &lt;span class=&quot;syntax-attribute&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;syntax-attribute&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;'s/localhost$/localhost\n127.0.0.1\tnas/'&lt;/span&gt; /mnt/etc/hosts

rootfs=&lt;span class=&quot;syntax-variable&quot;&gt;$(blkid /dev/sde | grep TYPE=\&amp;quot;ext4\&amp;quot;|awk '{print $2}'|cut -d\&amp;quot; -f2)&lt;/span&gt;
vfat=&lt;span class=&quot;syntax-variable&quot;&gt;$(blkid /dev/sde|grep TYPE=\&amp;quot;vfat\&amp;quot;|awk '{print $2}'|cut -d\&amp;quot; -f2)&lt;/span&gt;
swap=&lt;span class=&quot;syntax-variable&quot;&gt;$(blkid /dev/sde|grep TYPE=\&amp;quot;swap\&amp;quot;|awk '{print $2}'|cut -d\&amp;quot; -f2)&lt;/span&gt;

cat &lt;span class=&quot;syntax-special&quot;&gt;&amp;gt;&lt;/span&gt;/mnt/etc/fstab &lt;span class=&quot;syntax-special&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;EOF
UUID=&lt;span class=&quot;syntax-variable&quot;&gt;$rootfs&lt;/span&gt; / ext4 noatime,errors=remount-ro 0 1
UUID=&lt;span class=&quot;syntax-variable&quot;&gt;$vfat&lt;/span&gt; /boot/efi vfat noatime,umask=0077 0 1
UUID=&lt;span class=&quot;syntax-variable&quot;&gt;$swap&lt;/span&gt; none swap sw 0 0
EOF

chroot /mnt
apt update
apt upgrade &lt;span class=&quot;syntax-attribute&quot;&gt;-y&lt;/span&gt;
apt install grub-efi-amd64 linux-image-amd64 ssh \
        firmware-misc-nonfree \
        firmware-realtek xfsprogs rsync pmount \
        gddrescue screen util-linux-extra bash-completion \
 	mdadm  parted smartmontools htop ntp unattended-upgrades sudo
useradd &lt;span class=&quot;syntax-attribute&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;syntax-attribute&quot;&gt;-G&lt;/span&gt; sudo &lt;span class=&quot;syntax-attribute&quot;&gt;-s&lt;/span&gt; /bin/bash &lt;span class=&quot;syntax-attribute&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;'Your Name'&lt;/span&gt; your_username 
passwd your_username
adduser your_username plugdev
apt install tzdata locales
dpkg-reconfigure locales
grub-install &lt;span class=&quot;syntax-attribute&quot;&gt;--target&lt;/span&gt;=x86_64-efi &lt;span class=&quot;syntax-attribute&quot;&gt;--force-extra-removable&lt;/span&gt; /dev/sde
update-initramfs &lt;span class=&quot;syntax-attribute&quot;&gt;-u&lt;/span&gt;
apt clean
exit &lt;span class=&quot;syntax-comment&quot;&gt;# leave the chroot
&lt;/span&gt;umount /mnt/run
umount /mnt/sys/firmware/efi/efivars
umount /mnt/sys
umount /mnt/proc
umount /mnt/dev/pts
umount /mnt/dev
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that required HDDs can be easily installed later. I manually configured
the two disks with GNU parted for a GPT Linux RAID partition.  After booting
with the stick, a simple install of the md array support suffices.  Typically,
the USB stick runs as &lt;code&gt;/dev/sdd&lt;/code&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo mdadm &lt;span class=&quot;syntax-attribute&quot;&gt;--create&lt;/span&gt; /dev/md0 &lt;span class=&quot;syntax-attribute&quot;&gt;--level&lt;/span&gt;=1 &lt;span class=&quot;syntax-attribute&quot;&gt;--raid-devices&lt;/span&gt;=2 /dev/sda1 /dev/sdb1
mkfs.xfs /dev/md0
mkdir /data
data=&lt;span class=&quot;syntax-variable&quot;&gt;$(blkid /dev/md0|grep TYPE=\&amp;quot;xfs\&amp;quot;|awk '{print $2}'|cut -d\&amp;quot; -f2)&lt;/span&gt;
echo &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;UUID=$data /data xfs defaults 1 1&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;/etc/fstab&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In order to allow shutting down by pressing the power button, it is required to
configure &lt;code&gt;systemd-logind&lt;/code&gt; as follows.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sed &lt;span class=&quot;syntax-attribute&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;syntax-attribute&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;'s/^#HandlePowerKey=poweroff/HandlePowerKey=poweroff/'&lt;/span&gt; \
       &lt;span class=&quot;syntax-attribute&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;'s/^#HandlePowerKeyLongPress=ignore/HandlePowerKeyLongPress=ignore/'&lt;/span&gt; \
    /etc/systemd/logind.conf

systemctl restart systemd-logind.service&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It could also be a good idea to stop the periodic auto-scan on the RAID volume
for big disks, which can take ages to run.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sed &lt;span class=&quot;syntax-attribute&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;syntax-attribute&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;'s/^AUTOCHECK=true/AUTOCHECK=false/'&lt;/span&gt; /etc/default/mdadm
systemctl restart mdmonitor.service&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The network configuration depends definitively on the type of connection used
and the home network setup. In my case, the NAS uses a static IPv4
address, so it can be configured through &lt;code&gt;ifupdown&lt;/code&gt;, and it is only necessary
to correctly write the &lt;code&gt;/etc/network/interfaces&lt;/code&gt; for the &lt;code&gt;enp1s0&lt;/code&gt; Realtek 2.5Gb
Ethernet interface. Not that it requires a non-free firmware blob to run.&lt;/p&gt;&lt;p&gt;After the initial syncing, a series of software to better manage the NAS can be
installed, but that is optional and can be the subject of a different post. For
sure, for better convenience, a copy of the USB stick with the complete
configuration is a good idea, to allow a fast recovery in case of failures.&lt;/p&gt;</content></entry><entry><title>Sharing configurations and data among multiple boxes</title><id>https://lovergine.com/sharing-configurations-and-data-among-multiple-boxes.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2025-05-04T23:00:00Z</updated><link href="https://lovergine.com/sharing-configurations-and-data-among-multiple-boxes.html" rel="alternate" /><content type="html">&lt;p&gt;Following a &lt;a href=&quot;https://lovergine.com/my-geeky-email-setup-explained-to-humans.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;post detailing my email setup&lt;/a&gt;
across multiple personal boxes,
I'll summarize an outline of my approach for managing data across multiple
workstations and individual profiles in this post. This system (or collection of
tools and workflow) has evolved over time and continues to adapt to various
needs and scenarios, offering high flexibility and control for my use cases.&lt;/p&gt;&lt;p&gt;First of all, it is mandatory to use &lt;a href=&quot;https://git-scm.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;git&lt;/a&gt; to manage multiple
configurations
with branches for almost every box or family of boxes (e.g., home vs. work,
personal vs. shared). Some people tend to use git for the whole home, but in my
honest opinion, it is inappropriate for performance reasons, even if Joeyh's
&lt;a href=&quot;https://git-annex.branchable.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;git-annex&lt;/a&gt;
and LFS mode are helpful in those regards. In many cases, it is
not required to version all data files, and even if this time-machine-like
solution is considered the ideal one for user's homes, it could negatively
impact storage requirements and long-term performances. Also, having a mono-repo
for all your own stuff could be challenging. In my case, I deal with multiple
private and public Git repositories, including GitHub, Gitlab, and others all
around, and maintaining a single repo is not a good idea for me.&lt;/p&gt;&lt;p&gt;The good news is that it is generally possible to limit the use of git to a
subset of the whole home, specifically the dotfiles used to configure common
tools and programs, a helpful set of scripts for personal use, and a few other
sparse things. In many cases, some useful scripts to synchronize and update
everything is more than enough. Part of my automation workflow is based on
Ansible rules, so the whole thing is easily integrated into such management.&lt;/p&gt;&lt;p&gt;It's important to note that I strongly advise against using git for sensitive
information, such as credentials and keys. Even with a personal git server,
copying such information via directly attached media storage is safer, ensuring
they are not exposed on a permanently internet-connected repository. For such
cases, specific solutions like Vault/OpenBao could provide an extra layer of
security for workgroups, giving you peace of mind and confidence in the
system's security measures. That said, the whole topic of the management of
passwords, credentials, and other private information would require another
post for completeness because it is not straightforward when privacy and
security need to be fully conjugated with long-term goals.&lt;/p&gt;&lt;h2 id=&quot;dot-files-and-other-stuff-maintenance&quot;&gt;Dot files and other stuff maintenance&lt;/h2&gt;&lt;p&gt;That said, I currently use at least a couple of different git repositories, one
for my dotfiles and one for helpful scripts for personal productivity. These
repositories are branched, at least in home/office flavors, and based on
multiple languages, including shell, Perl, Python, awk, and others.&lt;/p&gt;&lt;p&gt;I found it helpful to clone such repositories immediately, install them via the
GNU &lt;a href=&quot;https://www.gnu.org/software/stow/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;stow&lt;/a&gt; utility, and install pure symlinks under my &lt;em&gt;$HOME&lt;/em&gt; and personal
&lt;em&gt;binaries&lt;/em&gt; directories. However, for some specific cases (notably the Vim
stuff), I prefer maintaining a separate git repository that I update separately:
this is partially for historical reasons, but even because, in some cases, the
whole stuff is a fork of other repositories.&lt;/p&gt;&lt;p&gt;In the past, I adopted a &lt;em&gt;bare&lt;/em&gt; repository for dotfiles and a custom git call to
maintain all dotfiles directly in place instead of symlinking them, which is a
slightly different approach. Something like the following snippet of shell code:&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;    $ echo &lt;span class=&quot;syntax-string&quot;&gt;'alias dotfiles=&amp;quot;/usr/bin/git \
         --git-dir=$HOME/.dotfiles.git/ \
         --work-tree=$HOME&amp;quot;'&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;syntax-variable&quot;&gt;$HOME&lt;/span&gt;/.bashrc
    $ source &lt;span class=&quot;syntax-variable&quot;&gt;$HOME&lt;/span&gt;/.bashrc
    $ echo &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;.dotfiles.git&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; .gitignore
    $ git clone &lt;span class=&quot;syntax-attribute&quot;&gt;--bare&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;&amp;lt;&lt;/span&gt;my_git_host&lt;span class=&quot;syntax-special&quot;&gt;&amp;gt;&lt;/span&gt;:/opt/git/dotfiles.git \
            &lt;span class=&quot;syntax-variable&quot;&gt;$HOME&lt;/span&gt;/.dotfiles.git
    &lt;span class=&quot;syntax-comment&quot;&gt;#
&lt;/span&gt;    &lt;span class=&quot;syntax-comment&quot;&gt;# clean up current dotfiles (with directories) 
&lt;/span&gt;    &lt;span class=&quot;syntax-comment&quot;&gt;# available in the common repository and backup
&lt;/span&gt;    &lt;span class=&quot;syntax-comment&quot;&gt;#
&lt;/span&gt;    $ mkdir &lt;span class=&quot;syntax-attribute&quot;&gt;-p&lt;/span&gt; .dotfiles-backup &lt;span class=&quot;syntax-special&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; \
    	  dotfiles checkout &lt;span class=&quot;syntax-special&quot;&gt;2&amp;gt;&amp;amp;1&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; egrep &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;\s+\.&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; awk {&lt;span class=&quot;syntax-string&quot;&gt;'print $1'&lt;/span&gt;} &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; \
    	  xargs &lt;span class=&quot;syntax-attribute&quot;&gt;-I&lt;/span&gt;{} dirname {} &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; sort &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; uniq &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; xargs &lt;span class=&quot;syntax-attribute&quot;&gt;-I&lt;/span&gt;{} mkdir &lt;span class=&quot;syntax-attribute&quot;&gt;--parents&lt;/span&gt; \
          .dotfiles-backup/{} &lt;span class=&quot;syntax-special&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; dotfiles checkout &lt;span class=&quot;syntax-special&quot;&gt;2&amp;gt;&amp;amp;1&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; \
          egrep &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;\s+\.&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt; awk {&lt;span class=&quot;syntax-string&quot;&gt;'print $1'&lt;/span&gt;} &lt;span class=&quot;syntax-special&quot;&gt;|&lt;/span&gt;  \
  		  xargs &lt;span class=&quot;syntax-attribute&quot;&gt;-I&lt;/span&gt;{} mv {} .dotfiles-backup/{}
    $ dotfiles checkout
    $ dotfiles config &lt;span class=&quot;syntax-attribute&quot;&gt;--local&lt;/span&gt; status.showUntrackedFiles no&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;can be used with a proper alias to maintain all registered dotfiles in each
box's HOME. Of course, the previous stow-based approach is much more immediate.&lt;/p&gt;&lt;h2 id=&quot;gnome-configuration&quot;&gt;Gnome configuration&lt;/h2&gt;&lt;p&gt;My dotfiles repository does not include the main desktop configuration,
specifically my Gnome settings, including the few extensions I use. Not all my
personal boxes include a desktop, but it is much more immediate to maintain a
single dump of a finalized configuration based on the main Gnome version in use
instead of branching and following its internals properly (which can largely
change from one version to another).&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;    $ dconf dump / &lt;span class=&quot;syntax-special&quot;&gt;&amp;gt;&lt;/span&gt;gnome-settings.dump 	&lt;span class=&quot;syntax-comment&quot;&gt;# on the source workstation
&lt;/span&gt;    $ tar czvf gnome-shell.tgz .local/share/gnome-shell

    $ dconf load / &lt;span class=&quot;syntax-special&quot;&gt;&amp;lt;&lt;/span&gt;gnome-settings.dump 	&lt;span class=&quot;syntax-comment&quot;&gt;# on the target workstation
&lt;/span&gt;    $ tar xvf gnome-shell.tgz&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;data-syncing-and-backups&quot;&gt;Data syncing and backups&lt;/h2&gt;&lt;p&gt;While code and configurations are better managed via git, I also deal with many
generic data files (up to dozens of GBs per file or more) and documents that I
synchronize automatically or on demand. Two tools I use intensively —
&lt;a href=&quot;https://syncthing.net/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;syncthing&lt;/a&gt;
and &lt;a href=&quot;https://www.cis.upenn.edu/~bcpierce/unison/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;unison&lt;/a&gt; — can cover both goals.
They require at least one &lt;em&gt;master&lt;/em&gt; copy to be
reachable, and having one master host per site is the best idea.&lt;/p&gt;&lt;p&gt;Finally, my primary backup tool for years has been the venerable
&lt;a href=&quot;https://www.borgbackup.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;borg&lt;/a&gt; tool,
which allows planning incremental backups and rotation plans of master hosts. At
least one encrypted backup is stored on an external cloud for convenience. This
is an aspect where I'm still looking for a definitive solution far from the
usual big companies for personal stuff (a fight lost at work, unfortunately),
specifically for what is attaining the mobile ecosystem and family. That's
because, but for strictly FOSS requirements, I'm also interested only in a
self-hosted, long-term, and stable solution that I could directly maintain for a
lifetime. Currently, I'm simply using &lt;a href=&quot;https://rclone.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;rclone&lt;/a&gt;
to sync third-party cloud storage
when required.  Of course, the &lt;a href=&quot;https://en.wikipedia.org/wiki/Backup&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;3-2-1 rule for backup&lt;/a&gt;
is fully respected, thanks
to the use of multiple sites and devices, even without using cloud providers,
but I would prefer taking in the loop additional encrypted copies of some stuff
(mainly videos and photos) even for sharing with others.&lt;/p&gt;</content></entry><entry><title>My geeky email setup explained to humans</title><id>https://lovergine.com/my-geeky-email-setup-explained-to-humans.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2025-02-16T11:00:00Z</updated><link href="https://lovergine.com/my-geeky-email-setup-explained-to-humans.html" rel="alternate" /><content type="html">&lt;p&gt;Being an &lt;a href=&quot;https://en.wikipedia.org/wiki/The_Rime_of_the_Ancient_Mariner&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;ancient
mariner&lt;/a&gt; in the
virtual ocean of the Big Network, I started using emails at the very beginning
of the Internet era (at least here in Italy) on a
&lt;a href=&quot;https://blog.pizzabox.computer/pizzaboxes/sparcstation/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;SunOS pizza box&lt;/a&gt;,
which I used at the time as my primary workstation. That was a giant step ahead
for me because my first serious use of email in 1991 was on a Digital VT220
terminal under VMS OS and its MAIL client (who remembers the old times of DCL?).
At that time, I started using Elm as my Mail User Agent, a software that stopped
being developed in the first few years of this millennium.&lt;/p&gt;&lt;p&gt;In 1995, a new attractive MUA started to be developed, and it fascinated my geek
inclination: as any smart enough reader can well imagine, it was
&lt;a href=&quot;https://www.mutt.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mutt&lt;/a&gt;, and as anyone knows, it still &lt;em&gt;sucks less&lt;/em&gt; as a
MUA, and it is nonetheless being developed after almost thirty years. Nowadays,
colleagues and friends are always perplexed when they see me still reading and
answering emails on a terminal in text mode, but I never found serious
motivation to change my email workflow and prefer a graphical MUA instead. I
occasionally use a smartphone with K-Mail (now Thunderbird), but I like reading
and writing emails on one of my GNU/Linux PCs.&lt;/p&gt;&lt;p&gt;First of all, my mailboxes are read by or received in a single box (let's call
it &lt;a href=&quot;https://en.wikipedia.org/wiki/The_Collector&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;the Collector&lt;/a&gt;, with
appropriate local backup), permanently connected to the network. It also
provides SMTP/IMAP services and a last-resort spam filtering capability, thanks
to Spamassassin+Razor and Procmail rules. Mailboxes are provided by third-party
services, including (but not exclusively) a series of GMail and MS accounts, and
that box is able to communicate with each of them to regularly read new
messages, thanks to Fetchmail.  Any of my PCs can then connect with the
Collector to read remotely archived emails via IMAP and send answers and new
messages through any of the legitimate SMTP servers associated with each email
account I use: that is because of the SPF/DKIM specs used for all email boxes
nowadays.&lt;/p&gt;&lt;p&gt;The Collector archives and rotates multiple mailboxes monthly and yearly,
including the main one, where all urgencies are automatically routed when they
arrive. I use multiple email accounts for mailing list subscriptions, so many
messages are automatically routed off the main track on purpose. For ages, many
bad MUAs out there only send HTML emails, so I occasionally use some graphical
helper to browse some of them. The result is a long period archive of emails
over the last 30 years that I occasionally purge of the mailing list messages to
reduce the storage load. Eventually, I use &lt;code&gt;Notmuch&lt;/code&gt; to dive into tons of
Maildir mailboxes accumulated on the Collector, and that is more than enough
because an ancient message is rarely required in my experience.&lt;/p&gt;&lt;p&gt;Thirty years of using &lt;code&gt;Fetchmail&lt;/code&gt;, &lt;code&gt;Procmail&lt;/code&gt;, &lt;code&gt;Dovecot&lt;/code&gt;, &lt;code&gt;Exim&lt;/code&gt;, and &lt;code&gt;Mutt&lt;/code&gt;
seem more than enough to explore new ways of managing emails, but my laziness
prevents me from keeping an eye on my second choice, which would be Emacs with
mu4e and &lt;code&gt;offlineimap&lt;/code&gt; or &lt;code&gt;sync&lt;/code&gt; to read emails in disconnected mode when
required. Note that &lt;code&gt;Mutt&lt;/code&gt; has caching capability, so the initial load of the
mailboxes is a fast enough experience.&lt;/p&gt;&lt;p&gt;Finally, I found it helpful in my setup to use other interesting tools, such as
&lt;code&gt;lbdb,&lt;/code&gt; to collect senders' addresses automatically and have them at my
fingertips. Recently, the Collector and all clients started using Simon
Robinson's nice &lt;code&gt;email-oauth2-proxy&lt;/code&gt; as an intermediate service to access
2FA-enabled email accounts, a reasonable complication of the original setup.&lt;/p&gt;&lt;p&gt;That said, any sane geek should rigorously use a personal domain and email
account to avoid being locked in the use of a third-party domain and storage
limitations: there is nothing worse than having to change tons of personal
contact emails registered in dozens of services because of the dropping of
someone else domain (or even worse, being exposed to their changes in policies,
features, and limitations). That has been my way in the last 30 years or so.
For the same reason, using any webmail system to manage emails is neither
practical nor scalable.&lt;/p&gt;&lt;p&gt;Yes, I know, I'm a damn old fashioned geek, but &lt;em&gt;this is the Way.&lt;/em&gt;&lt;/p&gt;</content></entry></feed>