<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xhtml="http://www.w3.org/1999/xhtml"><title>defanor's notes</title><link rel="self" href="https://thunix.net/~defanor/notes/atom.xml"/><link rel="alternate" href="https://thunix.net/~defanor/notes/"/><id>https://thunix.net/~defanor/notes/</id><updated>2018-05-01T01:00:00Z</updated>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/personal-data-storage.html"/><id>https://thunix.net/~defanor/notes/personal-data-storage.html</id><author><name>defanor</name></author><title>Personal data storage</title><summary>Storage and backup notes</summary><published>2021-03-23T12:00:00Z</published><updated>2026-05-01T17:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Personal data storage</h1><p>
      These are my data storage notes, targeting primarily personal
      data backups: regular files (documents, photo and music
      collections, not databases), moderate volume, added or edited
      rarely, backups are managed manually.
    </p><h2>General approach</h2><p>
      The "3-2-1 rule" for backups suggests to keep at least 3 copies
      of data, on at least 2 different storage devices, with at least
      one copy off-site.
    </p><p>
      The exact requirements and methods to achieve those may depend
      on one's threat model: in addition to device failures, bit rot,
      and unauthorized access by scrapers, one may have to consider
      fire or flooding, burglaries and robberies, book burning
      campaigns and censorship with isolation, hardware seizures and
      imprisonment without ability to maintain the remaining backups
      for years, inability--or a limited ability--to acquire
      replacement storage devices, and even uncommon and hypothetical
      scenarios, such as a global high energy EMP.
    </p><p>
      Considering the information security "CIA" triad
      (confidentiality, integrity, availability), we need encryption,
      so that lost or decommissioned drives will not leak personal
      data (i.e., <a href="https://en.wikipedia.org/wiki/Crypto-shredding">crypto-shredding</a> can be employed); integrity
      checking, so that we will either read back the data that was
      written or detect <a href="https://en.wikipedia.org/wiki/Data_corruption">data corruption</a> (and preferably even repair
      it); varied and common technologies (hardware interfaces,
      drivers, filesystems, file formats), so that there will be a
      good chance that at least some of the backups can be accessed
      with reasonable effort in different situations in the future.
    </p><p>
      Most of the technologies covered here are usable for both
      backups and working storage. I prefer to use more general tools,
      since they tend to be better maintained, and learning them
      usually is a more useful time investment than learning
      specialized backup systems (but for those, see Bacula, Borg,
      restic, DAR), some of which are quite similar to actual file
      systems (e.g., Borg is), while apparently often lacking error
      correction codes and redundancy within a single repository, but
      those may still be suitable for the task. Fortunately in this
      case the variety is preferable, and one can combine those. See
      also: <a href="https://www.debian.org/doc/manuals/debian-reference/ch10.en.html#_backup_and_recovery">Debian Reference Manual - 10. Backup and
      recovery</a>, <a href="https://wiki.debian.org/BackupAndRecovery">BackupAndRecovery - Debian Wiki</a>, <a href="https://wiki.archlinux.org/title/Synchronization_and_backup_programs">Synchronization and
      backup programs - ArchWiki</a>.
    </p><p>
      As for portability, judging by experimentation in 2024, Android
      (as on Google Pixel phones) and Windows only support single
      (Ex)FAT partitions on USB drives, and probably only with MBR or
      without a partition table; no LUKS or filesystems such as Btrfs
      and ext4. So having to give up on compatibility with those for
      my regular backups, though when used for data transfer or
      unavoidable otherwise, one can use VeraCrypt (open-source, but
      not always considered FLOSS, for Windows, also supported for
      opening by cryptsetup, but creation would require additional
      tools: e.g., VeraCrypt itself or zuluCrypt) and
      exFAT. The <code>/\:*?"&lt;&gt;|</code> characters must be avoided
      in file names to stay compatible with exFAT.
    </p><h2>Hardware</h2><p>
      Reliable <a href="computer-hardware.html">computer hardware</a> is desirable to minimize errors and
      hardware failures: an UPS, ECC memory, and quality hardware
      (including storage) in general.
    </p><p>
      External HDDs (or combinations of internal ones and external
      boxes) are inexpensive and handy for local backups, allowing to
      keep them safely disconnected most of the time, and to easily
      plug into virtually any computer when needed.
    </p><p>
      USB flash drives seem more suitable for off-site backups, being
      more robust for physical transfer. Flash memory is not suited
      for a long-term storage without power though, so it is suggested
      to have them powered up at least for a few hours per year,
      letting the controllers to do maintenance, or even do data
      scrubbing (via a filesystem, if it supports that, or simply by
      forcing reading of all the files, possibly by verifying
      checksums) to nudge the rewrites. Writing onto cheap Kingston
      USB thumb drives (e.g., 256 GB DT Exodia) can be very slow,
      especially once about 2/3 of space is used and with ext4 on top
      of LUKS: writing at about 200 KB/s (less than 1 GB per
      hour). Even if you are not in a hurry, it makes one to wonder
      whether the device malfunctions, so perhaps it is better to not
      neglect the write speed completely, even for backup storage
      devices. I saw Apacer USB flash drives of the same capacity,
      which are even cheaper, having sustained write speeds of about
      10 MB/s, at least with exFAT.
    </p><p>
      Having an erratic USB port, bus, or wires (built into a
      Thermaltake chassis) that occasionally disconnects devices
      during active writing, I had a Transcend JetFlash (64 GB) thumb
      drive apparently dying (hanging on any writing attempt, "Device
      not responding to setup address.") after such a disconnect,
      while Kingston ones survived a few of those. As a side note,
      this seems more hazardous than non-ECC memory.
    </p><p>
      Optical drives (CD, DVD, Blu-ray) are commonly suggested for
      archieval, though they seem less convenient for updates and for
      usage in general, and it is not quite clear whether the
      recordable ("burned" with a laser and a dye, as opposed to being
      stamped at a factory) CDs and DVDs are that long-lasting, but
      apparently they are still quite durable (see <a href="https://blog.dshr.org/2024/08/2024-optical-media-durability-update.html">2024 Optical Media
      Durability Update</a>). And some aim archival storage
      explicitly (e.g., <a href="https://en.wikipedia.org/wiki/M-DISC">M-DISC</a>, mostly with BD).
    </p><p>
      Paper backups may be useful as well, and quite reliable,
      particularly for texts and images. <a href="https://en.wikipedia.org/wiki/Acid-free_paper">Acid-free paper</a> should be
      used for those, and one may play with bookbinding then. Some use
      QR codes and other two-dimensional barcodes to store arbitrary
      digital data on paper. Out of hardware, one would need a printer
      and a scanner for those, though I should investigate that
      better. To combine human-readability with relative
      machine-readability, special fonts like <a href="https://en.wikipedia.org/wiki/OCR-A">OCR-A</a> and <a href="https://en.wikipedia.org/wiki/OCR-B">OCR-B</a> can be
      useful, possibly combined with error correction codes.
    </p><p>
      One may also consider keeping backup storage devices and related
      items in a specialized storage shelf, a Faraday cage, or a
      fire-resistant and/or waterproof safe.
    </p><p>
      To go further than that, including storage of physical items,
      one may also look into general archieval- and collection-related
      materials, such as the <a href="https://psap.library.illinois.edu/">Preservation Self-Assessment Program</a>.
    </p><h2>Backup operating system</h2><p>
      I find it useful (for the peace of mind, at least) to set a
      bootable operating system on at least one of the backup drives,
      with all the necessary software to read the backups. So there
      usually is EFI system partition (ESP), an unencrypted partition
      for <code>/boot</code> (GRUB2 can handle encrypted ones, but it
      would not make much difference), an encrypted partition for the
      rest of the system (to prevent possible data leaks via cache,
      for instance, after backups are accessed from it), and a
      separate encrypted partition for the backup itself.
    </p><p>
      When installing a system using an installer, on a machine with more than
      one disk and some existing systems present, the installer would often use
      a seemingly random ESP on one of the internal disks, instead of the one on
      the backup drive. Fixing it may involve booting via the GRUB shell after
      GRUB fails to find or access its config from the
      <code>/boot</code> partition, remounting (and fixing in
      <code>/etc/fstab</code>) <code>/boot/efi/</code>, to point to the correct
      drive's ESP, and then running <code>grub-install</code> to install it
      there. Also removing undesirable directories from ESP manually, and
      adjusting things with <code>efibootmgr</code>. Or one can opt for a more
      involved/manual installation, setting it properly at once: see, for
      instance, "<a href="https://www.debian.org/releases/stable/amd64/apds03.en.html">Installing Debian GNU/Linux from a Unix/Linux System</a>" and
      "<a href="https://cryptsetup-team.pages.debian.net/cryptsetup/encrypted-boot.html">Full
      disk encryption, including /boot: Unlocking LUKS devices from GRUB</a>".
    </p><p>
      Alternatively, or additionally, one may set a personalized live
      system image, as described in the <a href="https://live-team.pages.debian.net/live-manual/html/live-manual/index.en.html">Debian Live Manual</a> and similar
      documents for other systems.
    </p><h2>Storage setups</h2><p>
      I do partitioning with <code>fdisk</code>, mostly because other
      common tools (or at least their fancy user interfaces) tend to
      be buggy, and/or to hide technical information, neither of which
      is desirable when partitioning storage
      devices. <code>fdisk</code> is nice, commonly available, and
      works well. With the setups described below, it works to set
      LUKS or an encrypted filesystems directly on a block device,
      without any partitioning, but it may also be desirable to store
      some public data backups on a separate partition of the same
      storage device, unencrypted.
    </p><p>
      RAID 1 (or possibly 5, 6) is nice to set if there are spare
      disks, but usually not as critical for redundant personal
      backups as it is, for instance, for a production server.
    </p><p>
      As of 2021 and for Linux-based systems, some of the common
      software options are:
    </p><ul>
      <li>
        <a href="https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup">LUKS</a> and friends: <a href="https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)">LVM</a> or mdadm (software RAID),
        cryptsetup/dm-crypt (encryption), integritysetup/dm-integrity
        (integrity)
      </li>
      <li>
        ZFS (software RAID, encryption, integrity, added redundancy)
      </li>
      <li>
        Btrfs (software RAID, integrity, added redundancy)
      </li>
      <li>
        Regular checksums, such as <code>sha256sum</code> (integrity)
      </li>
    </ul><p>
      Those can be combined, even the ones serving the same purpose:
      for instance, storing file checksums would not harm even if the
      underlying filesystem supports those already. Likewise, it
      should not harm to encrypt the more important files
      (cryptographic keys, passwords), even while storing those on
      encrypted disks.
    </p><p>
      Below are notes and command cheatsheets for the setups I use.
    </p><h3>LUKS and ext4</h3><p>
      This is probably the most basic and widely supported setup for
      Linux-based systems. Only authenticated integrity checks are
      supported by cryptsetup (and those are experimental), so no CRC
      and no recovery from minor errors without RAID. Perhaps
      dm-integrity can be set separately to use CRC32C, but that would
      complicate the setup. Or it can be skipped altogether, since
      integrity checking is experimental, and wiping can slow down the
      process considerably (while skipping the wiping easily leads to
      errors).
    </p><p>
      Initial setup:
    </p><pre># Optionally, add: --type luks2 --integrity hmac-sha256
cryptsetup luksFormat /dev/sdXY
cryptsetup open /dev/sdXY backup2
mkfs.ext4 /dev/mapper/backup2
cryptsetup close backup2
mkdir /var/lib/backup2</pre><p>
      A typical session (CLI-based, though this is also handled by
      graphical file managers, such as Thunar):
    </p><pre>cryptsetup open /dev/sdXY backup2
mount -t ext4 /dev/mapper/backup2 /var/lib/backup2/
# synchronize backups
umount /var/lib/backup2/
cryptsetup close backup2</pre><p>
      When done, in order to safely eject a device, run <code>eject
      /dev/sdX</code>, or possibly <code>udisksctl power-off -b
      /dev/sdX</code>.
    </p><p>
      To change a passphrase, <code>cryptsetup luksChangeKey
      /dev/sdXY</code>.
    </p><p>
      For RAID with mdadm, see "<a href="https://gist.github.com/MawKKe/caa2bbf7edcc072129d73b61ae7815fb">dm-crypt + dm-integrity + dm-raid = awesome!</a>".
    </p><h3>ZFS</h3><p>
      ZFS is not modular like LUKS and friends, there are license
      compatibility issues, and it is rather unusual overall, but
      apparently a good filesystem containing all the features needed
      here.
    </p><p>
      Initial setup:
    </p><pre># Ensure that linux headers are installed, needed for zfs-dkms
apt install linux-headers-amd64
# Install zfsutils-linux (from "contrib" repositories)
apt install zfsutils-linux
# Find a partition ID
ls -l /dev/disk/by-id/ | grep sda4
# Use that ID to create a single-device pool. The "mirror" keyword
# should be added to set RAID 1.
zpool create tank usb-WD_Elements_...-part4
# Create an encrypted file system.
mkdir /var/lib/backup/
# For redundancy within a dataset, add to the command below: -o copies=2
zfs create -o encryption=on -o keyformat=passphrase -o mountpoint=/var/lib/backup tank/backup</pre><p>
      ZFS comes with its own mounting and unmounting commands, and if
      it is to be used from different systems, the pools should be
      exported and imported (or just force-imported). A typical
      session, assuming that it is used from different systems:
    </p><pre># List pools available for import
zpool import
# Import the pool
zpool import tank
# Mount an encrypted file system
zfs mount -l tank/backup
# (Synchronize backups here)
# Unmount the file system (or it will happen on export)
zfs unmount tank/backup
# Unmount the pool (also unnecessary to do manually though)
zfs unmount tank
# Export the pool
zpool export tank
# And eject or udisksctl power-off -b, as mentioned above</pre><p>
      To change a passphrase, <code>zfs change-key tank/backup</code>.
    </p><h3>LUKS with Btrfs</h3><p>
      This one is set with the DUP profile for both metadata and data,
      adding redundancy, and with sha256 checksums (instead of the
      default crc32c), to reduce chances of collisions.
    </p><p>
      Initial setup:
    </p><pre># LUKS, as with ext4
cryptsetup luksFormat /dev/sdXY
cryptsetup open /dev/sdXY backup
# The file system
mkfs.btrfs --csum sha256 -m dup -d dup -L backup /dev/mapper/backup
cryptsetup close backup
mkdir /mnt/backup</pre><p>A session:</p><pre>cryptsetup open /dev/sdXY backup
mount -t btrfs /dev/mapper/backup /mnt/backup/
# synchronize backups here
umount /mnt/backup/
cryptsetup close backup
eject /dev/sdX
udisksctl power-off -b /dev/sda</pre><h2>Bit rot</h2><p>
      As mentioned above, it is important to be able to detect errors
      with some integrity checks, but one may also aim single-device
      redundancy for a recovery using that single device (and a better
      overall chance of successful data recovery), as well as
      calculate checksums on top of a filesystem (e.g., for ext4,
      which does not support those on its own).
    </p><p>
      For integrity checking with basic checksums, one can
      use <code>find</code> and <code>sha256sum</code> or similar
      tools:
    </p><pre># Store checksums
mkdir checksums
find . -type f ! -path './checksums*' -exec sha256sum {} \; \
  &gt; checksums/sha256
# Check them
sha256sum --quiet --check checksums/sha256
# Add new ones
find . -type f -newer checksums/sha256 ! -path './checksums*' \
  -exec sha256sum {} \; &gt;&gt; checksums/sha256</pre><p>Alternatively:</p><pre># Store (new) checksums
mkdir -p checksums
find . -type f ! -path './checksums*' -exec sha256sum {} \; \
  &gt; checksums/$(date -I).sha256
# Compare them to old ones
diff -U 0 &lt;(sort checksums/2026-01-12.sha256) \
  &lt;(sort checksums/2026-01-23.sha256) | less</pre><p>
      For redundant error correction codes (forward error correction,
      FEC), with ability to repair, one may employ <code>par2</code>,
      <code>dvdisaster</code> (aiming optical discs),
      <code>zfec</code> (a library with Python, C, Haskell APIs),
      libfec (a C library), GNU Radio FEC API, though those may be
      quite inefficient to use for collections of files that are
      updated. There are projects like blockyarchive (blkar), but just
      as specialized backup systems, they tend to require specialized
      tools to access the files backed up with them at all. A software
      RAID (1, 5, or 6) set on different partitions of the same device
      is a more time-efficient way to achieve some redandancy within a
      storage device, though less space-efficient, and protecting
      against different bit rot patterns. ZFS's "copies" parameter and
      Btrfs's DUP profile (for both data and metadata) do something
      similar, storing multiple copies of blocks within a dataset.
    </p><h2>Other useful tools</h2><p>
      <a href="https://en.wikipedia.org/wiki/S.M.A.R.T.">S.M.A.R.T.</a> monitoring and testing can be done with
      smartmontools, and usually supported even by external and older
      USB drives.
    </p><p>
      I normally use just <code>rsync --archive</code> for the initial
      backup, then <code>rsync --exclude='lost+found' --archive
      --verbose --checksum --dry-run --delete</code> to compare
      backups and for data scrubbing, and
      without <code>--dry-run</code> afterwards, if everything looks
      fine. Using <code>-rt</code> or <code>-r</code> instead
      of <code>-a</code> may be preferable sometimes though, if file
      permissions and ownership data are not to be preserved.
    </p><p>
      For <a href="https://en.wikipedia.org/wiki/Data_erasure">data erasure</a>, <code>dd</code> is handy for wiping both disks
      and partitions (before decommissioning drives, or if there were
      unencrypted partitions before), e.g.:
    </p><pre>dd status=progress if=/dev/urandom of=/dev/sdX bs=1M
dd status=progress if=/dev/urandom of=/dev/sdXY bs=1M</pre><p>
      GnuPG is there for individual file encryption, as well as for
      signing. In some cases it may be useful together with tar and
      gzip.
    </p><p>
      For more compact music backups, one may wish to backup just the
      files referenced from a playlist, and not the whole archive. An
      example command for counting the total size of files involved in
      a playlist:
    </p><pre>xmllint --xpath '//*[local-name()="location"]/text()' music.xspf |
  sed -E 's/&amp;amp;/\&amp;/g' |
  tr '\n' '\0' |
  du -s --files0-from=- |
  awk '{ sum += $1 } END { print sum }'</pre><p>
      While rsync has the <code>--files-from</code> option, to work
      with a given list of files only:
    </p><pre>xmllint --xpath '//*[local-name()="location"]/text()' music.xspf |
  sed -E 's/&amp;amp;/\&amp;/g' |
  rsync --dry-run -avz --files-from=- . ~/mnt/</pre><h2>Public data backups</h2><p>
      Public data may be useful to backup as well: its regular sources
      may be (and are, here) censored/blocked by a government, or
      simply become unavailable because of a technical issue (along
      with the rest of the Internet if the issue is near the user). In
      that case, the focus should be on high availability, probably
      along with integrity, while confidentiality matters less, unless
      there is a risk of those materials being outlawed.
    </p><p>
      As for the data to backup (and later read) this way, <a href="https://www.kiwix.org/en/">Kiwix</a> (with
      its <a href="https://github.com/openzim/">OpenZIM</a> archives) is a nice project. Its primary viewer may
      seem awkward for use in normal circumstances, but apparently it
      aims to be useful to general public and in bad circumstances: it
      provides archives as packages, while the viewer—with versions
      for every common OS—can also serve those to others in a local
      network via a web browser. <a href="https://library.kiwix.org/">library.kiwix.org</a> provides, among
      others, indexed archives of Project Gutenberg (about 75,000
      public domain books by 2026), Wikipedia, Wikisource, Wikibooks,
      Wikiversity, Wiktionary, ready.gov, WikiHow, various
      StackExchange projects, Khan Academy, and many smaller bits like
      ArchWiki, RationalWiki, Explain XKCD (contains the
      comics). <a href="http://www.textfiles.com/">textfiles.com</a> provides archives of files grouped by
      category, which are well-compressed, curious, and
      entertaining. <a href="https://www.rfc-editor.org/retrieve/bulk/">RFC Editor bulk retrieval</a> is both useful and
      particularly nice: available in different formats, as either a
      whole archive, partial archives, or via rsync. The POSIX (SUS)
      specification is useful to have at hand: <a href="https://pubs.opengroup.org/onlinepubs/9799919799/">POSIX.1-2024</a> is
      available as an archive (see "Downloads"). Along those lines,
      there are programming language specifications (reports), and
      other relevant specifications and references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/standards">ISO C</a>, <a href="https://www.haskell.org/documentation/">Haskell
      Language Report</a>, <a href="http://www.scheme-reports.org/">Scheme Reports</a>, <a href="https://docs.python.org/3/download.html">Python documentation
      downloads</a>, <a href="https://riscv.org/specifications/ratified/">RISC-V specification</a>, <a href="https://software.intel.com/en-us/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-1-2a-2b-2c-2d-3a-3b-3c-3d-and-4">Intel 64 and IA-32
      Architectures Software Developer's Manual</a>, <a href="https://docs.amd.com/v/u/en-US/40332-PUB_4.08">AMD64 Architecture
      Programmer's Manual</a>, <a href="https://refspecs.linuxfoundation.org/index.shtml">Linux Foundation Referenced
      Specifications</a>, <a href="https://www.usb.org/documents">USB specifications</a>, <a href="https://www.bluetooth.com/specifications/specs/">Bluetooth
      specifications</a>, <a href="https://uefi.org/specifications">ACPI
      and UEFI specifications</a>, <a href="https://www.postgresql.org/docs/">PostgreSQL manual</a>, <a href="https://github.com/xsf/xeps/">XMPP Extension
      Protocols</a>, etc. As of 2026, those would take just 400 to 500 GB,
      even with images and some non-English versions added. While much
      of programming documentation, particularly manuals, library
      references, and sources, is available from system repositories;
      more on operating system mirroring below.
    </p><p>
      Other large and legal archives to consider for backing
      up: <a href="https://dumps.wikimedia.org/">Wikimedia Downloads</a>, <a href="https://planet.openstreetmap.org/">Complete OSM Data</a>, maybe software
      archives (such as Linux distributions and their sources), <a href="https://arxiv.org/help/bulk_data">arXiv</a>
      and other Open Access sources. If one gets into tape
      storage, <a href="https://commoncrawl.org/">Common Crawl</a> can be considered. For select website
      downloads, I use <code>wget --mirror --page-requisites
      --convert-links --no-parent --continue --adjust-extension
      https://example.com/~foo/</code>, occasionally adding something
      like <code>--exclude-directories=photos,pictures</code> or just
      listing URLs manually (since it can be hard to separate heavy
      bits of little interest from the others otherwise), and
      sometimes having to add <code>--compression=gzip</code> if wget
      gets confused otherwise, or <code>--max-redirect=0</code> if
      there are redirects to semi-blocked websites with freezing
      connections (and while trying to download those directly, given
      that wget does not support SOCKS proxies). But some websites
      make archives available (as mine does,
      see <a href="../files/archive.tgz">../files/archive.tgz</a>), or they are hosted at
      GitHub/Codeberg/Tilde/etc "pages", making the archive available
      for download (also as mine does,
      see <a href="https://codeberg.org/defanor/pages">codeberg.org/defanor/pages</a>). Some wiki-based websites also
      provide data dumps, static HTML or database ones.
    </p><p>
      Then there are copyright-infringing but much larger libraries
      like <a href="https://en.wikipedia.org/wiki/Library_Genesis">Library Genesis</a> (a trimmed down, txt-only version used to
      be available at offlineos.com, but apparently not
      anymore), <a href="https://the-eye.eu/public/Books/">the-eye.eu books</a>, <a href="https://annas-archive.li/">Anna's Archive</a>, <a href="https://z-library.sk/">Z-library</a>, as well
      as music and movies (particularly long TV series may be suitable
      for hoarding; out of nice sci-fi ones, there are Doctor Who,
      Star Trek, Red Dwarf, Farscape, Lexx, Firefly, Defiance,
      Battlestar Galactica, Babylon 5, The X-Files, First Wave; plenty
      more can be found in Wikipedia; for humorous ones, see Black
      Books, The IT Crowd, Taskmaster, plenty of sitcoms), music
      videos, audio books (including BBC radio collections). The
      Pirate Bay or similar torrent trackers may help to find book
      collections, including MIT mathematics and physics books,
      Cambridge Histories, Oxford "Very Short Introductions". As well
      as works grouped by an author (e.g., Gardner, Feynman). Other
      topics to consider acquisition of modern (text)books on: <a href="https://en.wikipedia.org/wiki/List_of_publications_in_philosophy">major
      philosophy works</a>, electronics and radio, engineering, sociology,
      economics, <a href="computing-context.html">computing</a>, <a href="food.html">cooking</a>, <a href="physical-exercises.html">physical exercises</a>, survival,
      fiction, medicine (e.g., the Merck manual), any topics of
      interest and other sciences. Other individual books on
      <a href="online-courses-and-math-notes.html">physics and mathematics</a>, history. Consider <a href="../files/complementary-books.txt">the list of books
      complementary to Wikisource and PG</a>. Then there are various
      literary awards and charts: Pulitzer, Nebula, Locus, Bentley,
      Booker, <a href="https://www.nature.com/news/the-top-100-papers-1.16224">Nature's analysis of the 100 most cited papers</a>, <a href="https://www.theguardian.com/world/2002/may/08/books.booksnews">The
      Guardian's top 100 books of all time</a>, <a href="https://www.theguardian.com/books/2015/aug/17/the-100-best-novels-written-in-english-the-full-list">The Guardian's 100 best
      novels written in English</a>, <a href="https://www.nytimes.com/interactive/2024/books/best-books-21st-century.html">The NYT's 100 Best Books of the 21st
      Century</a>, and similar lists. Possibly UN and other organizations'
      reports.
    </p><p>
      One can <a href="https://askubuntu.com/questions/207447/how-to-reduce-the-size-of-a-pdf-file-by-reducing-the-quality-of-the-images#626301">reduce PDF size</a> (compress the images) with GhostScript
      or ImageMagick, among others, sometimes reducing the size by an
      order of magnitude: see "<a href="https://transloadit.com/devtips/efficient-pdf-optimization-with-ghostscript-cli/">Efficient PDF optimization with
      Ghostscript CLI</a>". For instance: <code>gs -q -sDEVICE=pdfwrite
      -dPDFSETTINGS=/screen -dCompatibilityLevel=1.4 -o out.pdf
      in.pdf</code> (possibly with <code>-dCompressFonts=true</code>
      and other options). Its <code>-dFirstPage=$START
      -dLastPage=$END</code> options are also handy sometimes, to
      extract pages of interest (including cases when some
      crackpottery is attached to books: that is one of the ways in
      which the crackpots try to promote it). While EPUBs (basically
      ZIP archives with HTML and images) can be compressed by
      compressing individual images within those. Sometimes files can
      be removed from an EPUB archive, and it can be trimmed down by
      passing through pandoc (which would remove included fonts, for
      instance).
    </p><p>
      As for operating system mirroring, one still needs some binaries
      to bootstrap when mirroring sources, while sources are
      particularly useful to backup for potential isolated usage,
      ensuring the ability to study and customize those. Some of the
      options to consider are (with size estimates from January of
      2026):
    </p><ul>
      <li><a href="https://www.debian.org/mirror/ftpmirror">Debian archive mirroring</a>: about 230 GB when done
        with <code>debmirror</code>, for amd64 trixie (13.3) with
        sources. While the <a href="https://www.debian.org/mirror/size">Mirror Size page</a> lists numbers for
        mirroring all suites. One may also consider usage of a caching
        proxy server, <code>apt-cacher-ng</code>, and <a href="https://wiki.debian.org/DebianInstaller/Modify/CD">Modifying Debian
        CD</a>. Unlike most others, Debian repositories contain all the
        source packages, which include upstream sources.</li>
      <li><a href="http://www.slackware.com/getslack/">Slackware downloads</a>: a whole mirror (for a single version)
        is under 20 GB, but it has few packages, and rather dated as
        well. But seems to be one of the few distributions with
        complete sources.</li>
      <li><a href="https://www.gentoo.org/downloads/mirrors/">Gentoo source mirrors</a>, particularly distfiles, almost 600
        GB. Those include multiple versions of the same programs.</li>
      <li><a href="https://wiki.archlinux.org/title/Mirrors">Arch Linux Mirrors</a> take a little over 110 GB for packages
        ("pool"), and 31 GB for sources (though the wiki claims it is
        80 GB and 110 GB, respectively; also most mirrors do not seem
        to host sources); apparently sources for many packages are not
        present.</li>
      <li><a href="https://fedoraproject.org/wiki/Infrastructure/Mirroring">Fedora mirroring</a>: about 356 GB for "Everything" x86_64
        packages, 123 GB for source ones.</li>
      <li><a href="https://www.openbsd.org/ftp.html">OpenBSD mirrors</a>: the sources may be in distfiles directories
        (as used by <a href="https://www.openbsd.org/faq/ports/ports.html">OpenBSD ports</a>), but I have not found mirrors with
        such directories available via rsync.</li>
      <li><a href="https://netbsd.org/mirrors/">NetBSD mirrors</a>: about 200 GB in distfiles, under 70 GB for
        precompiled amd64 packages. Those include multiple versions of
        the same programs.</li>
    </ul><p>
      Debian, in addition to being an all-around good system, seems to
      be a good option for such mirroring as well. The mirroring
      itself is done rather easily:
    </p><pre>sudo apt install debmirror debian-keyring
gpg --no-default-keyring --keyring trustedkeys.gpg --import /usr/share/keyrings/debian-archive-keyring.gpg
gpg --list-keys --keyring trustedkeys.gpg
debmirror -v -d trixie -a amd64 --source -h mirror.mephi.ru --method=rsync /mnt/backup/debian/mirror/</pre><p>
      An up-to-date <a href="https://www.debian.org/distrib/">live Debian CD/USB image</a> is useful to store along
      with it, and perhaps <a href="https://wiki.debian.org/moin_dump/">a Debian wiki dump</a>. As well as necessary
      additional firmware for one's hardware, and possibly firmware
      for devices other than regular computers, such as <a href="https://openwrt.org/">OpenWRT</a> images
      for routers, <a href="https://grapheneos.org/">GrapheneOS</a> or <a href="https://www.lineageos.org/">LineageOS</a> images for phones and
      tablets (along with individual program distributions, APKs; some
      software I use is listed in the note on <a href="mobile-computing.html">mobile
      computing</a>), <a href="https://github.com/koreader/koreader">KOReader</a> for e-readers. Consider <a href="https://f-droid.org/en/docs/Running_a_Mirror/">F-Droid mirroring</a>
      and <a href="https://openwrt.org/docs/guide-developer/source-code/start">OpenWRT source code</a> saving, or backups of individual
      packages.
    </p><p>
      <a href="https://openstax.org/">OpenStax</a> provides good and freely available textbooks under the
      CC BY license, available for download in PDF. See <a href="https://github.com/openstax">OpenStax
      GitHub repositories</a> for their CNXML sources and related tools,
      though in 2024 I found it tricky to build HTML out of those, and
      then it still was not good enough for printing. <a href="https://libretexts.org/">LibreTexts</a> is
      supposed to be similar, though the licensing information is
      unclear in some cases, some links lead to HTTP 404 errors, and
      some of the books are quite messy (attempting to embed YouTube
      videos into PDFs, having every other page filled with listings
      of undeclared licenses, or with "welcome" messages). While its
      subdomains (math, phys, etc) geo-block direct requests from
      Russia, the books are available without proxying via
      commons.libretexts.org. One can also search for libre book
      sources on platforms like GitHub, possibly <a href="https://github.com/search?q=textbook+language%3ATeX&amp;type=repositories">querying for TeX
      sources</a>: there are occasional seemingly decent and not
      well-known textbooks, like <a href="https://github.com/OSTP/PhysicsArtofModelling">Introductory Physics: Building Models
      to Describe Our World</a>, <a href="https://github.com/vEnhance/napkin">An Infinitely Large Napkin</a>.
    </p><p>
      Statistical ("ML", "AI") models for LLMs (llama.cpp) and speech
      recognition (whisper.cpp) may be useful to collect as well. LLMs
      in particular, while they do hallucinate, also contain plenty of
      information, and in a way that may make it easier to retrieve in
      some cases.
    </p><p>
      YouTube videos may be useful to hoard as well: there are many
      nice ones, including educational channels, and platforms like
      that seem to be getting blocked quickly when a government tries
      to block information flows (see <a href="https://en.wikipedia.org/wiki/Censorship_of_YouTube">censorship of YouTube</a>). At 480p
      most videos would be watchable and not take much space (perhaps
      2 to 5 MB per minute), and one can download them with youtube-dl
      (yt-dlp now), e.g.: <code>youtube-dl --download-archive
      archive.txt -f
      'bestvideo[height&lt;=480]+bestaudio/best[height&lt;=480]'
      'https://www.youtube.com/c/3blue1brown/videos'</code> (see
      also: <a href="https://news.ycombinator.com/item?id=31061163">some tricks to avoid throttling</a>). I have collected
      some <a href="../links.html#Videos">video links</a>, including interesting YouTube channels. I
      think it is best to go after relatively information-dense ones
      (lectures, online lessons) first, possibly followed by
      entertainment-education, pop-sci, and documentaries.
    </p><h2>Remote backups</h2><p>
      When backing up private data to a remote (and usually less
      trusted) machine, it should be encrypted and verified
      client-side (so options like plain rsync over SSH are not
      suitable), but preferably still allowing for incremental backups
      (so tar and gpg are not suitable in general, either). One can
      still employ LUKS or ZFS though, by accessing remote block
      devices via iSCSI (in particular, <code>tgt</code>
      and <code>open-iscsi</code> seem to work smoothly on Debian),
      NBD, or similar protocols, possibly on top of IPsec or WireGuard
      (though as of 2024, those are blocked in Russia between local
      and foreign machines), tunnels made with SSH port forwarding,
      TLS (e.g., with stunnel), or anything else establishing a secure
      channel, to add encryption and a more secure authentication.
    </p><p>
      A test iSCSI setup example:
    </p><pre># server (192.168.1.2)
apt install tgt
dd if=/dev/zero of=/tmp/iscsi.disk bs=1M count=128
tgtadm --lld iscsi --op new --mode target --tid 1 --targetname iqn:2024-07:com.example:tmp-iscsi.disk
tgtadm --lld iscsi --op show --mode target
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /tmp/iscsi.disk
tgtadm --lld iscsi --op new --mode account --user foo --password bar
tgtadm --lld iscsi --op show --mode account
tgtadm --lld iscsi --op bind --mode target --tid 1 --initiator-address 192.168.1.3 --initiator-name foo
tgtadm --lld iscsi --op unbind --mode target --tid 1 --initiator-address 192.168.1.3 --initiator-name foo
tgtadm --lld iscsi --op bind --mode target --tid 1 --initiator-address 192.168.1.3

# client (192.168.1.3)
apt install open-iscsi lsscsi
iscsiadm --mode discovery --type sendtargets --portal 192.168.1.2
iscsiadm  --mode node  --targetname iqn:2024-07:com.example:tmp-iscsi.disk --portal 192.168.1.2 --login
iscsiadm --mode session --print=1
lsscsi
# a block device is available at this point
iscsiadm  --mode node  --targetname iqn:2024-07:com.example:tmp-iscsi.disk --portal 192.168.1.2 --logout</pre><p>
      Apart from own (or rented) remote machines, such a setup can be
      used with "backup buddies", exchanging some of your local
      storage space for someone else's. Sneakernet-based backup
      buddies (that is, occasionally exchanging storage devices) is a
      fine and easier option for remote backup storage.
    </p><p>
      A popular option for remote backups is online services (aka "the
      cloud" and a few other names), with many people relying on those
      even in place of local backups, or any local storage (as with
      music and video streaming, hosted photo albums, password
      managers, book collections, general document storage),
      delegating all those worries to somebody else. It seems
      convenient, but decreases direct control over the data,
      introduces dependencies on the service providers' continued
      existence and continued acceptable terms of service, on network
      connectivity to them, on ability to transfer payments. In
      my--possibly unrepresentative--experience, all those are
      unreliable, but it may still work as a redundant backup copy for
      some, particularly in predictable democratic countries, with a
      reputable service provider. Throw in the rule of law and
      sensible laws (or some kind of a hypothetical anarchist or
      communist utopia), and one may worry less about keeping some
      information private, as well as about aiming long-term isolated
      backups of public information.
    </p><h3>Data sharing</h3><p>
      For less private data (perhaps for almost everything but
      cryptographic keys and passwords -- that is, explicit secrets),
      a good way to preserve it is by sharing with others: for
      instance, pictures from an event or gathering are commonly
      shared among all the participants, while creative works
      (particularly books and music) can be shared among people with
      similar interests or tastes. Everything work-related can be
      backed up on work machines. While the data that is not private
      at all, like this very note, or other own creative works under
      permissive licenses, is generally useful to publish, sharing
      even more widely.
    </p><h3>Adverse services</h3><p>
      One may consider use of relatively adverse services for both
      storage and transfer, such as censored and monitored
      ones. Usually they are best to avoid, but they may still be
      useful for redundancy, or when there are no other working
      options.
    </p><p>
      For file storage or sharing services, storage on block devices,
      as described above, can be handled with a file-backed loop
      device. GnuPG and other file- or stream-oriented methods would
      also work, but since encrypted data may attract unwanted
      attention, it is better at least to not advertise the encryption
      with headers. An easy option to do that (using a passphrase
      without additional files, the widely available openssl CLI tool)
      with a single file or stream is <code>openssl enc -aes-256-ctr
      -nosalt -pbkdf2</code>, but PBKDF2 is relatively weak (argon2id
      is recommended), and this skips a salt entirely, so the
      passphrase must be high-entropy then. Alternatively, one may
      consider using and storing the salt, and employing argon2
      manually, e.g.:
    </p><pre>sudo apt install openssl argon2
SALT=$(openssl rand -hex 16) # 128 bits
# https://www.rfc-editor.org/rfc/rfc9106#name-parameter-choice
# The first recommended option
argon2 $SALT -id -t 1 -p 4 -m 21 -l 32
# The second recommended option
argon2 $SALT -id -t 3 -p 4 -m 16 -l 32
# Use -e or -r options for scripting</pre><p>
      Another option is cryptsetup (dm-crypt) without LUKS: in its
      plain mode, on a loop device, with some basic non-journaling
      file system (such as ext2, or ext4 with journal disabled) on
      it. The passphrase must also be high-entropy, since it does not
      use a KDF: ideally matching the 128-bit key size, which would
      take 8 random words picked out of a dictionary of 65536
      words. Or a separately derived (or generated, simply random) key
      must be supplied, perhaps with the <code>--key-file</code>
      option. An example:
    </p><pre>dd if=/dev/urandom of=test.img bs=1M count=128
sudo losetup --find --show test.img
sudo cryptsetup open --type plain /dev/loop0 test
# No journal, no reservation
mke2fs -t ext4 -O ^has_journal -m 0 /dev/mapper/test
mkdir test
sudo mount /dev/mapper/test ./test
# Add the files here
sudo umount ./test
sudo cryptsetup close test
sudo losetup -d /dev/loop0</pre><p>
      To make use of audio channels or audio data storage services
      (including the ones that re-encode audio files), a
      straightforward way is to use modem software, such
      as <code>minimodem</code>. That can be combined with forward
      error correction for reliability, and mixed with another audio
      stream to stay more covert. One may also try setting a system in
      the style of numbers stations, using TTS (text-to-speech,
      festival or espeak) and STT (speech-to-text, CMU Sphinx or
      more advanced ones).
    </p><p>
      For data encoding as text, one can use plain base64, some
      words-based encoding, maybe Markov chains (which would require
      custom tools and data though).
    </p><p>
      For video, a similarly ad hoc and basic approach is to encode a
      sequence of QR codes (or other matrix barcodes). But as for
      other options, one may also consider more involved steganography.
    </p><p>
      HMAC can be useful for authenticated integrity checks with such
      services. Common CLI tools for that include
      <code>hmac256(1)</code> from the <code>libgcrypt20-dev</code>
      Debian package
      and <code>openssl-dgst(1ssl)</code>: <code>openssl dgst -sha256
      -hmac &lt;key&gt; [file ...]</code>.
    </p><p>
      I would not recommend to rely on online services generally, but
      using them for added redundancy, particularly for public data,
      may be okay, and potentially fun to play with. If arbitrary and
      random-looking data storage is not explicitly allowed by a
      service, it may lead to account suspension, including other
      services on that account (though it occasionally happens with
      online services even without such a trigger).
    </p></xhtml:div></content></entry>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/network-abuse.html"/><id>https://thunix.net/~defanor/notes/network-abuse.html</id><author><name>defanor</name></author><title>Network abuse</title><summary>A log of dealing with network abuse</summary><published>2022-09-07T09:00:00Z</published><updated>2026-04-28T09:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Network abuse</h1><p>
      Here is my log of spotted and reported network abuse incidents.
      It started as private notes aiming to keep track of those being
      fixed, and to block the hosts if they keep spamming. I decided
      to make it public, since there is no private information in it
      (though I'm omitting the bits I may discover that aren't public,
      such as server administrator email addresses), and it may be of
      interest for people trying to decide whether reporting is
      worthwhile.
    </p><h2>Spam messages</h2><p>
      Below are incidents with spam messages that got through the
      usual filters: dates, hosts, the abuse contact and other report
      information, other notes.
    </p><h3>XMPP</h3><ul>
      <li>2021-09-12, 188.243.192.232, abuse@sknt.ru: no response and
        spam kept coming, submitted <a href="https://github.com/JabberSPAM/blacklist/pull/26">a JabberSPAM blacklist PR</a>.</li>
      <li>2021-09-12, 138.201.50.174, stian@barmen.nu: replied that he
        will investigate. Probing from ether@jabber.no.</li>
      <li>2021-09-12, 54.36.115.48, info@xmpp.gg and abuse@ovh.net: no
        reply from either and the spam kept coming, submitted <a href="https://github.com/JabberSPAM/blacklist/pull/27">a
          blacklist PR</a>. Probing from ink@jabber.gg.</li>
      <li>2022-08-25, 138.201.25.9, abuse@hetzner.com followed
        by <a href="https://abuse.hetzner.com/">Hetzner abuse reporting form</a>. Subscription requests and
        OMEMO-encrypted messages, similar ones from multiple services
        and JIDs, with occasional plaintext being just silly. This one
        is from klassic@isgeek.info. Those kept coming for at least a
        month.</li>
      <li>2022-08-25, 185.146.232.56, vesselwave@protonmail.com: they
        deleted the user and started looking more closely for
        spammers. From klassic@satisprivacy.org.</li>
      <li>2022-08-25, 95.168.217.72, support@jabbim.zendesk.com and
        abuse@superhosting.cz (since the first one had no
        effect). From multiks@jabbim.sk.</li>
      <li>2022-09-06, 170.187.181.190, abuse@linode.com. From
        multiks@rows.im.</li>
      <li>2022-09-10, 86.250.242.174. Did not notice at first, and
        then it ceased. Probing (presence subscription requests) from
        multiks@im.azurs.fr.</li>
      <li>2022-10-01, 89.147.108.127, info@outerrealm.net on
        2022-10-06, within 30 minutes received a reply saying that it
        will be looked into, and apparently it was solved. From
        ehf@msg.outerrealm.net: subscription requests at first, an odd
        message saying "Request Subscription" (followed by
        opportunistic OTR's whitespaces, similarly to some of the past
        spammy/probing messages) on 2022-10-06.</li>
      <li>2022-10-18, 78.72.102.36. Have not reported, but then it
        disappeared; possibly somebody else did. From swe@qwik.space,
        a subscription request.</li>
      <li>2022-10-18, 78.72.102.36. Same as above: haven't reported,
        but then it disappeared. From basik@qwik.space, a subscription
        request.</li>
      <li>2022-11-01, 138.201.50.174, stian@barmen.nu. From
        floki@jabber.no: "Hi there, free for chat?". Then a
        subscription request from the same JID arrived on
        2023-01-03.</li>
      <li>2022-11-16, 138.201.25.9, the Hetzner reporting form (since
        have not found aministrator contact information). Received an
        acknowledgement on 2023-01-11, a reply from the XMPP server
        aministrator on 2023-01-13 saying that it doesn't look like
        spam; described the issue in more detail, another reply saying
        that it sounds like "complete nonsense" and suggesting to use
        iptables. <a href="https://logs.xmpp.org/operators/2023-01-13#2023-01-13-6730a27d988f0e8d">Asked on operators@muc.xmpp.org to ensure that my
        approach is sensible</a>, and replied to abuse@hetzner.com, asking
        about their policy on XMPP spam; no reply, as of
        2023-05-05. Unexpected presence subscription request and no
        message (likely probing) from basik@isgeek.info.</li>
      <li>2022-12-13, 138.201.50.174, stian@barmen.nu. Then again on
        2023-03-08 (after an additional message from the same XMPP
        address). From prtship@jabber.no/_, a presence subscription
        request, and a "Hi, Free for chat?" message 3 months
        later.</li>
      <li>2023-01-18, 167.179.180.180, abuse@octothorn.com (on
        2023-01-19). Received a reply on 2023-02-15, mentioning that
        the user is being kicked off, and the account had more than
        1000 contacts in the roster, most of which were pending a
        subscription approval. From aus@jabber.octothorn.com/_, a
        presence subscription request. The last one arrived on
        2023-01-31.</li>
    </ul><h3>Email</h3><ul>
      <li>2021-02-09, 103.66.105.237, noc@cmjainimpex.in.</li>
      <li>2021-03-31, 205.201.133.233, abuse@mailchimp.com.</li>
      <li>2021-06-24, 2a00:1450:4864:20::641, <a href="https://support.google.com/mail/contact/abuse">Gmail abuse reporting
          form</a>. Apparently reporting didn't work, nothing happened
          on "submit".</li>
      <li>2021-06-25, 91.223.3.194, admin@skynode.pl.</li>
      <li>2022-04-25, 146.19.173.107, abuse@ipconnect.services.</li>
      <li>2022-04-28, 5.181.80.128, noc@4vendeta.com.</li>
      <li>2022-05-29, 200.93.248.119, rolfex@powerfast.net.</li>
      <li>2022-05-30, 193.218.204.206, abuse@heficed.com. The client
        replied that it was solved a long time ago.</li>
      <li>2022-05-31, 2607:f8b0:4864:20::e41, Gmail abuse reporting
          form.</li>
      <li>2022-06-30, 211.100.47.38. A Chinese ISP, probably not worth
        reporting, Blacklisted
        in <code>postscreen_access.cidr</code>.</li>
      <li>2022-08-15, 159.183.196.221, abuse@sendgrid.com.</li>
      <li>2022-11-01, 2607:5500:3000:1176::2,
        support@hostwinds.com.</li>
      <li>2023-05-05, 106.75.10.112, ipas@cnnic.cn. From
        ucmail25.sendcloud.io.</li>
      <li>2023-05-30, 69.12.91.126, abuse@quadranet.com.</li>
      <li>2023-06-16, 117.50.66.12, ipas@cnnic.cn. From
        ucmail17.sendcloud.io, added <code>sendcloud.io REJECT
        spammers</code> into the file referenced by
        <a href="https://www.postfix.org/postconf.5.html#check_client_access">postfix's check_client_access</a>. dnswl.org returned
        127.0.15.0 for it, reported it to them as spam.</li>
      <li>2023-06-22, 192.119.65.137, abuse@hostwinds.com. Their mail
        server (Gmail) rejects messages with the spam message
        attached, reported without an attachment.</li>
      <li>2023-07-21, 220.133.13.91,
        hostmaster@twnic.net.tw. According to the received mail
        headers, it originated from 185.225.74.219.</li>
      <li>2023-09-15, 46.17.43.50, noc@baxet.ru. With valid SPF for
        tiaohu.net: apparently a Chinese organization's domain name,
        but a Russian hoster's IP address. Quickly received a reply
        saying "Blocked" from support@justhost.asia.</li>
      <li>2023-09-15, 2607:f8b0:4864:20::935, Gmail abuse reporting form.</li>
      <li>2023-09-22, 2607:f8b0:4864:20::72c, Gmail abuse reporting
        form. Same address as the previous one
        (polachek@squadhelp.co), a follow-up.</li>
      <li>2023-09-23, 2607:f8b0:4864:20::72a, Gmail abuse reporting
        form. Same address as the previous two, the spammer claimed it
        is the last message.</li>
      <li>2023-09-25, 2607:f8b0:4864:20::f29, Gmail abuse reporting
        form. A new subdomain, polachekg@go.squadhelp.co, but
        continuation of the previous 3, and Gmail does nothing;
        blacklisted the domain in postfix (check_sender_access).</li>
      <li>2023-10-19, 209.85.128.177, Gmail abuse reporting form. From
      masonlambert190@gmail.com</li>
      <li>2023-11-01, 209.85.128.172, Gmail abuse reporting form. From
      katherinesophia523@gmail.com</li>
      <li>2023-12-05, 31.192.235.11, abuse@profitserver.ru. Phishing,
        envelope-from abuse@q03.1cooldns.com, with valid DKIM and
        SPF.</li>
      <li>2023-12-11, 31.192.237.60, abuse@profitserver.ru. Phishing
        again, envelope-from abuse@origin.1cooldns.com.</li>
      <li>2023-12-11, 209.85.219.180, Gmail abuse reporting form. From
        haileyjtanner@gmail.com, asking to add a link to some
        furniture selling website (which supposedly has a blog post on
        astronomy) from my "links" page.</li>
      <li>2023-12-18, 209.85.128.170, Gmail abuse reporting form. From
        haileyjtanner@gmail.com again, Gmail does not seem to do much
        about outgoing spam.</li>
      <li>2023-12-19, 31.192.239.9, abuse@profitserver.ru. Phishing
        yet again, envelope-from=no-replies@batixtaneve.com this
        time. Blacklisted 31.192.232.0/21.</li>
      <li>2023-12-26, 209.85.128.169, Gmail abuse reporting form. From
        haileyjtanner@gmail.com yet again, Gmail still does
        nothing. Blacklisted the address in postfix
        (check_sender_access).</li>
      <li>2024-02-29, 204.152.197.177, abuse@quadranet.com. Spam about
        electric bicycles</li>
      <li>2024-03-12, 185.218.100.84, abuse@ipxo.com.</li>
      <li>2024-03-18, 194.53.136.174, abuse@virtono.com. Spam about
        electric bicycles, same as on 2024-03-12.</li>
      <li>2024-03-20, 104.223.121.26, abuse@quadranet.com. Same as the
        last two, and as on 2024-02-29: e-bikes.</li>
      <li>2024-04-25, 2024-04-26, 216.9.224.143,
        abuse@dchost.com. Scam, 3 messages. And one more message from
        the misconfigured mail server, notifying about a failed
        delivery (the "from" address matched the "to" address).</li>
      <li>2024-05-09, 173.249.144.124, abuse@liquidweb.com. Posing as
        a Docusign notification.</li>
      <li>2024-06-12, 193.188.192.139, abuse@pipenet.hu.</li>
      <li>2024-07-31, 47.90.198.34, abuse@alibaba-inc.com.</li>
      <li>2024-08-08, 103.224.90.82, abuse@nexcess.net. Phishing</li>
      <li>2024-09-23, 208.234.3.27, abuse@verizon.net,
        abuse@ait.com. A scam, as described in "<a href="https://www.insercorp.com/blog/post/december/09/2010/beware-of-chinese-domain-scams">Beware of Chinese
        Domain Scams</a>" or "<a href="https://nonewwars.co.uk/blog/2021/10/chinese-domain-registration-emails/">Chinese domain registration emails</a>". Verizon
        pointed to AIT.com, I wrote there, the "support ticket" was
        closed quickly without a comment.</li>
      <li>2024-09-24, 2a00:1450:4864:20::42b, Gmail abuse reporting
        form. From saracody9@gmail.com, a request to link some
        irrelevant website from mine.</li>
      <li>2024-10-27, 219.134.170.101,
        anti-spam@chinatelecom.cn. Router advertisements.</li>
      <li>2024-11-18, 46.23.108.219, abuse@bullethost.net. Electric
        bicycle advertisement.</li>
      <li>2024-11-19, 192.154.230.159,
        abuse@host4yourself.com. Electric bicycle advertisement.</li>
      <li>2024-11-22, 181.214.99.201, abuse@ipxo.com. E-bikes.</li>
      <li>2024-11-30, 188.127.247.224, abuse@smartape.net
        (though <a href="https://krebsonsecurity.com/2022/04/double-your-crypto-scams-share-crypto-scam-host/">SmartApe is reported to be a Russian hosting for
          cybercriminals</a> itself). Probing.</li>
      <li>2024-12-01, 120.241.40.88, abuse@chinamobile.com. Spam about
        shipping from China.</li>
      <li>2024-12-04, 91.193.18.13,
        abuse@hostzealot.com. E-bikes.</li>
      <li>2024-12-06, 181.214.99.132,
        report@abuseradar.com. E-bikes.</li>
      <li>2024-12-10, 84.32.41.141,
        report@abuseradar.com. E-bikes.</li>
      <li>2024-12-13, 162.250.189.12, complaints@servarica.com. The
        ticket was automatically created and automatically closed
        without response in 36 hours; blacklisted its subnet
        in <code>postscreen_access.cidr</code>.</li>
      <li>2024-12-29, 222.125.131.176, xujing@topway.cn. Shipping from
        China.</li>
      <li>2025-01-12, 39.189.22.39, abuse@chinamobile.com.</li>
      <li>2025-01-14, 45.147.167.60,
        abuse@thinkhuge.net. E-bikes.</li>
      <li>2025-01-15, 217.12.203.132,
        abuse@greenfloid.com. E-bikes.</li>
      <li>2025-02-03, 39.189.22.212, abuse@chinamobile.com. Blocked
        SMTP connections from Chinese IP addresses via nftables at
        this point, since there is a lot of spam and no ham at all
        coming from those.</li>
      <li>2025-02-11, 85.120.223.178, abuse-nav@rnc.ro and
        abuse@nav.ro. E-bikes. Connections to the rnc.ro mail server
        time out.</li>
      <li>2025-02-15, 209.85.208.176, Gmail abuse reporting form. From
        svcodie@gmail.com, again about adding some supposedly
        astronomy-related links to my "links" page (the URL that is
        dead for a few months), with a shady "unsubscribe" link.</li>
      <li>2025-02-17, 85.120.223.139, abuse@nav.ro. E-bikes
        again.</li>
      <li>2025-02-23, 209.85.218.42, Gmail abuse reporting form. From
        jessigfrost@gmail.com, again on astronomy links.</li>
      <li>2025-02-24, 85.120.223.179, abuse@nav.ro. E-bikes again,
        repeatedly from the same ISP. nav.ro rejected my report as
        spam. Added a rejection rule for 85.120.223.0/24
        into <code>postscreen_access.cidr</code>.</li>
      <li>2025-02-27, 209.85.208.47, Gmail abuse reporting form. From
        the previously reported jessigfrost@gmail.com.</li>
      <li>2025-02-27, 194.102.104.66. Phishing, but nowhere to report:
        it lists abuse-alexhost@rnc.ro, and rnc.ro's mail servers are
        not responsive, as discovered recently. Blacklisted the
        subnet, as with the other rnc.ro one.</li>
      <li>2025-03-08, 209.85.214.175, Gmail abuse reporting
        form. Probing of active mailboxes, apparently (sent to two of
        my email addresses), from insangleeq@gmail.com.</li>
      <li>2025-03-14, 209.85.222.53, Gmail abuse reporting
        form. Follow-up probing, from mrsirishboudreau86@gmail.com.</li>
      <li>2025-03-21, 209.85.160.52, Gmail abuse reporting
        form. Probing again, from ukpabimberi892@gmail.com.</li>
      <li>2025-03-24, 39.189.23.79. Chinese spam again: I had
        nftables.service disabled, so did not apply the filters after
        the reboot.</li>
      <li>2025-03-26, 2607:f8b0:4864:20::b44, Gmail abuse reporting
      form. From mberiukpabi611@gmail.com.</li>
      <li>2025-03-28, 209.85.208.66, Gmail abuse reporting form. Still
        probing, which seems to be quite regular (weekly), from
        ukpabimberi353@gmail.com. It was sent to two of my email
        addresses.</li>
      <li>2025-04-04, 179.61.221.11,
        report@abuseradar.com. E-bikes.</li>
      <li>2025-04-09, 209.85.208.196, Gmail abuse reporting
      form. Probing yet again, sent to at least two of my email
        addresses, from noorawilliams015@gmail.com.</li>
      <li>2025-04-17, 209.85.219.171, Gmail abuse reporting form. Some
        probing again, from quydai079@gmail.com, referencing a phone
        number for use with Telegram.</li>
      <li>2025-05-31, 193.52.142.199, certsvp@renater.fr.</li>
      <li>2025-06-20, 185.130.249.144, abuse@smartape.ru. "Unpaid
        invoice" scam.</li>
      <li>2025-06-23, 209.85.160.43, Gmail abuse reporting form. From
        mrsirishboudreau5@gmail.com, probing for live email
        addresses.</li>
      <li>2025-07-09, 193.42.36.71, abuse@hostzealot.com. E-bikes.</li>
      <li>2025-07-09, 209.85.219.196, Gmail abuse reporting form. From
        mrsirishboudreau288@gmail.com, probing for live email
        addresses.</li>
      <li>2025-07-28, 38.45.89.36, abuse@cogentco.com. Posing as a
        Docusign notification.</li>
      <li>2025-07-29, 191.252.13.209, abuse@locaweb.com.br. Posing as
        booking.com.</li>
      <li>2025-07-29, 191.252.13.197, 191.252.12.56, 177.153.3.113,
        179.188.6.145 (all Locaweb, as the one above). Blacklisted
        191.252.0.0/16, 177.153.0.0/16, 179.188.0.0/16.</li>
      <li>2025-08-04, 192.154.230.149,
        abuse@host4yourself.com. E-bikes.</li>
      <li>2025-08-05, 79.141.174.230, abuse@hostzealot.com.</li>
      <li>2025-08-07, 45.86.230.19, abuse@bluevps.com. E-bikes. They
        promptly responded "This client is blocked". I
        added <code>/e-bike/i REJECT E-bike spam</code> into
        postfix's <code>body_checks</code>.</li>
      <li>2025-08-08, 179.61.221.2, report@abuseradar.com. E-bikes,
        adjusted the body_checks rule to <code>/e-?bike/ REJECT E-bike
        spam</code> (the <code>i</code> flag actually turns
        case-insensitivity off), blacklisted 179.61.221.0/24
        in <code>postscreen_access.cidr</code>.</li>
      <li>2025-08-12, 108.165.213.11,
        abuse@dartnode.com. Phishing.</li>
      <li>2025-08-22, 209.85.217.68, Gmail abuse reporting form. From
        mrs.info.jashok@gmail.com.</li>
      <li>2026-02-24, 77.83.39.16, abuse@lanedo.net.</li>
      <li>2026-03-08, 209.85.216.48, Gmail abuse reporting form. From
        maviswanczykp82@gmail.com.</li>
      <li>2026-03-11, 163.223.211.186, hm-changed@vnnic.vn.</li>
      <li>2026-03-11, 163.223.211.186, hm-changed@vnnic.vn. Same
        message as earlier, blacklisted 163.223.210.0/23
        in <code>postscreen_access.cidr</code>.</li>
      <li>2026-04-28, 160.30.136.30 and 160.30.136.43,
        hm-changed@vnnic.vn. The messages pretended to be from gmail,
        with a DKIM signature failing verification. Blacklisted
        160.30.136.0/23 as well.</li>
    </ul><h2>General observations</h2><p>
      A lot of network abuse (spam, vulnerability scans, brute-force
      attacks) comes from China, plenty from Russia as well. As a side
      note, <a href="https://qz.com/978037/china-publishes-more-science-research-with-fabricated-peer-review-than-everyone-else-put-together">Chinese researchers similarly spam the world with
      fabricated research papers</a> (though apparently they try to combat
      it, <a href="https://www.statnews.com/2017/06/23/china-death-penalty-research-fraud/">up to a death penalty for researchers who commit fraud if it
      harms people</a>). Apparently wider agreements, policies, and
      cultures help to fight network abuse about as well as
      technological methods do. I think it is okay to rate-limit
      regional IP address blocks (as described in the <a href="private-server-setup.html">private server
      setup</a> and <a href="simpler-server-setup.html">simpler server setup</a> notes), though one should think
      twice before blocking them completely: if there are non-abusive
      users, it would be unfair to them. And then there are large mail
      providers, particularly Gmail, not caring much about outgoing
      spam, while blocking them is a bad option, given the number of
      legitimate users: the ham-to-spam ratio is less than 1, but more
      than 0.
    </p></xhtml:div></content></entry>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/information-security-basics.html"/><id>https://thunix.net/~defanor/notes/information-security-basics.html</id><author><name>defanor</name></author><title>Information security basics</title><summary>A brief guide on information security and literacy</summary><published>2025-03-15T12:00:00Z</published><updated>2026-04-14T17:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Information security basics</h1><p>
      There are information security guides for different audiences
      around, including EFF's <a href="https://ssd.eff.org/">Surveillance Self-Defense</a> and <a href="https://emailselfdefense.fsf.org/en/">Email
      Self-Defense</a>, <a href="https://www.nist.gov/cybersecurity">NIST's Cybersecurity</a>. But I fail to find concise,
      relatively general, and sensible guidelines aiming personal
      <a href="https://en.wikipedia.org/wiki/Information_security">information security</a> and <a href="https://en.wikipedia.org/wiki/Information_literacy">information literacy</a> to refer people
      to, so I wrote down the suggestions I would normally share.
    </p><p>
      I am not a security expert, but a programmer and a small-scale
      system administrator paying attention to security. So it is a
      good idea to consider these suggestions critically, just as any
      others, but I think that they will improve the average state of
      such guides.
    </p><h2>General advice</h2><p>
      Question things, do not trust blindly, require evidence and
      verifiability of claims, check those, do not share personal
      information or give away control without a good reason to,
      assume that "anything that can go wrong will go wrong" (<a href="https://en.wikipedia.org/wiki/Murphy%27s_law">Murphy's
      law</a>). That is, employ scientific and engineering approaches, and
      try to stay honest: do not nudge things to look better (e.g.,
      more trustworthy or certain) than they are; better to err on the
      side of safety, assuming that they may be worse than they
      seem. A lack of understanding makes one vulnerable to deception,
      so study the relevant subjects: how computers, banks, online
      stores, governments and scammers work, how software and relevant
      systems are developed, how the research used by those is
      done. <a href="computing-context.html">Computing context</a> is a part of it. Try to avoid <a href="https://en.wikipedia.org/wiki/List_of_fallacies">fallacies</a>
      and <a href="https://en.wikipedia.org/wiki/List_of_cognitive_biases">cognitive biases</a>, as they tend to be exploited by
      adversaries.
    </p><p>
      Do not shy away from learning. It is tempting (and commonly
      suggested) to stick to certain newbie-friendly tools, but that
      is a very fragile approach: without sufficient understanding,
      people easily lose the tools (e.g., when the government blocks
      their secure messengers), or manage to misuse them (e.g., by
      ascribing strange and unexpected properties to the tools: no
      user-friendly UI or API will protect from a user assuming that
      anything going through a system becomes "secure" in all senses
      and for all purposes, for instance).
    </p><p>
      Conversely, when providing a service, publishing software,
      asking for information, sharing information or software, it is
      nice to make it easy for others to follow that: provide
      references, evidence, source code, explain why the requested
      information is required (and ensure that it actually is
      required); generally, do not ask to believe or trust blindly, do
      not encourage and normalize dangerous practices.
    </p><p>
      And as with any other pursuit, give it a try, do not give up, do
      not view it as "all or nothing": learning a little, paying some
      attention to security, and avoiding some of the potential losses
      that way is already better than being successfully attacked all
      the time.
    </p><h2>Threats</h2><p>
      Information security includes a few areas, but personal security
      usually revolves around privacy and confidentiality. Some of the
      common <a href="https://en.wikipedia.org/wiki/Threat_actor">threat actors</a> targeting individuals are scammers,
      oppressive governments, and thrill seekers. All those seem to be
      commonly underestimated: scammers' victims think that they
      cannot be scammed, and are surprised afterwards; thrill seekers
      are often neglected because "why would anybody want to do
      that?"; governments are often ignored because of one's political
      views (loyalty to the regime, beliefs that it will not turn
      authoritarian, is not authoritarian even after it turned so,
      abandoning presidential term limits, introducing numerous
      censorship laws and persecution of dissent, and so on; belief
      that they will not reach you) or <a href="https://en.wikipedia.org/wiki/Learned_helplessness">learned helplessness</a>. "I have
      nothing to hide" is another common sentiment, often extended to
      the private information of one's friends and family that they
      possess, useful to threat actors. That usually implies a
      certainty that the government is on your side and will stay that
      way, in addition to one's immunity to the other risks. And then
      there are the likes of "<a href="https://en.wikipedia.org/wiki/Just-world_fallacy">the world is just</a>, I am good, so nothing
      bad can happen to me"; a variety of denial strategies and
      excuses, religious beliefs.
    </p><p>
      Entities collecting information, even if they do not use it
      against you intentionally and immediately, may also be viewed as
      threats, since they tend to leak it via <a href="https://en.wikipedia.org/wiki/Data_breach">data breaches</a>, or to
      abuse it themselves later. Those include commercial companies,
      government organizations, and individuals.
    </p><p>
      People may also engage in a crime of opportunity if the
      conditions for that are created: e.g., someone picking up or
      buying a discarded unencrypted storage device may access
      (recover) the private data stored on it. Same with information
      made available online: apparently even IT professionals manage
      to accidentally allow unauthenticated access to databases quite
      regularly, making it a common source of data breaches.
    </p><h2>Mitigation</h2><h3>Principle of least privilege</h3><p>
      The <a href="https://en.wikipedia.org/wiki/Principle_of_least_privilege">principle of least privilege</a> is generally useful: share the
      minimum required information to receive a service, or give
      minimal required and controlled access to your system. E.g.,
      buying most items, using most public transport, or visiting most
      public places should not require identifying yourself: doing so
      imposes an unnecessary risk. Likewise with running custom
      software to access online services, especially if it is
      closed-source (and possibly proprietary), so you cannot (and
      possibly not allowed to by the license) check what it is doing
      with your system. Communicating over the Internet does not
      require to provide your full name, phone number, or to identify
      yourself at all. Identifying yourself by sending pictures of
      documents is one of the sillier and dangerous
      practices. Software should not run with superuser (root)
      privileges, and generally the usual security mechanisms must not
      be bypassed, unless there is a good reason to.
    </p><p>
      If someone asks you to take unnecessary risks like that, that
      itself is a cause for suspicion, and to look for other
      options. Often it involves accepting inconveniences (such as
      visiting places and standing in queues instead of using
      proprietary software, dealing with paper documents, possibly
      with cash, missing some online conversations), resisting peer
      pressure (e.g., "just set a sensible password like 1234",
      "install our software with <code>curl | sh</code> and run its
      custom updater to be up to date", "let's run everything as root
      to avoid dealing with permissions").
    </p><p>
      If the private information is not requested by a service, or
      superuser privileges are not requested by software, it is safest
      to not volunteer to provide those: e.g., use screen names for
      online services and as a system user name (which is used as the
      default name for information sent online occasionally: the best
      way to ensure that the real name is not leaked accidentally is
      to never enter it), use dedicated system users or sandboxing
      facilities to run programs.
    </p><h3>Cryptography</h3><p>
      Cryptography provides useful tools, perhaps encryption being the
      most notable one, useful for <a href="personal-data-storage.html">personal data storage</a> (including
      encrypted backups), as well as for communication (over <a href="email.html">email</a> or
      instant messengers, such as <a href="xmpp.html">XMPP</a>), and for channel security (for
      network connections). Another common use of cryptography is for
      data integrity checks.
    </p><p>
      Following general advice given above, one should look for
      trustworthy (transparent, verifiable, openly developed) tools,
      ideally using free and open-source software exclusively,
      retrieving it from trusted sources (such as operating system's
      repositories, where the packages are signed), preferably
      checking the code, but at least preferring the tools used and
      inspected by many.
    </p><p>
      I personally use mostly LUKS for disk encryption and OpenPGP for
      file and mail encryption and signing, on a Debian system. And
      TLS, SSH, IPsec, Wireguard for channel security. Those are
      widely available, well-known tools.
    </p><p>
      The usage of LUKS with <code>cryptsetup(1)</code> is described
      in the personal data storage notes linked above, while that of
      OpenPGP is described in <a href="https://www.gnupg.org/documentation/guides.html">GnuPG's user guides</a>; it is supporetd out
      of the box in mail clients such as mu4e (an Emacs client), mutt
      (a standalone TUI client), Thunderbird (a standalone GUI
      client), and the GnuPG's <code>gpg(1)</code> command-line tool
      is fairly easy to use. For email, one may want to ensure that
      the messages are encrypted not just for recipients, but also for
      the sender, so that the sender can read them later: mutt does it
      by default (the <code>pgp_self_encrypt</code> option), for mu4e
      one should enable it
      in <code>mml-secure-openpgp-encrypt-to-self</code>.
    </p><p>
      There are endless alternatives, which tend to incorporate newest
      and shiniest algorithms (which is dangerous by itself: better to
      stick to heavily analyzed ones), to be written in this month's
      most trendy language (possibly to be abandoned soon), clean of
      the backwards--or standards--compatibility cruft accumulated by
      older tools, and supposedly easier to use, providing fun colors
      and supportive emojis. Some also like to write their own
      software, but there are many gotchas and cryptographic attacks
      that basic algorithm descriptions do not mention, which may
      easily compromise the system. Both scammers and governments like
      to advertise malware as security software, occasionally to
      disguise attacks as security measures. While more legitimate
      commercial companies tend to sell virtually useless security
      products, but not necessarily malware: perhaps more of
      placebo. <a href="https://en.wikipedia.org/wiki/Security_theater">Security theater</a> is a shady practice along those lines.
    </p><p>
      OpenPGP is criticized quite persisently, and it is indeed
      imperfect, as even its name points out: merely "pretty
      good". But as with other things, the "best" kind, as judged for
      a particular situation, is often that which is actually used at
      all, while OpenPGP usually beats the proposed alternatives in
      its applicability and (continued) availability, and in many
      cases its issues are irrelevant. There is a room for improvement
      though. For an alternative OpenPGP implementation,
      see <a href="https://sequoia-pgp.org/">Sequoia-PGP</a>. Out of standalone (but incompatible with
      OpenPGP) encryption and signing alternatives, <a href="https://github.com/FiloSottile/age">age</a> and <a href="https://jedisct1.github.io/minisign/">Minisign</a>
      are somewhat prominent. While the OpenSSL CLI tool is more
      widely available and versatile. And then there are OTR, OMEMO,
      and MLS for IMs specifically. But I think it can be quite a
      rabbit hole, while GnuPG is versatile and good enough for most
      tasks, so at least it is worthwhile to look into first.
    </p><h3>Other tactics</h3><p>
      There are minor tactics and useful habits, some of which can be
      described as simply common sense:
    </p><ul>
      <li>
        Use strong passwords (e.g., generate those
        with <code>xkcdpass</code>), do not reuse those across
        services, maybe do not reuse logins and other identifying
        information, either. That may include things like the IP
        address, web browser fingerprints, and so on.
      </li>
      <li>
        Update software (including firmware) regularly to ensure that
        known vulnerabilities are fixed in it, and pick reputable
        FLOSS options in the first place. Look into software projects
        such as <a href="https://www.gnu.org/">GNU</a>, <a href="https://kernel.org/">Linux</a>, <a href="https://www.debian.org/">Debian</a>, <a href="https://openwrt.org/">OpenWrt</a>, <a href="https://f-droid.org/">F-Droid</a>. And
        security-focused alternatives such as <a href="https://www.openbsd.org/">OpenBSD</a> and <a href="https://qubes-os.org">QubesOS</a>,
        though be careful: some people jump into rather radical,
        demanding, and possibly experimental setups, do not study
        those sufficiently, run back into bloated and proprietary
        systems, and possibly keep switching between those. I
        personally use <a href="debian-11-workstation.html">Debian stable with Xfce</a>.
      </li>
      <li>
        Think twice before publishing or otherwise sharing any private
        or sensitive information, as it is practically irreversible.
      </li>
      <li>
        If you have to use public services and expose sensitive
        information (possibly correspondence) to them, prefer the ones
        that are not easily accessible by entities that can harm
        you. For instance, it would be reckless to discuss civil
        liberties over unencrypted email while living in a
        dictatorship and under surveillance, and using a domestic mail
        server on top of that.
      </li>
      <li>
        Rely on yourself, do not assume that arbitrary systems are
        properly designed and make sense: it may seem like systems
        (software, services) made by professionals are supposed to be
        that way, but often they are not. Not only because of
        programmers' incompetence or malice, but also because odd
        decisions are made when multiple developers, managers,
        multiple interacting commercial companies, poorly composed
        requirements, cost-cutting, hurried development and following
        changes, pressure to make things more "user-friendly" are
        involved: there can be mostly competent and well-meaning
        people creating an insecure mess. Common and visible issues
        include password restrictions, mandatory recovery mechanisms,
        their silly combinations with multi-factor authentication. So
        do not rely on others for security, try to ensure it yourself:
        do not hand them private information, use end-to-end
        encryption when applicable, ensure that the software does not
        run with unnecessarily high privileges, etc.
      </li>
      <li>
        Try to reduce the impact of possible compromises: do not "put
        all your eggs in one basket", do employ other risk management
        tactics. For instance, do not tie all your online accounts to
        a single email address, domain name, identity provider, or
        phone number. And reduce the amount of sensitive information
        that you have written down (even encrypted), especially on
        Internet-connected devices.
      </li>
      <li>
        Pay attention to incentives. Particularly marketing of
        security-related services or software, often employed by
        commercial companies, tends to focus on selling things that
        are free otherwise (such as X.509 certificates, usually called
        "SSL certificates" by those, many years after SSL was renamed
        into TLS), or features that are not particularly useful, but
        help them to stand out, since they are not used by others. At
        which point their usefulness may be exaggerated. Even
        non-commercial projects may engage in a light version of that,
        with their developers looking for ways to improve existing
        systems, convincing themselves that some properties they could
        add are desirable, then promoting them.
      </li>
      <li>
        Avoid unnecessary risks (complexity): as with engineering in
        general, the more complexity there is, the harder it is to
        analyze, and the more likely it is that something will go
        wrong. As an example, to turn on the lights, usually a basic
        mechanical switch would suffice: there is no need for complex
        controllers, Wi-Fi, Internet connection, some remote servers
        controlling your lights, and you asking them to operate those,
        using additional software. Yet such <a href="https://en.wikipedia.org/wiki/Rube_Goldberg_machine">Rube Goldberg machines</a>
        seem to be worryingly common these days. This is also related
        to unnecessary loss of control, and to poor availability,
        which is another aspect of security. In programming, this
        usually amounts to avoiding unnecessarily complex
        architectures and tools, as well as unnecessary dependencies.
      </li>
      <li>
        Employ proper (usually standard and built-in) mechanisms when
        available: database roles and security policies, system users
        (with properly set file permissions) and capabilities. Often
        those are neglected by programmers, who implement such
        mechanisms from scratch, usually poorly, with risks and
        consequences similar to implementing custom cryptographic
        software.
      </li>
      <li>
        Employ <a href="https://en.wikipedia.org/wiki/Defense_in_depth_(computing)">defense in depth</a>.
      </li>
      <li>
        Reduce the <a href="https://en.wikipedia.org/wiki/Attack_surface">attack surface</a>.
      </li>
      <li>
        Keep learning, extending and revising practices.
      </li>
    </ul><h2>Further application</h2><h3>Sharing</h3><p>
      Ensuring secure practices can be interesting and fun, and one
      may be enthusiastic about it, which helps to follow them. Then
      it is tempting to share that with others, improve their security
      practices, which is what I am trying to do by writing this. But
      keep in mind that people may simply not care about it, as many
      do not care about their health enough to take care of it, of
      environment (ecology, as well as politics), of self-improvement,
      and of a variety of other topics that yet others do care
      about. Even among those who do care about information security,
      the threat models and views on ways to achieve it may differ
      considerably, also as with the other mentioned topics. And it
      can be difficult to idly observe people you care about doing
      what you think is bad for them. I think a fine balance between
      being unhelpful and annoying is to let people know that you are
      willing to help, to answer and explain things when asked to, but
      not to try to force those onto others. And maybe to work on
      useful tools, infrastructure, and documentation in order to
      satisfy the impulses to share and help, as well as to learn more
      in the process.
    </p><h3>At work</h3><p>
      The same principles apply to information security in
      organizations, when setting company's servers or developing
      enterprise software. Just as with software and hardware
      generally. There may be more bureaucratic approaches (with
      occasional checklists for compliance checks), scales are
      different, NIST's frameworks are more useful there, but it is
      basically the same thing.
    </p></xhtml:div></content></entry>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/mobile-computing.html"/><id>https://thunix.net/~defanor/notes/mobile-computing.html</id><author><name>defanor</name></author><title>Mobile computing</title><summary>Experiences of doing computing on mobile devices</summary><published>2017-07-08T12:00:00Z</published><updated>2026-04-13T11:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Mobile computing</h1><p>
      Mobile computing can be a pain, especially when done in
      uncomfortable positions, on downsized and/or underpowered
      hardware, possibly in a noisy environment and while being
      distracted. Unsuitable conditions can also make it much harder
      to focus on computing-related activities. Yet a mobile computer
      is often better than nothing, and a comfortable workplace is not
      always available exactly where you want or need it to be.
    </p><p>
      These are my notes on dealing with mobile computers over time:
      mostly the software for underpowered computers with poor input
      and output capabilities, focusing on Linux-based systems.
    </p><h2>A netbook in 2017</h2><p>
      I've been stuck with an old netbook (Intel Atom, 1 GB of main
      memory) for a couple of weeks, so wrote down some of the things
      I've learned. That's on Debian stable (Stretch was just
      released; using it with "non-free" repositories to get GNU
      documentation), with i3 window manager, and using Emacs for most
      of the tasks.
    </p><p>
      Wi-Fi is one of the most important things to set. This time,
      both
      <code>wpa_cli</code> and <code>wicd</code> claimed that the password is
      wrong, but <code>nmtui</code> (NetworkManager TUI) has connected just
      fine – though maybe it has messed up some settings for others somehow.
      Wicd was hogging resources even while not doing anything useful, as Python
      programs tend to do, so I've disabled it – it rarely worked
      anyway. <code>wpa_supplicant</code> writes log messages such as "result=4"
      and doesn't document those codes in its man page, requiring source code to
      see what's going on. And NetworkManager just repeats those.
    </p><p>
      Firefox just starts for 30-40 seconds, and then lags even
      without JS. I gave up on it, and switched to w3m (emacs-w3m);
      web services such as online banking don't work with it, but it
      is keyboard-friendly, generally works, and does not lag too
      much. To use DDG for search, one should
      customize <var>w3m-search-default-engine</var>.
    </p><p>
      As for maps, there is FoxtrotGPS – an OpenStreetMap client that
      can cache and pre-download maps. It's pretty lightweight and
      usable.
    </p><p>
      For video playback, VLC appears to be more reliable than
      mplayer, even though has its issues (including bloating, lack of
      documentation, and resource hogging even while
      idle). Unfortunately, many videos are not available via
      bittorrent, being only hosted on youtube.com or similar
      websites; youtube-dl works to extract those.
    </p><p>
      One of the painful tasks to perform without a mouse is to copy
      and paste things between a terminal emulator and other programs
      (such as GUI Emacs).  Actually it's somewhat awkward with a
      mouse, but even worse without it.  Well,
      Emacs-to-terminal-emulator is easy: there are
      <kbd>M-w</kbd> to copy from Emacs and <kbd>shift + insert</kbd> to paste
      into a TE. Copying from a TE can be done by selecting with a touchpad, and
      then <kbd>M-: (mouse-yank-primary (point)) RET</kbd> in Emacs, though it
      won't work to insert into a TE; but turns out that one can emulate the
      middle mouse button by pressing the two touchpad keys simultaneously. It's
      not great, but works; perhaps a nicer way is to use a terminal multiplexer
      functionality for that, though then one may have to use nested terminal
      multiplexers, if they are also using those remotely. Or one could use an
      Emacs TE instead of a separate one, but that could also get awkward.
    </p><p>
      Speaking of terminal multiplexers: even though normally I'm not
      using <code>tmux</code>, it is more useful to run remotely with
      an unstable connection: a remote persistent session partially
      compensates for the lack of a persistent connection and/or local
      session.
    </p><p>
      Doing Haskell programming would be a pain on a netbook because
      the REPL and <code>cabal</code> would require too much of
      resources, so I've planned to use a remote server for that: just
      run both Emacs and a REPL process there. Didn't have to do that
      in those two weeks though.
    </p><p>
      xpdf, mupdf, and zathura are relatively lightweight and portable
      PDF viewers. Xpdf has ugly GUI buttons and a mostly useless left
      pane that takes space, others use partially qwerty-oriented
      (vi-style) key bindings (while I'm using Colemak), and the
      scrolling is quite messy in both mupdf and zathura (in mupdf,
      there's no way to tell whether you're at the end of a page or
      not, but scrolling by a little amount would jump a page if
      you're at the end; zathura may skip a line when scrolling with
      spacebar).  Both xpdf and mupdf allow to adjust colors, zathura
      doesn't. So I've used both mupdf and zathura, but then
      discovered Emacs pdf-tools; didn't try it on a netbook, but it
      works nicely on a desktop: the colors are adjustable,
      keyboard-friendly, no notable issues like those with scrolling
      in others.
    </p><p>
      Bittorrent clients are not so nice to set and use: both rTorrent and
      Transmission (transmission-daemon with transmission-cli) have broken Emacs
      interfaces, which I gave up on after brief attempts to debug, since using
      a netbook doesn't make debugging more fun. Transmission is nicer in that
      it uses a daemon, which is more suitable for a program like that. To
      simplify authentication, one should either use netrc
      (<code>.authinfo.gpg</code>), or disable authentication and only allow
      local connections:
    </p><pre>"rpc-authentication-required": false,
"rpc-bind-address": "127.0.0.1",</pre><p>
      Then it's not so bad to control
      with <code>transmission-remote</code>: <code>-a</code> and
      <code>-w</code> options to add a torrent and write files into a
      specified path, <code>-l</code> to list tasks, etc. The
      Transmission IRC channel (#transmission at Freenode/Libera.chat)
      is quite helpful, and minor bugs get fixed quickly there.
    </p><p>
      The situation with music players is pretty similar. I've tried
      mpd multiple times before, and it never worked, but worked this
      time (well, after <code>mpc update</code>); mpc is usable to
      control it, even if not that fancy (i.e., plain CLI). There are
      some Emacs packages: <code>emms</code> supports mpd, but tries
      to handle all kinds of players, so the support is not so
      great; <code>bongo</code> seems to have nicer UI, but doesn't
      support mpd at all; <code>mingus</code> appears to work, but it
      refreshes its whole buffer all the time, resulting in annoying
      blinking and rendering it unusable. And there
      is <code>ncmpc</code>, which is fine;
      though <code>ncmpc-lyrics</code> has a lot of dependencies,
      including Ruby. Music playback seems to be one of the most CPU
      intensive tasks in a system with relatively little bloat.
    </p><p>
      The rest of my regular software is keyboard-oriented and
      lightweight: mu4e with mbsync for mail, circe/erc/rcirc for IRC,
      bitlbee and circe (later rexmpp) for XMPP, org-mode for notes
      and things like that, and other Emacs-based and CLI/TUI tools.
    </p><p>
      Later, in 2023, I have installed Debian 12.2 with Xfce on it. It
      takes almost 600 MB of main memory, leaving 400 for work. But by
      2025, even Debian 13 dropped support for 32-bit systems.
    </p><h2>A tablet computer in 2022</h2><p>
      During the unfortunate events in Russia in the early 2022, I
      decided to finally get a tablet computer while they are still
      available here and while I can afford one. At first I've looked
      into ones supported by <a href="https://lineageos.org/">LineageOS</a>, but those were rather old
      ones, so I went for a model that is newer, and possibly can be
      supported later -- Samsung Galaxy Tab A8. I don't have much to
      compare it to (only used one Android phone out of similar
      devices, and just as a phone, for calls), but it appears to work
      and to be a tablet.
    </p><p>
      Samsung groups the awkward software required to be installed by
      the local government into the "law" group, so it's easy to
      remove it all at once. Avoiding Google and Samsung account
      creation, and aiming its usage as both a general household
      appliance (maybe for use in the kitchen, to read in bed, etc)
      and a useful device in an isolated wasteland if/when desktop
      computers will break and have no replacement, I've set <a href="https://f-droid.org/">F-Droid</a>
      by downloading its APK, and then installed most of the software
      from it (though occasionally with APKs from their official
      websites too): <a href="https://osmand.net/">OsmAnd</a> for maps (including offline ones, from
      OSM); <a href="http://koreader.rocks/">KOReader</a> (as I use on an e-ink
      reader), <a href="https://librera.mobi/">Librera</a>, <a href="https://opendocument.app/">OpenDocument Reader</a>, and <a href="https://www.kiwix.org/en/">Kiwix</a> to read
      things; <a href="https://www.videolan.org/vlc/">VLC</a> as a music and video player; Fennec (a Firefox
      version available from F-Droid); Sketches for basic sketching;
      Notes for note taking; a couple of fancier calculators with
      graphing; <a href="https://conversations.im/">Conversations</a> as an XMPP client; the Wikipedia client
      out of curiosity, but it turned out to be handy. Also Synthesia
      to try it out with a MIDI keyboard, which mostly worked, but
      that's proprietary. <a href="https://termux.dev/en/">Termux</a> provides plenty of regular GNU/Linux
      system functionality, including Emacs in its repositories.
    </p><h2>A laptop in 2022</h2><p>
      I hear that ThinkPad (IBM originally, Lenovo now) laptops are
      nice for Linux, but they are expensive; Dell and Lenovo ones are
      commonly suggested for Linux-based systems too. Lenovo IdeaPad
      seem to be Linux-compatible, but cheaper than ThinkPad, with
      less advanced I/O (targeting consumers, not businesses). Here is
      one of the articles on the topic, linking more: <a href="https://notes.volution.ro/v1/2022/04/remarks/41dc175e/">On modern laptop
      requirements</a>.
    </p><p>
      Issues with Wi-Fi hardware support are common; see <a href="https://wireless.docs.kernel.org/en/latest/en/users/drivers.html">Existing
      Linux Wireless drivers</a>, ensure that there are drivers for a
      given laptop's hardware. <a href="https://linux-hardware.org/">Linux Hardware Database</a> is another
      potentially helpful database.
    </p><p>
      One can also look into <a href="https://fwupd.org/lvfs/vendors/">fwupd's vendor list</a> to estimate Linux
      driver support from vendors, or perhaps the <a href="https://linux-laptop.net/">Linux on Laptops</a>
      website, and other erlevant websites linked from <a href="https://old.reddit.com/r/linuxhardware/">the
      linuxhardware subreddit</a>.
    </p><p>
      I've picked a relatively inexpensive Dell Vostro 3515, which
      seems suitable for non-gaming tasks and inexpensive: a 15.6-inch
      display, plastic, no discrete graphics card, Ryzen 5 3450U and 8
      GB of main memory (2 of those are used as video memory, leaving
      about 6 for the rest of the system), 512 GB SSD, and a
      8P8C/Ethernet port (many laptops don't have those anymore), in
      addition to the common set of I/O ports.
    </p><p>
      To boot from an USB stick with a Debian 11 installer, I tried to
      add it in the boot options in the UEFI menu, but that was rather
      confusing: it asked to choose an exact <code>.efi</code> file,
      and then failed with a "Something has gone seriously wrong:
      shim_init() failed" message. Apparently that's common on
      laptops, with different Linux distributions and laptop vendors,
      but I haven't found descriptions of any working solutions,
      except for installing an older version first. What worked for me
      is just to choose a different <code>.efi</code> file, and then
      hold F12 during the boot to enter a boot menu, selecting the USB
      stick from it.
    </p><p>
      I'm always uncertain about the size of a boot partition (and
      sometimes about that of the ESP partition too), and how exactly
      to set encryption (e.g., apparently one can encrypt even the
      boot partition while using grub, but it doesn't seem that
      useful, and would lead to double password prompts). And about
      the swap partition too: usually just disabling it, but perhaps
      it's more useful on a laptop, and it's commonly suggested to
      use. I've settled on about 500 MB for ESP
      (<code>/boot/efi</code>), 500 MB for <code>/boot</code>,
      encrypted swap and ext4 root partition (<code>/</code>), without
      a separate <code>/home</code>. Then tried Debian's guided
      partitoning, and it did exactly that (after selecting use of
      encryption and of a single partition), so I just went with
      it. Though as of 2024, some recommend 1 GB or 2 GB
      for <code>/boot</code>, with Ubuntu apparently defaulting to
      almost 2 GB, and it is likely to be a pain to change later in
      such a setup, without reinstalling everything. After updating to
      Debian 13, which suggests at least 768 MB for /boot, I recreated
      those, reducing EFI to 200 MB, and increasing the boot partition
      to 800 MB.
    </p><p>
      In this case it was a Debian Xfce Live version, with non-free
      software and documentation (just as for the <a href="debian-11-workstation.html">Debian 11
      workstation</a>). It is nice and almost everything works well out of
      the box, though DPI tends to be wrong on laptops: it is 96 by
      default, while laptop screens have something closer to 144. That
      can be adjusted in the "Appearance" settings, the "Fonts" tab. I
      have also adjusted the touchpad behaviour.
    </p><p>
      In 2023, after hardly any use, the laptop ceased to charge the
      battery (it is on the "pending-charge" status all the time, even
      at 0% charge, with any UEFI charging settings), unclear why. I
      have not found a way to fix it so far. Also attempts to update
      the UEFI/BIOS firmware via "BIOS flash update" lead to an
      "invalid file" error. Some suggest to run it from FreeDOS, but
      it relies on BIOS, and the laptop appears to only support UEFI
      boot. Another option is Windows (possibly the live and
      lightweight version, Windows PE), though microsoft.com bans
      Russian addresses from downloading it, and bans hoster addresses
      where proxies are hosted as well, as of 2023 (while dell.com
      also refuses to serve requests from Russian addresses, but
      proxies work with it). Plenty of images on The Pirate Bay (which
      is blocked in Russia, but at least does not refuse to serve
      requests coming from non-residential addresses, so proxies work)
      though. I managed to install Windows ADK on a Windows 10
      machine, then to prepare a Windows PE USB stick from it. Had to
      add firmware files into the "media" directory (actually added
      into a few locations, initially failing to find any), then to
      run <code>diskpart.exe</code> and its <code>rescan</code>
      command to find the firmware (I think it was on disk C). The
      firmware complained that "The AC adapter and battery must be
      plugged in before the system bios can be flashed", had to run it
      with <code>/forceit</code> option. Then it seemed to be working,
      but got stuck on "update progress: completed". I ended up
      resetting the laptop, then it complained that "battery pack is
      removed or less than 10%". I turned it off, unplugged the cable,
      plugged it back again, and the charging LED finally stayed
      on. Waited for half an hour, turned it on, it ran the BIOS
      (UEFI) and EC update process again, but then rebooted itself. It
      forgot where the boot media is, I pointed it manually to a
      Debian's <code>.efi</code> file again. Then it booted and was
      charging. Better to look for laptops with a sane firmware update
      process.
    </p><p>
      With this laptop, I have also experienced odd touchpad issues,
      which unfortunately seem quite common: in this case, it ceases
      to move the cursor after a seemingly random time after the boot,
      though clicking works, and it is fine again after a
      reboot. Sounds similar to <a href="https://askubuntu.com/questions/1233543/touchpad-stops-working-after-a-while">the "Touchpad stops working after a
      while" issue</a>, but there is no touchpad mode setting in this
      laptop's BIOS/UEFI settings. Later noticed that Bluetooth does
      not work well, either, at least with a Bluetooth speaker: there
      are occasional audible interrupts, and a stream of kernel module
      error messages in the logs.
    </p><h2>A smartphone in 2022</h2><p>
      I acquired a Google Pixel 6a (not exported here officially, so
      without a warranty, and no spare parts available; but at least
      not certified in Russia, so no mandatory malware installed on
      it), which has a plain Android system, and is supported by most
      of the alternative Android distributions. The software to set on
      it is similar to that on a tablet: F-Droid (with Guardian
      Project repositories), then Conversations, ConnectBot, OsmAnd+
      (with pale road style, 150% text size), Compass
      (com.bobek.compass), Wikipedia, VLC, Fennec (+ uBlock Origin,
      noscript, HTTPS everywhere), Tor Browser (with a bridge set
      manually), Notes, Librera, Yaaic, Termux (with Emacs on it, as
      well as openssh and rsync, and allowing it access to storage, so
      that pictures and other files can be transferred over SSH with
      rsync: for instance, to synchronize the pictures -- <code>rsync
      -av -e 'ssh -p 8022' --exclude='.trashed-*'
      user@host:storage/dcim/OpenCamera/
      ~/Pictures/OpenCamera/</code>; but by 2025 it ceased to work,
      since Android increasingly locks everything down). Later I added
      strongSwan and WG Tunnel (to connect to a home network as a
      "road warrior") and baresip (though still mostly using
      Conversations for calls), Just Another Workout Timer, Open
      Camera, WiFiAnalyzer, Kiwix, Aegis Authenticator (hOTP/TOTP),
      Orgzly (an org-mode viewer/editor), Material Files (a file
      manager with WebDAV, FTP, SFTP, SMB support), a couple of games
      (Shattered Pixel Dungeon, Mindustry), K-9 Mail, Briar.
    </p><p>
      The camera on this phone appears to produce rather bleak (washed
      out, desaturated) pictures, which is particularly apparent after
      enabling raw (DNG) picture writing. There are multiple ways to
      saturate it in darktable, but "tone curve" with independent
      CIELAB channels in particular is handy and versatile; the
      "denoise" module then helps to get rid of the produced
      noise. Perhaps one may also change the input color profile:
      colors look almost fine with sRGB instead of the embedded one;
      apparently it is a common problem with Pixel phones, see
      "<a href="https://discuss.pixls.us/t/colours-washed-out-from-pixel-7-dng/38455">Colours washed out from Pixel 7 DNG</a>".
    </p><h2>A laptop in 2026</h2><p>
      <a href="https://linux-hardware.org/?probe=e087c08de0">Lenovo IdeaPad Slim 3 16AHP10</a> looks like a fine option: the I/O
      is not as good as on ThinkPad or IdeaBook ones, but it is
      inexpensive, has a power-efficient CPU, okay specifications, and
      Debian runs well on it. I have set it to "battery saving mode"
      in the UEFI settings, booted from a Debian live Xfce USB stick,
      partitioned its 512 GB disk on installation (using Debian's
      regular installer, not the GUI Calamares one) as follows: 1 GB
      for ESP, 1 GB for <code>/boot</code>, then LUKS with LVM on top:
      80 GiB for the root file system, the rest for home; used ext4
      this time, with <code>noatime,nodiratime</code> mount options
      (see <a href="https://wiki.debian.org/%20SSDOptimization">SSDOptimization in Debian Wiki</a>). Then have set a more
      suitable DPI (142 for a 16-inch screen with 1920 by 1200
      resolution; see also: <a href="https://wiki.archlinux.org/title/HiDPI">Arch Wiki HIDPI</a>, <a href="https://wiki.debian.org/MonitorDPI">Debian Wiki
      MonitorDPI</a>, <a href="https://wiki.archlinux.org/title/LightDM#HiDPI_or_4K_configuration">Arch Wiki LightDM HIDPI</a>) and larger fonts (12) in
      Xfce settings, as well as <code>xft-dpi=142</code>
      in <code>/etc/lightdm/lightdm-gtk-greeter.conf</code>,
      ran <code>sudo dpkg-reconfigure console-setup</code> to set a
      larger tty font size (DejaVu, 16x30),
      added <code>/usr/bin/setxkbmap -option "ctrl:nocaps"</code> into
      Xfce startup commands (another option is to set it
      via <code>/etc/default/keyboard</code>,
      e.g.: <code>XKBOPTIONS="ctrl:nocaps,grp:shifts_toggle"</code>,
      <code>XKBLAYOUT="us,us,ru"</code>, <code>XKBVARIANT="colemak,,"</code>),
      have set locale to <code>C.UTF-8</code>
      in <code>/etc/locale.conf</code>, disabled the loud PC speaker
      with
      <code>sudo rmmod pcspkr &amp;&amp; echo 'blacklist pcspkr' |
      sudo tee /etc/modprobe.d/nobeep.conf</code>, set additional DNS
      servers (74.82.42.42, 208.67.222.222, 8.8.8.8) for
      NetworkManager, installed a few Firefox extensions (uBlock
      Origin, noscript, FoxyProxy), configured input methods and
      touchpad behavior in Xfce settings, configured some of its
      panels, generated an SSH key with <code>ssh-keygen</code>, added
      it to the agent with <code>ssh-add ~/.ssh/id_ed25519</code>,
      disabled menu access keys in Xfce terminal preferences (so that
      it does not intercept shortcuts like M-f), removed some of the
      unnecessary packages, installed useful ones, configured a little
      more:
    </p><pre>sudo apt install task-laptop task-english smartmontools dkms
sudo apt remove live-task-localisation live-task-localisation-desktop
sudo apt autoremove
sudo apt remove 'hunspell*'
sudo -e /etc/apt/sources.list # Add "contrib non-free non-free-firmware"
sudo apt update
sudo apt install systemd-timesyncd openssh-server rsync emacs mu4e isync git \
  elpa-{magit,haskell-mode,nov} ghc cabal-install texinfo mtr-tiny \
  mpv vlc telnet xsltproc clementine lynx mutt irssi whois nmap ncat dnsutils \
  knot-dnsutils tmux fbreader inkscape gimp lmms musescore libxml2-utils \
  xkcdpass wireguard tinc tor obfs4proxy shadowsocks-libev kiwix kiwix-tools \
  autoconf autoconf-doc libtool pkgconf libexpat1-dev libgsasl-dev \
  libssl-dev libcurl4-openssl-dev build-essential dino-im goldendict \
  dict-freedict-{deu-eng,fra-eng,lat-eng,eng-rus,deu-rus,fra-rus,eng-deu}  \
  dict-gcide transmission pandoc audacity festival sox postgresql \
  nginx libnginx-mod-http-dav-ext aptitude jmtpfs emacs-common-non-dfsg \
  texlive texlive-plain-generic texlive-xetex texlive-lang-cyrillic \
  blueman sqlite3 libsqlite3-dev gcc gcc-doc glibc-doc-reference \
  python3-{sympy,scipy,numpy,matplotlib,psycopg,doc} \
  info guile-3.0 guile-3.0-doc oathtool iotop
# ... darktable blender librecad freecad kicad evince
# prosody coturn uacme inspircd mumble-server mumble qemu-system
# libvirt-clients libvirt-daemon-system virtinst dnsmasq-base bridge-utils
# debian-reference-en debian-kernel-handbook linux-doc user-mode-linux-doc
sudo -e /etc/ssh/sshd_config # "PasswordAuthentication no"
# Disable some services: going to run them manually, as needed.
sudo systemctl disable --now tor tinc shadowsocks-libev nginx postgresql \
  bluetooth
killall pulseaudio # restart to load pulseaudio-module-bluetooth
# (for PipeWire, use libspa-0.2-bluetooth instead)
# Optionally, upload hardware information to the linux hardware database
sudo hw-probe --all --upload
# Enable battery conservation mode (remembered between boots),
# so it does not charge above 80%.
# Also can be done with TLP, STOP_CHARGE_THRESH_BAT0=1.
echo 1 | sudo tee /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode</pre><p>
      Then it was left to copy personal files (dotfiles, documents,
      books, music, etc) onto it, and configure things further, but
      this is a basic initial setup.
    </p><p>
      One may try to select "Advanced install options", "Text
      installer", "Expert Install" in the installer, so that there
      will be an option to install a "normal" system instead of
      "live", but it still installs some of those "live-task"
      packages.
    </p><p>
      Though the hardware seems to work well generally, eventually I
      noticed an I/O error during reading from its SSD, reporting a
      timeout and a controller reset, similar to "<a href="https://askubuntu.com/questions/1557696/ubuntu-24-04-freezes-with-nvme-nvme0-i-o-timeout-error">Ubuntu 24.04 freezes
      with "nvme nvme0: I/O" timeout error</a>" or "<a href="https://community.frame.work/t/nvme-timeout-woes/54999">NVME timeout woes</a>";
      have not tried adding <code>pcie_aspm=off</code> or
      <code>nvme_core.default_ps_max_latency_us=100
      nvme_core.io_timeout=3000</code> into /etc/default/grub myself,
      yet, but probably will try it, if it will keep
      happening. Apparently those things happen on some laptops. While
      Wi-Fi, Bluetooth, touchpad, and SD card reader work smoothly.
    </p><p>
      I have also set Debian 13 and Windows 11 on another 16AHP10
      laptop (not for myself), and surprisingly, while Wi-Fi worked on
      Debian out of the box, it required to manually install drivers
      on Windows.
    </p><h2>E-readers</h2><p>
      Kobo devices are supported by <a href="https://github.com/koreader/koreader">Koreader</a>, among a few
      others. Apparently both Kobo and reMarkable are suitable for
      running Linux and custom software on them; see "<a href="https://rmkit.dev/eink-is-so-retropunk/">E-ink is so
      Retropunk</a>".
    </p><h2>Power</h2><p>
      Some devices, particularly infrequently used and mostly
      stationary ones, such as radio receivers, may be awkward to
      power: batteries may be wasteful for stationary ones, and
      inconvenient to keep in a usable state for infrequently used
      devices, while inbuilt cheap AC-to-DC converters are unreliable
      and occasionally humming, and mimicking batteries with external
      AC-to-DC converters is tricky (they tend to provide higher
      voltages than 1.5 V of common batteries, and connecting those
      snugly would be tricky). A good option is to pick devices
      relying on external AC-to-DC converters, as laptops, phones, and
      e-readers do: it is usable for both direct usage and battery
      recharging, and battery chargers can be very simple, not adding
      complexity; many devices use USB for DC power input these days.
    </p><p>
      By 2026, there are laptops supporting USB-C for power input.
    </p></xhtml:div></content></entry>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/email.html"/><id>https://thunix.net/~defanor/notes/email.html</id><author><name>defanor</name></author><title>Email</title><summary>Email usage notes, including mail server maintenance</summary><published>2016-06-28T12:00:00Z</published><updated>2026-03-29T09:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Email</h1><p>
      I quite like email: perhaps not so much because of its design or
      technical qualities, but because nice tools exist and there are
      plenty of users, so it can be used for communication
      easily. Though even the design is not bad: SMTP by itself is
      quite usable, OpenPGP is better than plain text messages (though
      could be much better, and there is criticizm), it is all open
      and federated. Some of the email criticizm goes as far as to
      propose to replace it with something, but without proposing any
      viable alternative, so it does not seem like the time to abolish
      it yet, and here are some email-related notes.
    </p><h2>Server</h2><ol>
      <li>Configure (and install if needed – though usually it's
        present, but barely used) <a href="http://www.postfix.org/">Postfix</a> or other <a href="https://en.wikipedia.org/wiki/Message_transfer_agent">MTA</a>. There are
        guides around, it is pretty simple, and actually that's it:
        the rest builds around it.</li>
      <li>To not look like a spammer to other servers:
        <ul>
          <li>Set <a href="https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail">DKIM</a>: DNS record and <a href="http://www.opendkim.org/">OpenDKIM</a></li>
          <li>Set <a href="https://en.wikipedia.org/wiki/Sender_Policy_Framework">SPF</a> DNS record</li>
          <li>Set <a href="https://en.wikipedia.org/wiki/DMARC">DMARC</a> DNS record</li>
          <li>Set <a href="https://en.wikipedia.org/wiki/Reverse_DNS_lookup">reverse DNS</a> records</li>
          <li>Get into <a href="https://www.dnswl.org/">DNSWL</a></li>
          <li>If IPv6 is used, make sure that a /64 subnet is assigned (as
            per <a href="https://tools.ietf.org/html/rfc6177">RFC6177</a>)</li>
        </ul>
      </li>
      <li>To filter spam, set <a href="http://www.postfix.org/POSTSCREEN_README.html">postscreen</a> and regular Postfix settings
        (see <a href="http://jimsun.linxnet.com/misc/postfix-anti-UCE.txt">Postfix Anti-UCE Cheat Sheet</a> and <a href="http://rob0.nodns4.us/postscreen.html">rob0's postscreen(8)
        configuration</a>; a local caching DNS server is useful to speed
        things up a bit). It works well to filter the spam,
        while <a href="https://spamassassin.apache.org/">spamassassin</a> (via <a href="https://savannah.nongnu.org/projects/spamass-milt/">spamass-milt</a>, for instance) may hog
        too much memory for a small VM, leading to OOM killer
        rage. Other options include <a href="http://bogofilter.sourceforge.net/">bogofilter</a>, which would require
        training, and <a href="https://www.rspamd.com/">Rspamd</a>. <a href="http://postgrey.schweikert.ch/">Postgrey</a> may also be used.</li>
      <li><a href="https://letsencrypt.org/">LE</a> to obtain <a href="https://en.wikipedia.org/wiki/X.509">X.509</a> certificates for <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">TLS</a>. ACME clients are
        mostly poor, but <a href="https://github.com/ndilieto/uacme/">uacme</a> and <a href="https://certbot.eff.org/">certbot</a> are fine after some
        tweaking (particularly setting them to run as a dedicated
        user, rather than root).</li>
      <li><a href="http://dovecot.org/">Dovecot</a> or something else for IMAP, possibly for SMTP
        submission, and/or synchronization over SSH (optionally: as an
        alternative, one can read messages via ssh on a server,
        retrieve them into a local maildir with rsync, or just read
        and compose them on the server).</li>
      <li>Optionally, set <a href="https://wiki.gnupg.org/WKD">Web Key Directory</a>, <a href="https://en.wikipedia.org/wiki/DNS-based_Authentication_of_Named_Entities">DANE</a> (<a href="https://tools.ietf.org/html/rfc7929">RFC 7929</a>), or other
        OpenPGP key discovery method.</li>
    </ol><p>
      Dovecot can also be used for SASL (for both Dovecot and
      Postfix). See the <a href="private-server-setup.html">private server setup</a> and <a href="simpler-server-setup.html">simpler server setup</a>
      documentation for more precise instructions, and possibly the
      "<a href="user-authentication.html">user authentication</a>" note for more options.
    </p><h3>IPv6 and DNSBLs</h3><p>
      DNSBL records appear for no apparent (or discoverable) reason in
      spamhaus's CSS blacklist (part of ZEN), /64 IPv6 subnets at
      once; delisting procedure is automated but complicated by Google
      captcha and partially broken (it reports success without
      actually delisting, and sometimes reports a captcha error even
      after solving the captcha, which is quite hard when using
      Tor). See also: <a href="http://forum.spamcop.net/topic/21566-blacklisted-by-spamhaus-sblcss/">Blacklisted by Spamhaus SBLCSS</a>.
    </p><p>
      One way to mitigate it is to stick to
      IPv4: <code>smtp_address_preference = ipv4</code>
      in <code>/etc/postfix/main.cf</code>. Another one is to get a
      /64 IPv6 subnet, assuming that they don't just blacklist subnets
      at random.
    </p><h3>Being marked as spam</h3><p>
      Gmail (and maybe other large email providers) would occasionally
      mark/hide messages coming from smaller servers (and/or just not
      from themselves) as spam, even with SPF, DKIM, whitelists,
      messages being sent/delivered from them to you first. Not much
      can be done about it: once a mail server accepts a message, it
      is its responsibility to deliver it. Large commercial companies
      just keep messing up interoperability, as they always do.
    </p><h3>Spam that gets through</h3><p>
      Not much spam gets through with just configured Postfix and
      postscreen, but when it does, it should be possible to report
      the abuse to its ISP.  Though spam from those who accept such
      reports and resolve the issues is unlikely, and as a last resort
      there are <code>client_checks</code> (or a firewall) to reject
      messages from spammy IP addresses or subnets. But one should be
      careful with that, since it is rather frustrating (and all too
      common) when you're a good actor being treated as a bad one.
    </p><p>
      Dealing with spam coming form large providers is about as tricky
      as sending messages to them: they deliver spam just as regular
      messages, don't get blacklisted by honeypots automatically, and
      you proboably don't want to blacklist them manually because of
      all the legitimate users. Yet Gmail's abuse report form seems to
      be broken (simply nothing happens when I hit "submit": no
      network requests or UI changes, even with JS enabled), and their
      support is infamousely unreachable even by their own users. Then
      there's IP address's abuse contact (ripe-contact@google.com),
      but since they are their own hoster, it's probably also broken
      (as with the web UI, there's no visible reaction, not even
      automated; though at least there's a possibility of it working).
    </p><p>
      For more on incoming spam, see my <a href="network-abuse.html">network abuse</a> notes.
    </p><h3>Port 25 redirection</h3><p>
      Residential ISPs tend to block incoming SMTP connections, which
      is supposed to stop spam somehow, but if it was not for that, an
      IP address without NAT (and preferably static) would be
      sufficient at least to receive email directly, without a remote
      server. To get around that, there are services for port
      redirection, though I have not tried any, and they seem to be
      odd and/or to cost about as much as a remote VM (similarly to
      paid email).
    </p><h2>Client</h2><p>
      Both <a href="http://notmuchmail.org">notmuch</a> and <a href="http://www.djcbsoftware.nl/code/mu/mu4e.html">mu4e</a> use <a href="http://xapian.org/">xapian</a>, which provides fast search. It
      is also nice to compose and read messages in <a href="https://www.gnu.org/software/emacs/">Emacs</a> (unless you
      are a vi user, perhaps), so I target those.
    </p><p>
      Some prefer mutt, which has a simpler configuration, and less
      modular, more self-contained. But its default key bindings are
      based on those of Vim, QWERTY-oriented, which is awkward if you
      use a different keyboard layout. Thunderbird is quite bloated,
      but perhaps more suitable for casual users, including mail
      services that require OAuth. It also supports OpenPGP now, but
      Maildir is not quite supported. Evolution looks similar to
      Thunderbird. Claws Mail looked odd and half-baked all around to
      me each time I tried it over the years, but it is a relatively
      lightweight GUI client, supporting OpenPGP and Maildir, but not
      OAuth, being similar in that to most other lightweight
      clients. But I focus on simpler Emacs clients (such as mu4e) in
      the following sections.
    </p><h3>Option 1: IMAP + SMTP</h3><p>
      <a href="http://isync.sourceforge.net/mbsync.html">mbsync</a> can be used to retrieve messages via IMAP, and Postfix
      can also be set locally to get more flexibility and better SASL
      options than emacs <code>smtpmail</code> library provides (see
      the <a href="user-authentication.html">user authentication</a> note).
    </p><h3>Option 2: SSH</h3><p>
      SSH-only setup allows to use just SSH keys, with no SMTP or IMAP
      between client and server. Messages can be sent with a remote
      sendmail, while a remote Maildir can be accessed via sshfs, or
      messages can be retrieved with, for instance, <a href="https://wiki2.dovecot.org/Tools/Doveadm/Sync">doveadm sync</a>. An
      example with relevant mu4e context variables:
    </p><pre>(message-send-mail-function   . message-send-mail-with-sendmail)
(sendmail-program             . "/home/defanor/bin/example-sendmail.sh")
(mu4e-get-mail-command        .
,(concat "doveadm sync sh -c "
"\"SSH_AUTH_SOCK=$SSH_AUTH_SOCK ssh mail.example.com doveadm dsync-server\""))</pre><p>
      And <code>example-sendmail.sh</code>:
    </p><pre>#!/bin/sh
ssh mail.example.com /usr/sbin/sendmail "$@"</pre><p>
      Though an issue with this method of synchronisation (as
      described here, without additional customisations) is that
      messages removed from <code>mu4e</code> would be reloaded
      by <code>doveadm sync</code>, and one would have to
      use <code>doveadm search</code> and <code>doveadm expunge</code>
      instead, or switch to IMAP for cleanup. Or use the sshfs method.
    </p><p>
      Another caveat is that even setting the remote sendmail script
      as <code>sendmail</code> in <code>$PATH</code> won't necessarily
      make all the programs to use it: for instance, git would still
      require to set it explicitly (in <code>.gitconfig</code> or as a
      command-line argument), as "smtp-server":
    </p><pre>[sendemail]
    smtpServer = /home/defanor/bin/example-sendmail.sh</pre><p>
      Later it turned out to be handy to set mail sending this way,
      while retrieving it via IMAP, when a public provider (Yandex)
      that I used for work email with my own domain, to avoid
      dependencies on a personal server, decided to charge for using a
      custom domain and disabled SMTP. That way, the work server does
      not have to accept SMTP connections still, and it was already
      configured to send mail notifications from local clients (for
      both a website hosted there and munin), while incoming mail is
      handled as it used to be.
    </p><h3>OpenPGP</h3><p>
      GnuPG can be used with mu4e (and perhaps most of the other
      common Emacs MUAs) out of the box, does not require any special
      setup.
    </p><h3>mu4e with git</h3><p>
      While <code>git-send-email(1)</code> bypasses mu4e, receiving
      patches still requires to point git (or another DVCS) to a
      message that is normally first seen in one's MUA. I find it
      handy to define a custom mu4e message action that simply
      does <code>(kill-new (mu4e-message-field msg :path))</code>, so
      that the result can then be fed into <code>git-am(1)</code>.
    </p><h3>MIME part detachment</h3><p>
      Sometimes people attach large files (particularly
      high-resolution images of their pets) to messages, which quickly
      inflate the total mail archive size, complicating their backups
      and migrations. When the messages also contain texts, it is
      undesirable to remove the correspondence, but some MUAs can
      remove individual parts. Particularly mutt can: backup the
      maildir, save the attachments separately if needed, <code>mutt
      -f maildir-path</code>, then open a message, <code>v</code> to
      view attachments, select an image, <code>d</code> to delete
      it. Then one may have to rebuild indexes, synchronize messages.
    </p><h2>Etiquette</h2><p>
      While there are different views and advices on email etiquette,
      relatively common ones are to use plain text, to properly quote
      relevant parts of messages when needed, to avoid bloating
      messages with signatures, and of course to adhere to general
      writing practices. Or, in other words, to be considerate and
      make minimal assumptions about readers' MUAs. <a href="https://www.ietf.org/rfc/rfc1855.txt">RFC 1855
      (Netiquette Guidelines)</a> is worth reading.
    </p><h2>Public providers</h2><p>
      With seemingly decent email providers (e.g., <a href="https://fastmail.com/">fastmail.com</a>
      (banned in Russia), <a href="https://www.migadu.com/">migadu.com</a>), accounts cost like a hosted VM
      (VPS, VDS, or whatever they are called this year) or more, so it
      may be desirable to get a remote VM at once. Although there are
      slightly cheaper (or even partially free) ones as
      well: <a href="https://mailbox.org/">mailbox.org</a> (blocked in Russia), <a href="https://runbox.com/">runbox.com</a>, <a href="https://mailfence.com/">mailfence.com</a>
      (also blocked in Russia), <a href="https://posteo.de/en">posteo.de</a>, maybe <a href="https://www.mailo.com/">mailo.com</a> (blocked in
      Russia). As for free ones, there is a few seemingly fine
      options, though usually they don't seem that nice after an
      attempt to use them; the ones commonly advertised as secure
      and/or ethical tend to not even provide SMTP and/or IMAP, not to
      mention SSH. Domain registrars tend to provide email services,
      though the quality varies. And there are ones like <a href="http://sdf.org/">sdf.org</a> and
      other pubnixes, including tildeverse ones, financed primarily
      with donations. Also <a href="https://disroot.org/">disroot.org</a>, <a href="https://dismail.de/">dismail.de</a> (no new
      registrations since 2021-05-28 though), <a href="https://riseup.net/">riseup.net</a> (rather
      politicized, blocked in Russia).
    </p><p>
      In 2024, I registered at Microsoft's hotmail.com, but my account
      (which only received one confirmation message from
      OpenStreetMap) was locked in a couple of days, with Microsoft
      claiming that it violated an unidentified part of the agreement,
      and that they need my phone number in order to resolve
      it. Apparently <a href="https://old.reddit.com/r/microsoft/comments/1aurot8/your_account_has_been_locked/">people who provide their phone numbers are
      unexpectedly locked out of Microsoft accounts as well</a>, and there
      are regular stories like that about Google's Gmail, too. Though
      it also looks like many people do manage to use those larger
      services. As mentioned above, I ran into an unpleasant change of
      service terms with Yandex as well. Also receiving Gmail spam,
      reporting it, but spam from the same addresses keeps coming
      afterwards. Interaction with those larger commercial IT
      companies is generally a bad experience.
    </p><h2>On reliability</h2><p>
      My primary concern with using private email for everything has
      been that regarding reliability, which is actually broader than
      just email. And if it is set on a single machine that you also
      use for everything else, that is a single point of failure for
      many things.
    </p><p>
      There are potential issues with public services as well: the
      companies that maintain those can go out of business, usually
      can do whatever they want with user accounts and data (commonly
      selling the data, <a href="https://news.ycombinator.com/item?id=30051054">messing up authentication and blocking
      accounts for strange reasons, with no way to contact customer
      support</a>, <a href="http://news.bbc.co.uk/2/hi/science/nature/2138014.stm">sometimes mangling messages</a>, restricting access to
      accounts until you provide more of personal data after a policy
      change), with the services they provide (including turning
      unlimited plans into limited ones, free into paid, cheap into
      more expensive), etc. Even technical issues with larger services
      may be equally or more common: though they have dedicated staff,
      larger setups tend to be considerably more complex and unusual,
      hence less reliable.
    </p><p>
      But private ones require regular payments and maintenance. It is
      not much harder than maintaining your personal machine, and
      usually cheaper than paying for an internet connection,
      electricity, and so on, but it is an additional burden. Very
      small one, but collecting things like that is always unpleasant:
      there is no shortage of other ways to get into trouble simply by
      staying idle.
    </p><p>
      Using 2-3 servers instead of one and teaming up with others (for
      both payments and maintenance) may be helpful to mitigate those
      issues, but that requires some trust. That is a hard part, since
      not many people seem to care about service providers, control,
      etc. Maybe it is a good approach though: worrying about all the
      small things and possibilities may be too much, whether one uses
      a private or a public service.
    </p><p>
      It is particularly unfortunate when other online services depend
      on email, allowing email-based account recovery: that way, the
      loss of an email address compromises those accounts as
      well. Sometimes it is possible to set a two-factor
      authentication, with the second factor being something
      relatively sensible, like TOTP, effectively disabling
      email-based account recovery that way, since that usually only
      allows to reset the password.
    </p></xhtml:div></content></entry>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/music-studies.html"/><id>https://thunix.net/~defanor/notes/music-studies.html</id><author><name>defanor</name></author><title>Music studies</title><summary>Music theory, practice, and software</summary><published>2022-03-13T09:00:00Z</published><updated>2026-03-22T09:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Music studies</h1><p>
      While music itself is pleasant to listen to, the theory behind
      it, along with maths for processing or synthesizing it, as well
      as the process of performing it, can be quite fun.
    </p><h2>Music theory</h2><p>
      <a href="https://eev.ee/blog/2016/09/15/music-theory-for-nerds/">Music theory for nerds</a> is a great starting point. "<a href="https://dmitri.mycpanel.princeton.edu/files/pdfs/MUS105handouts.pdf">What Makes
      Music Sound Good?</a>" is another overview and introduction,
      though perhaps more opinionated.
    </p><p>
      Some of the related and interesting research areas are those of
      music origin and purpose, such as <a href="https://en.wikipedia.org/wiki/Evolutionary_musicology">evolutionary musicology</a>, and
      how it's perceived by humans: <a href="https://en.wikipedia.org/wiki/Psychoacoustics">psychoacoustics</a>, <a href="https://en.wikipedia.org/wiki/Music_psychology">music
      psychology</a>, <a href="https://en.wikipedia.org/wiki/Music_and_emotion">music and emotion</a>.
    </p><p>
      The <a href="https://news.ycombinator.com/item?id=35272536">Ask HN: Tools to learn music theory?</a> discussion contains a
      few more relevant links.
    </p><p>
      <a href="https://openmusictheory.github.io/">Open Music Theory</a> looks like a nice textbook.
    </p><p>
      <a href="computing-context.html">As with computing</a> and maths, it is useful to study history of
      the subject as well, so that more of it will make sense, and it
      will be easier to put into a perspective. Videos on history of
      music can be found on YouTube, as well as on PeerTube, where
      some of the <a href="https://www.pianotv.net/">PianoTV</a> videos are available.
    </p><h2>Generation and processing</h2><p>
      The <a href="https://en.wikipedia.org/wiki/Pulse-code_modulation">PCM</a> format is to audio basically what <a href="https://en.wikipedia.org/wiki/Netpbm">netpbm/PPM/PGM/PBM/PNM</a>
      is to graphics: very simple and straightforward, can be played
      with ffplay and others, easy to generate programmatically and
      write into a file without any encoder libraries, as well as to
      read without a special decoder. Audio I/O libraries (e.g.,
      PortAudio) and codec libraries (e.g., libopus) tend to work with
      it.
    </p><p>
      DCT/DFT are often involved in processing (and in compression,
      also similarly to graphics), Mel-frequency cepstrum can be
      useful and/or interesting to look into.
    </p><h2>Analysis</h2><p>
      Audacity is handy for checking the spectrum and notes in it, for
      music transcription and other checks.
    </p><h2>MIDI keyboard</h2><p>
      To practice playing piano using a MIDI keyboard, one needs at
      least a software synthesizer and some music scores.
    </p><p>
      The keyboard in this case is M-Audio Keystation 88 MK3, which
      worked easily with Linux (5.10, Debian), Windows 10, and an
      Android tablet (Samsung Galaxy Tab A8, connected with a
      USB-A-to-USB-C adapter). For a synthesizer, I've used Yoshimi on
      Linux, LMMS (mostly with its sf2/soundfont plugin) on Linux and
      Windows, and Synthesia (not in F-Droid repositories, and I don't
      have a Google account, but grabbed an apk from their website) on
      Android.
    </p><p>
      MuseScore allows to compose sheet music and export it into MIDI
      rather quickly and easily, and there are more editors and
      converters of that kind available from Debian repositories.
    </p><p>
      PianoBooster looks like a nice trainer, akin to GNU Typist, but
      I found it quite annoying that it counts it as a mistake if you
      press a key too soon, so switched back to just reading scores
      and playing from those.
    </p><p>
      I use my computer screen to read sheet music, with the keyboard
      stand placed behind my computer chair, so it has to be zoomed in
      (Xfce's zooming in is quite handy when software can't zoom in on
      its own), and scrolling is needed for larger compositions, but
      the regular computer keyboard and mouse are out of reach. The
      MIDI keyboard has directional keys, messages from which come
      from a separate MIDI port; I haven't found readily available
      software (possibly LMMS plugins) helping to scroll the notes
      from a MIDI keyboard, but it took just a small script to
      achieve:
    </p><pre>import mido
from xdo import xdo

# apt install python3-mido python3-xdo libportmidi-dev python3-rtmidi

# perhaps can be done in bash, with something like amidi + xdotool

# https://gitlab.com/dkg/python-xdo/-/blob/main/xdo/__init__.py
# https://gitlab.com/cunidev/gestures/-/wikis/xdotool-list-of-key-codes

# print(mido.get_input_names())

mapping = {
    96: 'Page_Up',
    97: 'Page_Down',
    98: 'Left',
    99: 'Right',
    100: 'space'
}

x = xdo()

with mido.open_input('Keystation 88 MK3:Keystation 88 MK3 MIDI 2 24:1') as port:
    for msg in port:
        # print(msg)
        if msg.note in mapping and msg.velocity == 127:
            x.send_keysequence_window(mapping[msg.note])</pre><p><a href="https://pianoguidelessons.com/fingering-scales-on-the-piano/">Fingering Scales on the Piano</a> is a handy outline.</p><h2>Sheet music</h2><p>
      <a href="https://imslp.org/">IMSLP.org</a> is a nice source of public domain or otherwise freely
      available scores (including solo piano
      arrangements). Additionally, there are MIDI music collections
      around, which are lightweight, but encode melodies, which can
      then be viewed as scores (e.g., with MuseScore 2). <a href="https://musopen.org/sheetmusic/">Musopen</a> also
      provides sheet music, as well as recordings of classical music.
    </p><h2>Composition</h2><p>
      Music composition seems to be rather similar to poetry, and to
      arts in general: a creative process, but one can reuse a <a href="https://en.wikipedia.org/wiki/Musical_form">musical
      form</a>, learn and use a variety of approaches and tricks (by
      analyzing existing works, in addition to just reading about
      techniques), experiment and try things out.
    </p><p>
      <a href="https://en.wikipedia.org/wiki/Music_appreciation">Music appreciation</a> seems useful to study as well; "<a href="https://www.youtube.com/@InsidetheScore">Inside the
      Score</a>" is one of the YouTube channels focusing on that.
    </p><p>
      <a href="https://www.youtube.com/c/RyanLeach/about">Ryan Leach on YouTube</a> makes nice videos explaining the
      composition process. <a href="https://www.youtube.com/c/DavidBennettPiano">David Bennett Piano</a> brings up plenty of
      interesting subjects and analyzes songs.
    </p><h2>On singing</h2><p>
      While I don't sing, a brief look into it suggests that as with
      most of other skills, it's primarily about learning and
      practicing, exercising.
    </p><p>
      Yet even without singing, it is interesting to learn about <a href="https://en.wikipedia.org/wiki/Vocal_register">vocal
      registers</a> and related topics.
    </p><p>
      Possibly it is a wrong way to learn and practice, but I found it
      fun to set a tuner program on a phone (e.g., <a href="https://f-droid.org/packages/org.billthefarmer.tuner/">Tuner</a> from F-Droid
      repositories), and try hitting notes.
    </p><h2>Ear training</h2><p>
      For Android, there is the Open Ear program, available from
      Android: seems to be a little buggy (making noises), but allows
      to practice recognition of scale degrees.
    </p><p>
      The <a href="https://www.musictheory.net/">musictheory.net</a> website also provides exercises, including
      those for ear training. A similar one to train playing from
      memory is <a href="https://lend-me-your-ears.specr.net/">lend-me-your-ears.specr.net</a>.
    </p><p>
      And I composed <a href="https://codeberg.org/defanor/ear-training/">a shell script using SoX</a> for practice of
      identification of scale degrees and intervals.
    </p><h2>Motivation</h2><p>
      Sometimes I find myself questioning the usefulness of these
      amateur music studies, particularly of playing instruments
      (while the theory and composition may conceivably be applied
      somehow), but it helps to view it as a recreational activity,
      quite similar to a game: the process itself should be enjoyable.
    </p></xhtml:div></content></entry>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/internal-construction.html"/><id>https://thunix.net/~defanor/notes/internal-construction.html</id><author><name>defanor</name></author><title>Internal construction</title><summary>Home maintenance and improvement</summary><published>2021-08-01T18:00:00Z</published><updated>2026-02-23T09:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Internal construction</h1><p>
      Commonly in IT-related discussions it is proposed that the world
      would be better if computer users learned to use their computers
      a bit better, to which somebody replies that plumbers don't
      expect knowledge of plumbing from you, and likewise you
      shouldn't expect computing knowledge from users. While the
      analogy is arguable, I'd rather draw the opposite conclusion
      from it: it is quite useful to spend some time learning about
      plumbing and electrical wiring, even if you're not going to do
      those yourself: it would at least help to identify building code
      violations and dangerous setups before those lead to issues, and
      will give a better idea what to ask for, which appliances you
      can plug into outlets, what are the options and how things can
      be improved. Otherwise the expected quality seems to be close to
      that of an outsourced to a random contractor piece of software
      (see also: "<a href="https://danluu.com/nothing-works/">Why is it so hard to buy things that work
      well?</a>"). Additionally, it is satisfying to know in a bit more
      detail how the things you use daily are set and work.
    </p><p>
      One can draw a few more parallels: just as programmers,
      different plumbers, electricians, and carpenters do things
      differently, argue which ways or technologies work better (or at
      all), tend to ignore instructions and documentation (and then
      run into trouble because of it), neglect documenting their work
      or disappear with supposedly written documentation, sometimes
      set wiring or plumbing dangerously, neglect maintainability
      (cementing pipes or splices without boxes in, or adding some
      trendy electronics, possibly even "smart" stuff, sometimes
      inside walls or ceilings -- setting more important components to
      go out of order and be hard to fix in a few months or years),
      and generally there are people who just hack things together
      without learning much about the subject, creating issues for
      everyone involved in the future, but there are more careful and
      knowledgeable ones too. And their tools are of varying quality,
      with both tools and materials being underspecified in
      stores. Most people do low-impact work, pretty much in any
      profession.  Even though it is often said that the size of an
      error in software can be disproportional to its consequences,
      small errors in critical places can be disastrous with plumbing
      or wiring as well (but in most cases they will not matter much,
      in any of those areas). And just as programmers, they can do
      some programming/control: with ladder logic and other
      electronics for electricians, and with logic valves and other
      hydraulics for plumbers.
    </p><p>
      As for differences, judging by some search and chatter, online
      electrician communities tend to be private (sometimes requiring
      a license number to join), and information is limited in order
      to discourage DIY enthusiasts from making unsafe things
      themselves. Though of course there is plenty of such information
      in public anyway, and there are dedicated DIY
      communities. Additionally, while in IT the paywalled ISO and IEC
      standards are not the most common kind, apparently in other
      industries they are.
    </p><p>
      Apparently the risks and costs are different in developed
      countries, where work is commonly done by qualified and licensed
      workers, with professional liability insurance, and even checked
      regularly by inspectors in some cases. In Moscow I was able to
      find some mentions of qualified contractors, legal contracts
      (and possibility of civil lawsuits), warranty, and separate
      insurance, though the experience suggests that it probably will
      not work smoothly. Speaking of contractors, there is <a href="https://news.ycombinator.com/item?id=34408123">an
      interesting discussion on house building with contractors</a>. But
      as a general rule, many people do not hesitate to accept money
      for jobs they are not qualified to do properly, possibly do not
      even realize that they are not (while many more seem comfortable
      even with jobs involving actively and knowingly hurting others,
      let alone doing a poor job), and the expectations of contractor
      work should be lowered in the absence of sufficient control
      (such as enforced regulations, or perhaps just a qualified third
      party revising the work).
    </p><p>
      These notes include some highlights, important things to pay attention to,
      and hopefully can serve as an entry point for starting the dive into these
      subjects. Nothing advanced is written here, since I'm a newbie myself.
    </p><h2>Equipment</h2><h3>Safety</h3><p>
      <a href="https://en.wikipedia.org/wiki/Personal_protective_equipment">Personal protective equipment</a> should be used; hurting and possibly
      crippling yourself is undesirable.
    </p><p>
      The most basic and commonly needed for housework items are <a href="https://en.wikipedia.org/wiki/Eye_protection#Spectacles">spectacles</a> (or
      a face shield) and <a href="https://en.wikipedia.org/wiki/Glove#Safety_standards">gloves</a> (different kinds), possibly followed by
      <a href="https://en.wikipedia.org/wiki/Respirator">respirators</a> (depending on a task).
    </p><p>
      As a side note, some of the other workwear appears to be practical and
      comfortable, unaffected by awkward fashion trends.
    </p><p>
      When poking electrical wiring (e.g., changing light fixtures),
      it is better to have a voltage tester. I like a no-contact
      voltage tester, in part because it also helps to check where hot
      wires run inside a wall, but apparently they may be
      unreliable. Some of those count as multimeters: sometimes
      including a pyrometer, often a flashlight, sometimes voltage and
      resistance meters, and/or other regular multimeter
      functionality.
    </p><h3>Tools</h3><p>
      It may be hard to justify acquisition of tools without planning
      to use them frequently, but then it is easy to end up without
      tools. Buying complex and expensive electrical tools or machine
      tools for a single task would most likely be an overkill, but
      basic hand tools may be a better fit for a DIY enthusiast:
      usually they don't take much space and even good ones aren't
      expensive, and likely they will still work in a decade or few.
    </p><p>
      Apparently rubber usually degrades faster than metal, wooden, or
      even plastic parts, so it is useful to avoid rubbery handles for
      the tools you plan to have for years.
    </p><p>
      Toolboxes are commonly used to store and carry the tools, and multiple
      ones may solve the issue with having to haul a single heavy one each time
      you need something.
    </p><p>
      Since reviews, benchmarks, or even specifications tend to be
      unavailable, one rough heuristic for tool quality is its
      manufacturer (company, brand, and/or country). As with pretty
      much any other devices, <a href="https://en.wikipedia.org/wiki/List_of_tool_manufacturers">established tool manufacturers</a> tend to
      be in Germany (and around, elsewhere in Europe), Japan, Taiwan,
      and the US. Mainland China produces a lot of cheap stuff, often
      labelling it with an importer's brand; apparently supermarket
      chains use those.
    </p><p>
      As an example of a shady brand, as of 2021, there are GROSS
      brand's products in Russia, with a few "distributor" websites
      saying it is made in Germany, but the trademark is registered by
      the Chinese "Matrize Handels-GmbH" (the dash is not a typo;
      there are trademark search websites where one can look those up)
      company, with relation to some Russian folks who patented a
      spirit level recently. The "МИР ИНСТРУМЕНТА" chain occasionally
      mentions that it is their trademark, and occasionally just says
      that they are the exclusive distributor. Reportedly "Мастернэт"
      does something similar, distancing itself from its
      brands. Apparently a very similar thing happens with cookware
      (Gipfel and others), possibly with electronics (ERA and Rexant:
      don't pretend to be German, but apparently ship most of the
      production from China while positioning it as local), light
      fixtures (apparently Arte Lamp is like that, along with InStyle
      and Divinare: advertised as Italian, made in China, seems to
      only sell in Russia, the trademark belongs to a Lithuanian
      company, used to belong to one from Panama, the Italian domain
      name's contact information points into Moscow, unclear whether
      the referenced Italian company and office exist at all: the
      company doesn't show up in searches, the address on Google Maps
      doesn't have the office marked, and that address doesn't match
      the approximate location mentioned in the company description,
      the description itself looks half-baked, and for some reason
      many retailers sell them for exactly the same price).
    </p><p>
      I've looked into local (Russian) tools specifically, wondering
      whether there is anything good (or at all), given
      Russia's <a href="https://en.wikipedia.org/wiki/Industrial_sector">industrial sector</a> being similar to that of Germany in
      size, and all the fuss about import substitution even in IT
      (where it looked silly, with rebranded software and
      everything). Apparently at least 1/3 of the industrial sector is
      resource extraction (though judging by the list
      of <a href="https://en.wikipedia.org/wiki/List_of_companies_of_Russia">largest
      Russian firms</a>, it is mostly extraction and its
      support/servicing), and it is mostly defense, aerospace, and
      automotive industries otherwise (though those heavily depend on
      imported components and equipment as well, basically doing only
      the final assembly locally), while the import substitution
      mostly aimed agriculture, automotive industry, and IT. Looks
      like there are some small tool manufacturers, though rather
      often upon closer inspection it turns out that most of the
      production comes from China (PRC), even if they have some kind
      of local manufacturing.
    </p><h3>Consumables</h3><p>
      Some of the consumable products that are nice to have at home,
      in the decreasing order by estimated frequency they tend to be
      needed with, roughly in the order I would acquire them: cleaning
      products, light bulbs, batteries, duct tape, WD-40, electrical
      tape, lubricants (<a href="https://en.wikipedia.org/wiki/Silicone_grease">silicone grease</a> seems to be versatile),
      sealants, glues for different purposes, various connectors and
      cables, maybe solder and flux, screws and wall plugs, bolts and
      nuts, nails.
    </p><h2>Maintainability</h2><p>
      Everything involved has a limited lifespan, which is usually a
      fraction of human life expectancy, so one is likely to have to
      replace everything a few times in their lifetime, and it is nice
      to plan for that.
    </p><h3>"Off" switches</h3><p>
      It is important to be able to turn everything off (water, electricity,
      gas), either for planned maintenance or in case of an emergency. So far I
      had most trouble with <a href="https://en.wikipedia.org/wiki/Isolation_valve">isolation valves</a>, which were painted over, rusty,
      hidden, or absent. Circuit breakers tend to be in a better shape, but
      still not always quickly and easily accessible (while they should be), and
      not always labelled.
    </p><p>
      It is a good idea to learn about <a href="https://en.wikipedia.org/wiki/Circuit_breaker#Standard_current_ratings">standard current ratings</a>, and
      to ensure that the actual wiring matches those. <a href="https://en.wikipedia.org/wiki/Residual-current_device">Residual-current
      circuit breakers</a> (RCCB, aka RCD, aka GFCI) may be desirable.
    </p><h3>Accessibility</h3><p>
      All the connections (valves, splices) should be accessible without
      breaking the walls, ceilings, or floors. It wouldn't harm to have all the
      pipes and wires accessible as well, which is unusual for homes, but can be
      found in industrial/commercial settings.
    </p><p>
      Some of the accessible electrical wiring setups involve <a href="https://en.wikipedia.org/wiki/Cable_tray">cable
      trays</a>, <a href="https://en.wikipedia.org/wiki/Electrical_conduit">electrical conduits</a>, <a href="https://en.wikipedia.org/wiki/Raised_floor">raised floors</a>, <a href="https://en.wikipedia.org/wiki/Dropped_ceiling">dropped ceilings</a>,
      cable raceways (sometimes hidden in <a href="https://en.wikipedia.org/wiki/Moulding_(decorative)">moulding</a>). Though before
      jumping into those, one should also learn about building codes
      (in Russia it is <a href="https://ru.wikisource.org/wiki/%D0%9F%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D0%B0_%D1%83%D1%81%D1%82%D1%80%D0%BE%D0%B9%D1%81%D1%82%D0%B2%D0%B0_%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BE%D0%BA">правила устройства электроустановок</a>, though it
      is often said that Russian ones are stricter than US and EU
      ones, apparently contributing to them not being followed, and to
      the corruption, leading to more fires and other incidents; in
      the US there is <a href="https://en.wikipedia.org/wiki/National_Electrical_Code">National Electrical Code</a>), some of which require
      certain useful cable insulation properties (e.g., for it to not
      fall apart in a few years, to not catch and transfer fire),
      mechanical protection, appropriate circuit breakers, and
      possibly more.  Actually if the building codes are followed,
      even regular concealed wiring should be accessible and somewhat
      adjustable.
    </p><p>
      Ideally ventilation systems should be accessible as well, to
      extract the birds falling into those and for inspection in
      general.
    </p><p>
      Lightweight furniture, relatively easy to move around, is useful
      for not blocking access to some parts of a room. And it is nice
      to keep surfaces accessible for cleaning, preferably even
      without moving anything.
    </p><h2>Plumbing</h2><p>
      Casual plumbing is mostly about screwing things together, and
      occasionally dealing with rust. It is nice to know about <a href="https://en.wikipedia.org/wiki/Piping_and_plumbing_fitting">piping
      and plumbing fittings</a>, along with <a href="https://en.wikipedia.org/wiki/Sealant">sealant</a> types, and perhaps
      about work with pipes for more advanced plumbing. Common tasks,
      like replacing a tap, usually would only require a sealant (a
      teflon tape is rather neat for tapered thread sealing, but a
      liquid sealant is still needed to seal wall-adjacent bits) and
      a <a href="https://en.wikipedia.org/wiki/Plumber_wrench">plumber wrench</a> or an <a href="https://en.wikipedia.org/wiki/Adjustable_spanner">adjustable spanner</a>, preferably a <a href="https://en.wikipedia.org/wiki/Spirit_level">spirit
      level</a>.  Plastic plumbing for low-pressure waste water usually
      doesn't require even that, but only relies on <a href="https://en.wikipedia.org/wiki/Gasket">gaskets</a> for
      sealing.
    </p><p>
      There are videos available online where plumbers demonstrate the
      process, and one can ask a hired plumber to help them for safer
      practice.
    </p><p>
      As for taps and other sanitary fittings themselves, companies from the
      same places where decent tools are made seem to produce the best ones (at
      the time of writing, Grohe is a nice and popular option).
    </p><h3>Flood mitigation</h3><p>
      A malfunctioning washing machine, a leaky pipe, and other things
      can lead to unexpected flooding, which is dangerous and deals
      water damage to the floors below (summoning unhappy neighbours
      in case of an apartment building). A <a href="https://en.wikipedia.org/wiki/Floor_drain">floor drain</a> can help to
      mitigate it, though it may be tricky to set even during
      renovations. Other options are drain pans, isolation valves with
      water sensors. To avoid even minor leaks reaching the neighbors,
      the floors around piping may be required to be waterproofed, and
      either lower than the adjacent ones, or separated with a
      threshold (but such requirements are commonly violated).
    </p><h2>Light</h2><p>
      Lighting is usually divided into task lighting (direct and bright),
      ambient lighting (soft, indirect or diffused), and decorative (or accent)
      lighting.
    </p><p>
      Kitchen task lighting should be more than 500 <a href="https://en.wikipedia.org/wiki/Lux">lux</a> (or at least 50
      lightcandles), 1000 lux is recommended for electronic manufacturing. I
      went for a 1000 lumens/meter LED strip for mine. The linked Wikipedia
      article includes reference illuminance values for various other
      situations.
    </p><p>
      A high <a href="https://en.wikipedia.org/wiki/Color_rendering_index">colour rendering index</a> (CRI) is important for the lit items to look
      "right": as one would expect them to look, similar to being lit by the
      Sun.
    </p><p>
      <a href="https://en.wikipedia.org/wiki/Sunlight">Sunlight</a> <a href="https://en.wikipedia.org/wiki/Color_temperature">colour temperature</a> at Earth's surface (after it gets
      through the atmosphere) varies, but seems to be around 6500 K,
      and that is our definition of white colour. I went for 5000 K,
      which looks fairly white as well, and was just the maximum
      available locally at the time with a high CRI. Philips light
      bulbs at 4000 K look yellowish, even though they are labeled
      "neutral white". 6500 K ones seem fine to me.
    </p><p>
      As with computers, it is useful to have good (possibly overkill)
      heat dissipation and PSU (in case if LED strips are used;
      AC-to-DC converters themselves recommend to pick their maximum
      load as expected load + 20%, and some recommend to rather make
      it 30--40%, though going further would probably be wasteful, and
      possibly they will not work as efficiently at lower loads). As
      with many other devices, one should pay attention to <a href="https://en.wikipedia.org/wiki/IP_Code">ingress
      protection (IP) codes</a>, especially for kitchens and bathrooms.
    </p><p>
      One complete list of materials for setting kitchen cabinet lighting nicely
      (with a "gap" for going from over-cabinet to under-cabinet lighting, or
      just for skipping some areas: that is, with a cable soldered between two
      runs of the strip) is a LED strip, a PSU (and possibly a power cord or a
      rewirable plug to plug it into an outlet, with a switch), a LED channel, a
      two-wire cable (the electric current can be high at low voltages, so the
      wire diameter should be appropriate), electrical tape and/or heat-shrink
      tubing, double-sided tape (LED strips usually have them pre-applied, but
      they are also handy to glueing LED channels to cabinets) or some other
      mounting materials, solder and flux. The tools needed to assemble it then
      are a soldering iron (although one can go for solderless connectors
      instead), a hacksaw (unless chunks of aluminium profile fit well without
      it, or can be cut by others), preferably a file, scissors, likely
      screwdrivers for PSU's screw terminals, a wire stripper if available.
    </p><p>
      As for LED bulbs, cheap ones by lesser-known manufacturers
      usually end up costing more because of their short lifespans,
      while being dim and flickering. Philips ones are mostly fine and
      commonly available, though they buzz audibly. And there are
      benchmarks around.
    </p><p>
      And once again, the stuff that is non-trivial to replace should
      be reliable (which usually means simple), so that you have less
      of a headache when things break: simple light fixtures with
      replaceable light bulbs (and without built-in AC-to-DC
      converters and LED strips) are preferable, so that the complex
      and unreliable parts are easy to replace (and it is easy to find
      and choose a replacement quickly as well). Among those, the
      simplest (most straightforward and reliable) ones are perhaps
      those without lampshades or excessively fancy elements, just
      with light bulbs poking out, with enough space around them, and
      easiest to replace.
    </p><h2>Major appliances</h2><p>
      <a href="https://en.wikipedia.org/wiki/Major_appliance">Major appliances</a> tend to be relatively heavy and expensive, so
      it is a good idea to choose and install them carefully.
    </p><p>
      For instance, usually there are special requirements for washing machines
      (or launder rooms, and/or other rooms with water/sinks), involving a
      separate circuit breaker (usually a 20-ampere one, not the more usual 16).
      Though even <a href="https://en.wikipedia.org/wiki/Small_appliance">small appliances</a> like electric kettles may easily trip the
      circuit breakers if turned on together while connected to the same
      circuit.
    </p><h3>Repairs and servicing</h3><p>
      Apart from the quality and appliance-specific specifications, easy
      <a href="https://en.wikipedia.org/wiki/Repairability">repairability</a> and maintenance are preferable: availability of genuine
      spare parts (long-term support by the manufacturer), ease of their
      replacement, availability and cost of regular servicing/maintenance. One
      can look up spare parts on manufacturers' websites, and repairs tend to be
      about part replacement, the videos of which are often available online.
    </p><p>
      Generally appliances aren't built to last these days, but rather
      to work for their expected lifespan and be utilized then. It
      seems that manufacturers are pretty good at optimizing them for
      those lifespans (and/or for planned obsolescence), so they start
      falling apart at that point.
    </p><h2>Furniture</h2><h3>Wood types</h3><p>
      There is an appeal in lightweight furniture, as mentioned above,
      but it may still have wooden parts, or one may prefer wood for
      longevity, aesthetics, or other reasons. <a href="https://en.wikipedia.org/wiki/Hardwood">Hardwood</a> is more
      durable and more fire-resistant than <a href="https://en.wikipedia.org/wiki/Softwood">softwood</a>, but also heavier
      and more expensive. Hardwood comes from angiosperm trees (mostly
      deciduous, broad-leaved, flowering), and the wood has pores,
      while softwood -- from gymnosperm trees (coniferous), and the
      wood has resin canals or ducts.
    </p><p>
      For a reference, some of the hardwoods are: oak, cherry, apple,
      alder, balsa, beech, birch, ebony, maple. Some of the softwoods
      are: pine, fir, spruce.
    </p><p>
      See WikiHow's "<a href="https://www.wikihow.com/Identify-Wood-Types-in-Furniture">How to Determine the Wood Type Used in Furniture</a>"
      and similar guides to attempt to identify the wood types used in
      furniture.
    </p><p>
      It may also be a good idea to avoid wood veneer, preferring
      solid wood furniture, which exposes the wood it is made out
      of. Apart from avoiding the usual issues of likely-imperfect
      "faking" (or decoration), solid wood allows for easier
      identification and easier fixes (or restoration).
    </p><h3>Bed</h3><p>
      Relatively common mattress lengths are 200 and 190 cm; the
      latter is insufficient for a 180 cm person to lie on the back
      comfortably, even with a relatively compact pillow. Footboards
      make it even more annoying, I find those best to avoid in most
      cases, even with longer beds.
    </p><h2>Pest-proofing</h2><p>
      "<a href="https://entomology.ca.uky.edu/ef641">How to Pest-Proof Your Home</a>".
    </p><h2>Documentation</h2><p>
      Proper documentation is hard (especially if it is others doing
      the construction), but it is a good idea to take pictures during
      all kinds of construction and renovations: questions tend to
      arise later, with the answers being forgotten and hidden behind
      the walls, floors, and ceilings. Storing recipes is a good idea
      too, since later one may need to acquire matching materials or
      just check what was used.
    </p><p>
      <a href="https://www.freecad.org/">LibreCAD</a> handles <a href="https://en.wikipedia.org/wiki/Building_information_modeling">building information modeling</a> with its
      <a href="https://wiki.freecad.org/Arch_Workbench">Arch workbench</a> (and the external <a href="https://wiki.freecad.org/BIM_Workbench">BIM workbench</a>), which includes
      pipes.
    </p><h2>HVAC</h2><h3>Insulation</h3><p>
      For any type of heating (or cooling) a good insulation is useful
      and important, but in some cases it is even required in order to
      make them practical or achievable.
    </p><h3>Air conditioning</h3><p>
      Air intake is a useful feature: in addition to delivering fresh
      air, it can filter that air, and even do some heat exchange with
      the air already in the room, for increased efficiency. Otherwise
      some end up running an AC with an open window, leading to a low
      efficiency, while the dust keeps coming.
    </p><h3>Heating</h3><p>
      Apartment buildings tend to have communal heating, but for a
      separate house that is an additional headache. Even if a house
      is unused, letting it to freeze is dangerous not just for pipes
      and furniture, but also for all the surfaces that can be claimed
      by mold, or the materials intended to stay indoors. In some
      places freezing isn't a concern, but around Moscow temperatures
      can go down to -40, though average low in the coldest months is
      closer to -9, and -20 is rather rare even at night. A common
      estimate for a 200 m² house is 10 kW of heat per hour, which
      matches my observations.
    </p><p>
      That is a bit much for electrical heating (not just costly, but
      also loading the grid and the electrical wires quite a bit: at
      220 volts that'd be around 45 amperes); gas heating costs almost
      as much by 2021 (gas prices went up), and seems to be rather
      clunky, requiring increased maintenance. Heat pumps seem
      promising though: electricity-powered, but with heat output a
      few times higher than the consumed electricity. Air source heat
      pumps may be more suitable for warmer temperatures, dropping in
      efficiency quite notably at lower ones, when they are needed the
      most. Ground source ones don't have that problem, but require
      either large areas or deep holes, and the holes may require
      licensing and fees (or to stay within limits: as of 2021 in
      Moscow, those are apparently to extract not more than 100 m³ of
      water, for own non-commercial use), not to mention relatively
      high upfront costs. I'll probably investigate that and update
      these notes later.
    </p><p>
      But an important thing to keep in mind is that maintaining a
      house can be pretty expensive because of this; it is an
      opportunity to unexpectedly find yourself responsible to pay
      regularly, which is stressful, which is not great for overall
      mood and well-being. Building a smaller house, with better
      insulation, planning the heating from the beginning, and asking
      yourself whether you really want or need a house in the first
      place would all be good ideas.
    </p><h2>Remote control and monitoring</h2><p>
      For some devices, particularly heating, remote monitoring and/or
      control may be needed. Boilers, for instance, use semi-closed
      protocols like OpenTherm, which are tricky to interact with. I
      plan to investigate this later, but here are some links related
      to libre and customizable systems for that (IoT/"smart home"
      sorts of things): <a href="https://www.openhab.org/">openHAB</a>, <a href="https://www.home-assistant.io/">Home
      Assistant</a>, <a href="https://homebridge.io/">Homebridge</a>, <a href="https://esphome.io/">ESPHome</a>. Some do it from scratch, see
      "<a href="https://renato.athaydes.com/posts/writing-your-own-smarthome-manager.html">How I wrote my own Smart Home software</a>". I try to simply avoid
      such functionality for devices that do not need remote control,
      thereby avoiding unnecessary exposure to vulnerabilities
      commonly found in those, often even picking mechanical devices
      over electronic ones (to avoid dependencies on power, in
      addition to those on Internet connection, as well as the added
      complexity), but for vacuum cleaners, one may consider <a href="https://valetudo.cloud/">Valetudo</a>
      as a local-only option (though not for a multi-floor setting),
      if a robotic vacuum cleaner is wanted and it is challenging to
      find one autonomous by default.
    </p><h2>Utilities</h2><p>
      Public utilities and other communal services tend to be
      low-quality and hard to get fixed around here, complete with
      scammy field service technicians: whether those are commercial
      organizations (with some competition) or the ones funded out of
      municipal or government budgets, with mandatory regular
      payments, issues are not getting solved unless you pay somebody
      unofficially to actually fix them. Sometimes such services are
      sold by technicians themselves. When there is a fixed price for
      a service, one of the tactics the technicians, veterinarians,
      and likely others employ is to claim that the price is for the
      work itself, but the consumables should be paid for separately
      (even while it certainly is not so, and some companies would
      call you afterwards, asking whether it happened -- though
      without warning in advance that it happens).
    </p><p>
      While going off the grid in an apartment completely is not
      viable, it seems sensible to reduce the number of such
      utilities, rather similarly to software, hardware, or online
      service dependencies with bad vendors.
    </p><h2>See also</h2><p>
      <a href="https://patternlanguage.cc/">A Pattern Language</a> looks like a nice book on architecture and
      adjacent topics, with its copyleft version available.
    </p></xhtml:div></content></entry>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/software-packaging-and-deployment.html"/><id>https://thunix.net/~defanor/notes/software-packaging-and-deployment.html</id><author><name>defanor</name></author><title>Software packaging and deployment</title><summary>An overview of software packaging and deployment options</summary><published>2018-10-01T15:00:00Z</published><updated>2026-02-16T21:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Software packaging and deployment</h1><p>
      This is an opinionated overview of the available software
      packaging and deployment options, including those for
      commercial software and binary releases.
    </p><h2>The problem</h2><p>
      Proper and usable software installation may include placement of
      executable files, data files, documentation such as man pages
      and info manuals, configuration files with appropriate
      permissions, init system configurations (e.g., init scripts,
      service files) for daemons, freedesktop.org configurations for
      desktop applications. As well as creation of system users, a way
      to uninstall the software, proper handling of configuration
      files (not just overriding user configuration). And preferably
      it should be manageable using standard system tools, since it is
      a pain to use multiple package managers to maintain a system.
    </p><p>
      There are nuances and incompatibilities among major GNU/Linux
      distributions (not to mention other UNIX-like systems, or
      different OS families), so it's not a straightforward task. For
      instance, it used to be a pain to write init files for different
      distributions because of the available software; now there is
      systemd on most of the major ones.  Generally, automated and
      reliable integration of different software components is tricky.
    </p><h2>Solutions</h2><h3>"Proper" flow</h3><p>
      In the least hacky out of common scenarios, upstream developers
      release the software following the standards and conventions,
      which is packaged for different systems by maintainers, and
      necessary adjustments are introduced.
    </p><p>
      But this does not work for commercial software, or for binary
      releases of smaller projects. Neither does it guarantee that
      installation and maintenance would not be a pain (cf. most of
      the issue trackers), though it does not have to be.
    </p><p>
      Sometimes this approach works poorly with FLOSS projects as
      well: notably, Rust packages tend to have many dependencies,
      with some of those usually aiming nightly compiler builds, and
      it is generally assumed that it is installed circumventing a
      system package manager. Many non-Rust projects also consider
      themselves special, and suggest custom installation options:
      AppImage installers, other container images with whole operating
      systems included, manual building (sometimes with odd build
      tools) and installation, just some odd scripts, possibly with
      "<code>curl ... | sh</code>". This leads into the territory of
      the "ad hoc mess" and "masked mess" sections below.
    </p><h3>System-independent build systems</h3><p>
      Build systems such as GNU autotools, or the language-specific
      ones such as Cabal for Haskell programs, can be used for
      packaging and installation on their own. Autotools even try to
      deal with system incompatibilities, but still don't cover all
      the tasks (such as user creation or portable service
      installation), dependency resolution and automatic installation
      are partial at best (for language-specific package managers),
      and of course the software installed that way isn't manageable
      with a package manager native to a given system.
    </p><p>
      It is even less suitable for binary software distributions:
      build systems are mostly for building, as the name suggests.
    </p><p>
      As examples, autotools-generated and similar Makefile-based
      tarballs use <code>make install</code>, <code>cabal
      install</code> can install Haskell programs globally.
    </p><p>
      For Python programs something like <code>PIPX_HOME=/opt/pipx/
      PIPX_BIN_DIR=/usr/local/bin/ pipx install --system-site-packages
      .</code> can be used: it is still a language-specific and
      system-independent system, though installing partially into
      non-standard paths and using virtual environments, having a
      notably worse system integration, more similar to those from the
      next section. Although cabal, while pulling dependencies from
      Hackage, by default similarly mostly ignores the underlying
      system with its package manager, and bundles those dependencies
      together (just in a statically linked executable file, rather
      than a venv).
    </p><h3>Ad hoc mess</h3><p>
      Custom shell scripts or <code>Makefile</code>, <code>curl |
      sh</code> installation, various other custom installers, manual
      code copying, lengthy and awkward installation instructions,
      DVCS-based deployment (with private keys and passwords
      occasionally being in a repository and/or hardcoded), and
      virtual machine images seem to be used rather often for in-house
      or "enterprise" commercial software. It is a mess and a
      nightmare to maintain, usually matching the software it is used
      for, but perhaps worth mentioning as a bad example.
    </p><p>
      For quick and dirty packaging though, tar and a few shell
      commands can work fine: <code>tar czf</code> the files, then
      unpack with <code>tar --same-owner -C / -xvf</code>, while using
      shell commands for that unpacking, adding users, installing
      dependencies, enabling services.
    </p><h3>Masked mess</h3><p>
      There are projects that do roughly what is described in the
      previous section, but with dedicated websites full of marketing
      slogans and making those solutions not so custom by getting more
      people to use the same kind of a solution. For instance, Flatpak
      and AppImage (primarily for desktop applications), Docker. Their
      issues are not very different from those with the ad hoc
      approaches (i.e., poor system integration), though they
      introduce a possibility of at least non-standard package
      management, and may patch some of the issues that arise.
    </p><p>
      Containerization with system images in particular I find similar
      to people taking screenshots of texts, web pages, PDFs, or other
      documents instead of copying the relevant text or saving those,
      and perhaps then pasting them into a graphics-capable word
      processor to save on a disk. Or even taking a picture of a
      screen with a camera. That is, capture the needed state with
      familiar and generic tools, even if it's inefficient and/or
      somewhat lossy; later those are also readable with generic
      tools, and it does the job in most cases.
    </p><p>
      Compared to a nice setup, such containerization introduces
      unnecessary abstraction layers and bloat, but compared to a
      messy one, it keeps the mess contained. Which makes it
      particularly desirable in commercial software development,
      perhaps.
    </p><h3>Upstream packaging</h3><p>
      This is the one I like the most so far: write a program as an
      upstream developer (following <a href="https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard">FHS</a> and other standards and
      conventions, using portable libraries when available), then
      package it as a maintainer (following <a href="https://www.debian.org/doc/manuals/maint-guide/index.en.html">Debian New Maintainers'
      Guide</a>), then deploy and configure it as an administrator. I used
      to cut some corners for packaging, using <code>cabal copy
      --destdir=deb</code>, but as of 2022, with Debian 11 and Cabal
      3, perhaps a more proper and straightforward approach is
      something like the following (just for a regular binary package;
      can be tweaked to provide source/profiling/doc packages as
      well):
    </p><pre>sudo apt install devscripts build-essential lintian haskell-devscripts
cabal-debian -m 'name &lt;name@example.com&gt;' --disable-profiling --disable-haddock
# comment out DEB_SETUP_BIN_NAME in debian/rules
debuild -i -b</pre><p>
      Or, a less neat way, to build with Hackage packages, and then
      package the executable:
    </p><pre>mkdir -p deb/usr/bin/
cabal install foo --prefix=/usr --install-method=copy --installdir=deb/usr/bin/ --overwrite-policy=always
dpkg-deb --build deb/ foo_1.2.3.deb</pre><p>
      A generic script for that:
    </p><pre>#!/bin/sh
# This script packages Haskell programs into deb packages.
set -e
PACKAGE_DIR="$1"
if [ ! -d "$PACKAGE_DIR" ]
then
    echo "Usage: package-cabal.sh &lt;directory&gt;"
    exit 1
fi
cd "$PACKAGE_DIR"
CABAL_FILE=$(ls ./*.cabal)
if [ ! -f "$CABAL_FILE" ]
then
    echo "No cabal file found in $PACKAGE_DIR"
    exit 2
fi
VERSION=$(sed -n 's/^version: *\(.*\)$/\1/p' "$CABAL_FILE")
EXE_NAME=$(sed -n 's/^executable *\(.*\)$/\1/p' "$CABAL_FILE")
DEBNAME="${EXE_NAME}_${VERSION}-0.deb"
mkdir -p deb/usr/bin/
cabal install --prefix=/usr --install-method=copy \
      --installdir=deb/usr/bin/ --overwrite-policy=always
dpkg-deb --build deb/ "${DEBNAME}"</pre><p>
      There is <a href="https://wiki.debian.org/Teams/DebianHaskellGroup/CollabMaint/GettingStarted">a "getting started" guide on packaging Haskell projects
      for Debian</a> as well.
    </p><p>
      For <a href="https://hachyderm.io/@defanor/114027071523127409">Python packaging on Debian</a>, there is dh-python (with some
      documentation in the <code>dh_python3(1)</code> man page): one
      can take an existing package as an example (e.g., <code>apt-get
      source xkcdpass</code>),
      compose <code>debian/{rules,control,changelog}</code>, <code>setup.py</code>
      (apparently no support for <code>pyproject.toml</code> yet), and
      produce a package with <code>dpkg-buildpackage -us -uc</code>. I
      think the packages I had to install before that
      are <code>dh-virtualenv dh-python debhelper
      python3-docutils</code>.
    </p><p>
      For other guides, see <a href="https://wiki.debian.org/Packaging">Packaging - Debian Wiki</a>, <a href="https://wiki.archlinux.org/title/Arch_package_guidelines">Arch package
      guidelines</a>.
    </p><p>
      An upside of such an approach is that software properly
      integrates into the system, so the regular practices can be
      applied. Sometimes it also makes you to adjust the software to
      make it easier to package and maintain.
    </p><p>
      A downside is that properly maintaining a custom repository
      (with timely key rollover) is a responsibility, and the
      documentation seems to mostly aim FLOSS project inclusion into
      the primary repositories. Hence all the third-party repositories
      that break updates, apparently. I use standalone packages
      (without repositories) on Debian instead, but it leaves open the
      problem of distribution and updates via a system package
      manager.
    </p><h2>Tips and tricks</h2><p>
      Here are some tips and tricks for writing software and packaging
      it in such a way that it would be relatively painless to deploy
      and maintain (apart from the regular "follow the standards and
      conventions").
    </p><h3>Database management</h3><h4>PostgreSQL authentication</h4><p>
      For applications that use PostgreSQL, it is handy to default to
      an empty (but configurable, of course) <a href="https://www.postgresql.org/docs/10/static/libpq-connect.html#LIBPQ-CONNSTRING">connection string</a>: it
      will just work with a local database and <a href="https://www.postgresql.org/docs/10/static/auth-methods.html#AUTH-PEER">peer authentication</a>,
      simplifying the necessary deployment steps. While providing a
      way to specify the connection string (and not, say, just
      credentials) keeps it very flexible.
    </p><h4>Database initialisation</h4><p>
      To prepare a database (create tables, define roles and security
      policies, stored procedures and aggregations, views, insert
      initial data, etc), a handy approach is to add an "init" mode
      into the application, which would simply read SQL files from a
      data directory (which should be packaged and installed there)
      and execute those in a single transaction, potentially prompting
      a user for an initial application administrator password. It
      seems straightforward, yet rarely gets done any nicely. This can
      also be combined with schema updates by prefixing SQL file names
      with version numbers.
    </p><h3>Service sandboxing</h3><p>
      One of the uses of VMs and containers is sandboxing, but some
      (and more lightweight) <a href="https://wiki.debian.org/ServiceSandboxing">service sandboxing</a> is fairly easy to set
      with systemd and AppArmor or SELinux. A sample service file I
      use:
    </p><pre>[Unit]
Description=Sample Service
After=syslog.target

[Service]
Type=simple
User=sampleservice
Environment="sampledb=port=5432 dbname=sampledb"
ExecStart=/usr/bin/sampleservice
# service sandboxing
PrivateTmp=yes
ReadOnlyPaths=/
NoNewPrivileges=yes
PrivateUsers=yes
ProtectControlGroups=yes
ProtectHome=yes
PrivateDevices=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectSystem=strict
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
CapabilityBoundingSet=
ProtectClock=yes
ProtectProc=invisible
ProtectKernelLogs=yes
ProtectHostname=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
RestrictAddressFamilies=~AF_PACKET
RestrictRealtime=yes
RestrictNamespaces=yes
LockPersonality=yes
RemoveIPC=yes
AppArmorProfile=sampleservice

[Install]
WantedBy=multi-user.target</pre><p>That references <code>/etc/apparmor.d/sampleservice</code>:</p><pre>#include &lt;tunables/global&gt;
profile sampleservice {
  #include &lt;abstractions/base&gt;
  #include &lt;abstractions/nameservice&gt;
  #include &lt;abstractions/openssl&gt;
}</pre><p>
    And something like the following
    in <code>deb/DEBIAN/postinst</code> for Debian packaging:
  </p><pre>#!/bin/sh
if [ "$1" = configure ]; then
    # set users
    id sampleservice &gt;/dev/null 2&gt;&amp;1 || adduser --system --quiet --no-create-home sampleservice
    # set AppArmor profiles
    apparmor_parser -r -W -T /etc/apparmor.d/sampleservice
fi</pre></xhtml:div></content></entry>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/debian-11-workstation.html"/><id>https://thunix.net/~defanor/notes/debian-11-workstation.html</id><author><name>defanor</name></author><title>Debian 11 (to 12) workstation</title><summary>Debian 11 to 12 workstation maintenance</summary><published>2021-08-17T18:00:00Z</published><updated>2026-01-19T12:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Debian 11 (to 12) workstation</h1><p>
      These are my notes on setting and maintaining a
      desktop/workstation system, a successor to the older <a href="centos-7-workstation.html">CentOS 7
      workstation</a>, to be used--among other things--with the <a href="private-server-setup.html">private
      server setup</a> and <a href="simpler-server-setup.html">simpler server setup</a>.
    </p><h2>Installation</h2><p>
      My goals were a working setup, along with an old system, simple
      and close to the standard one, and with
      encrypted <code>/home</code> (see also: <a href="personal-data-storage.html">personal data
      storage</a>). To avoid possible confusion during installation or
      when some repairs are needed, I keep a sheet of paper with
      partitions listed on it.
    </p><p>
      I went for <a href="https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/">Unofficial non-free images including firmware
      packages</a>, since I need GNU documentation and the Nvidia
      proprietary driver anyway (unnecessary as of Debian 12, since
      proprietary firmware is included into official images, and that
      Nvidia card is not supported anymore), and it is more suitable
      for a rescue USB stick. Picked a live Xfce image, to be able to
      poke it briefly (and ensure that it works fine with the
      hardware) before installation, as well as for possible later use
      as a rescue system. Though live images come with a drawback of
      installing <code>live-task-*</code> packages, including
      localization ones for all the supported languages, so you end up
      with hundreds of additional and unused packages to upgrade
      regularly; <code>netinst</code> produces a cleaner system, but
      they can also be removed manually afterwards. Xfce is not as
      bloated and broken as GNOME and KDE, but not as half-baked and
      broken as most of the others. Apparently MATE and Cinnamon aim a
      similar level of complexity, and I hear good things about those,
      too. I downloaded the image via BitTorrent, and as
      the <a href="https://www.debian.org/releases/bullseye//installmanual.en.html">Installation Guide</a> suggests, did the equivalent of <code>cp
      debian.iso /dev/sdX &amp;&amp; sync</code>.
    </p><p>
      There is a graphical installer available from the live system
      itself, which is handy for looking up documentation on the web
      while installing, but its functionality differs from that of the
      regular installer: there is no option to make an EFI system
      partition (ESP) explicitly, so I rebooted and used the regular
      installer. Although while installing Debian on another machine a
      bit later, I noticed that it would handle fine a FAT32 partition
      mounted into /boot/efi, without requiring to mark it explicitly
      as ESP.
    </p><p>
      As usual, I wanted to keep the old system usable and
      independent, so I have set this one on a separate disk, with a
      separate ESP, which I had to add (about 500 MB in size); the
      installer presented a warning about possibly making other
      systems hard to boot into if EFI is forced, but I've installed
      it on a separate disk (and adjusted UEFI boot priorities
      accordingly), so it was fine.
    </p><p>
      I used btrfs for a while, but decided to go with ext4 this time,
      since I use btrfs's advanced features less and less, while a
      simpler filesystem may be more reliable. Decided to minimize
      dealing with partitioning in the installer, and just made a
      single 500 GB partition for everything (not counting ESP, and
      while having 1.5 TB unpartitioned on the disk). No swap
      partition either, since in my experience it's not helpful and
      only freezes the system when something goes wrong. Didn't choose
      a network mirror to download new packages either, so the
      installation went quickly and smoothly.
    </p><p>
      While the <code>en_US.UTF_8</code> locale is very
      common, <code>C.UTF_8</code> may be better to set at once, since
      it has 24-hour time format, sensible string sorting, and DBMSes
      (particularly PostgreSQL) are more portable when set with it,
      not running into collation version mismatches on replication
      between databases hosted on different operating systems. This is
      simply adjusted in <code>/etc/default/locale</code>.
    </p><h2>Initial setup</h2><p>
      As with CentOS about 7 years prior to this setup, apparently the
      nouveau driver was causing the system to freeze, so I installed
      the <a href="https://wiki.debian.org/NvidiaGraphicsDrivers#Debian_11_.22Bullseye.22">NVIDIA Proprietary Driver</a>.
    </p><p>
      Then I've added my user into the <code>sudo</code> group, have
      set the keyboard layout to colemak with <code>sudo
      dpkg-reconfigure keyboard-configuration</code> (since the
      installer doesn't provide that option), have set it in Xfce's
      settings to use the system layout (actually in a couple of
      places, not sure why there are so many). While at it, removed
      the useless bottom panel (application launcher), have set a dark
      theme, nicer icons, disabled icons on the desktop.
    </p><p>
      As with servers, and perhaps more importantly than with those,
      decent and varied nameservers should be set. In this
      case <code>/etc/resolv.conf</code> mentions that it's generated
      by NetworkManager (which is rather awkward and unnecessary, and
      an example of little bloat <code>task-xfce-desktop</code>
      pulls), so one can <a href="https://wiki.debian.org/NetworkConfiguration#DNS_configuration_for_NetworkManager">adjust nameservers with nm-connection-editor</a>.
    </p><p>
      Then I've set the previously mentioned
      encrypted <code>/home</code> (this method is a bit verbose,
      since I've checked that things work as intended):
    </p><pre>sudo fdisk /dev/sda
# created another 500 GB partition for /home, sda3
sudo apt install cryptsetup
sudo cryptsetup luksFormat /dev/sda3
sudo cryptsetup luksOpen /dev/sda3 enchome
sudo mkfs.ext4 -L home /dev/mapper/enchome
sudo cryptsetup close enchome
sudo blkid | grep sda3
sudo -e /etc/crypttab
# added the following:
# enchome		UUID=PARTITION_UUID_HERE none luks
sudo -e /etc/fstab
# added the following:
# /dev/mapper/enchome   /mnt/home          ext4    defaults        0       2</pre><p>
      Then rebooted to ensure that <code>/mnt/home</code> mounts fine,
      moved the files from <code>/home</code> there (with <code>cp
      -a</code>), renamed <code>/home</code>, have
      set <code>fstab</code> to mount it
      into <code>/home</code>. Rebooted again, checked again that
      everything is fine, and removed the old <code>/home</code>.
    </p><p>
      One may also mount <code>/tmp</code> into memory, reducing the
      data leaking to the unencrypted root filesystem, slightly
      speeding up some tasks, and reducing disk usage; it works for me
      and I like it, but there is plenty of criticizm and possible
      issues with that:
    </p><pre>tmpfs           /tmp            tmpfs   size=1g,nosuid      0       0</pre><p>
      Moved/imported my SSH and GPG keys, <code>~/.authinfo</code>,
      some other files.
    </p><p>
      I had to remap the "menu" key (keycode 135) to left alt, which
      is always awkward and different; in Xfce I had to enter the GUI
      settings, then "session and startup", and add the <code>xmodmap
      -e "keycode 135 = Alt_L"</code> command there. Also had to unmap
      C-M-f to be able to use it in Emacs, in "settings" - "keyboard"
      - "application shortcuts".
    </p><p>
      XFCE's default key bindings for basic tiling functionality aim a
      numpad, which I do not have, but those can be adjusted in
      "settings" - "window manager" - "keyboard".
    </p><p>
      To disable GnuPG's annoying requirment to use non-alpha
      characters in a passphrase (which is contrary to <a href="https://pages.nist.gov/800-63-3/sp800-63b.html">NIST SP
      800-63B</a>, and complains about passwords in the style of <a href="https://xkcd.com/936/">XKCD
      #936</a>, such as those generated with xkcdpass), <code>echo
      'min-passphrase-nonalpha 0' &gt;&gt;
      ~/.gnupg/gpg-agent.conf</code>.
    </p><p>
      More software: <code>sudo apt install emacs
      emacs-common-non-dfsg telnet vlc tor mu4e isync rsync xsltproc
      clementine git elpa-magit elpa-haskell-mode cabal-install lynx
      whois nmap ncat dnsutils knot-dnsutils tmux fbreader inkscape
      blender godot3 gimp darktable lmms musescore texlive
      texlive-plain-generic auctex texlive-latex-extra texlive-science
      python3-sympy octave octave-symbolic libxml2-utils
      jmtpfs xkcdpass</code>,
      and <code>better-defaults</code>, <code>mu4e-alert</code>,
      and <code>cdlatex</code> via Emacs's package manager (since they
      weren't in the system repositories). Generally it's a good idea
      to stick to a single package manager, since then you shouldn't
      run into version mismatches. <code>update-alternatives --config
      editor</code> to set vim as the default editor (running a new
      emacs instance may be a bit slow for quick <code>sudo -e</code>
      editos, emacsclient won't always work, setting a small emacs
      clone just for that seems excessive, and the default nano is
      just awkward, so vim is an okay option; though perhaps one can
      also set <code>emacs -Q -nw</code>). Over time a bunch of other
      things were added, including mpd (<a href="https://wiki.debian.org/mpd">running as a user service</a>) and
      mpc, strongSwan, likely more development tools.
    </p><p>
      Then I set xterm and Emacs themes (<code>.Xresources</code>,
      Elisp), from <a href="https://github.com/defanor/dotfiles">my dotfiles repository</a>.
    </p><p>
      By 2022, I had to start using Tor bridges (since Tor is being
      blocked around here, and Internet connectivity is crippled in
      general, with Tor helping to fix some of it):
      install <code>obfs4proxy</code>, then append
      to <code>/etc/tor/torrc</code>:
    </p><pre>UseBridges 1
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy managed</pre><p>
      And bridge records received from <a href="https://bridges.torproject.org/">bridges.torproject.org</a> or by
      other means, prefixed with "Bridge" (<code>Bridge obfs4
      ...</code>). Though by 2024, many of those are blocked.
    </p><p>
      Configured Firefox: Sans Serif font, disallowed pages to choose
      their own fonts, increasing monospace font size to be the same
      as others (16), setting a minimal font size equal to those, "wp"
      keyword for Wikipedia search and "wt" for Wiktionary search,
      installing uBlock Origin (with "annoyance" lists additionally
      enabled) to cut out junk, NoScript to cut out more junk,
      FoxyProxy to use Tor for websites blacklisted around here and
      the ones I don't want to track me, HTTPS everywhere to mitigate
      local data retention practices (superceded by the Firefox's
      built-in HTTPS-Only Mode, which should be enabled in settings),
      Stylus to set a global dark theme for comfortable browsing when
      it is dark around.
    </p><p>
      Configured isync and Emacs, later installed rexmpp's
      xmpp.el. Attempted a minimal Emacs configuration this time
      (though most likely it'll grow), so used the built-in rcirc
      (with <code>rcirc-track-minor-mode</code> and just
      setting <code>rcirc-server-alist</code>), not much of mu4e
      configuration. Something like this:
    </p><pre>(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

(require 'better-defaults)
(global-set-key [mode-line mouse-4] 'previous-buffer)
(global-set-key [mode-line mouse-5] 'next-buffer)

;; https://github.com/defanor/cyrillic-colemak
(require 'cyrillic-colemak)
(add-to-list 'custom-theme-load-path "~/.emacs.d/elisp/")
(load-theme 'blueish t)

(setq org-preview-latex-default-process 'dvisvgm
      org-babel-python-command "python3"
      org-src-preserve-indentation t)
(with-eval-after-load 'org
  (plist-put org-format-latex-options :scale 1.5)
  (require 'ob-python))

(rcirc-track-minor-mode t)
(setq rcirc-buffer-maximum-lines 2000
      rcirc-server-alist
      '(("irc.libera.chat" :port 6697 :encryption tls
         :user-name "defanor" :channels ("#emacs")))
      rcirc-authinfo
      '(("libera.chat" sasl "defanor" "password-here")))

(require 'haskell-interactive-mode)
(require 'haskell-process)
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
(add-hook 'haskell-mode-hook 'haskell-decl-scan-mode)

(require 'html-wysiwyg)
(add-hook 'html-mode-hook 'html-wysiwyg-mode)

(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display)
(setq mail-user-agent 'mu4e-user-agent
      read-mail-command 'mu4e)
(with-eval-after-load "mu4e"
  (require 'smtpmail)
  (setq mml-secure-openpgp-encrypt-to-self t)
  (defun suppress-messages (old-fun &amp;rest args)
    (cl-flet ((silence (&amp;rest args1) (ignore)))
      (advice-add 'message :around #'silence)
      (unwind-protect
          (apply old-fun args)
        (advice-remove 'message #'silence))))
  (advice-add 'mu4e-update-mail-and-index :around #'suppress-messages)
  (advice-add 'mu4e-index-message :around #'suppress-messages)
  (advice-add 'progress-reporter-done :around #'suppress-messages)
  (setq mu4e-change-filenames-when-moving t)
(add-to-list
   'mu4e-contexts
   (make-mu4e-context
    :name "thunix"
    :enter-func (lambda ()
                  (mu4e-message "Switch to the thunix IMAP context")
                  ;; (mu4e~request-contacts)
                  )
    :leave-func (lambda () (mu4e-clear-caches))
    :match-func (lambda (msg)
                  (when msg
                    (mu4e-message-contact-field-matches
                     msg
                     :to "defanor@thunix.net")))
    :vars '( (user-mail-address            . "defanor@thunix.net")
             (user-full-name               . "defanor")
             (smtpmail-default-smtp-server . "thunix.net")
             (smtpmail-local-domain        . "thunix.net")
             (smtpmail-smtp-user           . "defanor")
             (smtpmail-smtp-server         . "thunix.net")
             (smtpmail-stream-type         . starttls)
             (smtpmail-smtp-service        . 25)
             (message-send-mail-function   . message-smtpmail-send-it)
             (mu4e-get-mail-command        . "mbsync -q thunix")
             (mu4e-update-interval         . 300)
             (mu4e-view-show-addresses     . t)
             (mu4e-maildir                 . "~/Maildir/thunix/")
             (mu4e-mu-home                 . "~/.mu/thunix")
             (mu4e-user-mail-address-list  . ("defanor@thunix.net"))
             )))
;; more contexts here
)</pre><p>
      And <code>.mbsyncrc</code> records like this:
    </p><pre>IMAPAccount thunix
Host thunix.net
Port 993
User defanor
SSLType IMAPS
Pass "password-here"
AuthMechs *

IMAPStore thunix-remote
Account thunix

MaildirStore thunix-local
Path ~/Maildir/thunix/
Inbox ~/Maildir/thunix/inbox/

Channel thunix
Far :thunix-remote:
Near :thunix-local:
Patterns * !drafts
Create Both
Remove Both
Expunge Both
SyncState *</pre><p>Then mu stores can be initialized with commands like <code>mu
        init --muhome=~/.mu/thunix --maildir=~/Maildir/thunix
        --my-address=defanor@thunix.net</code>.</p><p>
      This was a sufficient setup to listen to a radio (<code>vlc
      'http://s3.radionetz.de/1a-rock.mp3'</code>; as of 2025-10-27
      and 2026-01-14, that is blocked here, along with many CDNs and
      hosting companies, some of the alternatives are <code>vlc
      'http://113fm.cdnstream1.com/1740_128'</code>, <code>vlc
      'https://s8.yesstreaming.net:7099/RblLgn'</code>,
      see <a href="https://dir.xiph.org/">dir.xiph.org</a> for other online radios), local music
      collection (which I keep on a separate partition, so just
      mounted it via <code>fstab</code> into the same path as before,
      and the playlist also stored on it contained correct paths),
      communicate (IRC, XMPP, email), do Haskell programming, browse
      WWW relatively comfortably, play Discworld MUD over telnet, and
      publish these notes. At that point I've adjusted <a href="https://github.com/defanor/dwproxy">dwproxy</a> to be
      able to build it using only dependencies from the system
      repositories (for related rants and musings, see the notes
      on <a href="software-packaging-and-deployment.html">software packaging and deployment</a> and <a href="everyday-programming-in-haskell.html">everyday programming in
      Haskell</a>), and built a few work projects: since it's Cabal 3 now,
      had to set <a href="https://cabal.readthedocs.io/en/latest/cabal-project.html#specifying-the-local-packages">cabal.project</a> in order to use internal libraries, and
      made some other minor adjustments to handle newer versions of
      dependencies. C projects (<a href="https://codeberg.org/defanor/rexmpp">rexmpp</a> in particular) also required
      minor adjustments to handle newer versions of the compiler and
      libraries, but fairly straightforward.
    </p><h2>Adjustments</h2><p>
      Realtime Policy and Watchdog Daemon (rtkit) can be quite spammy
      in the logs with its debug messages, but that can be fixed by
      overriding its systemd service (<code>sudo systemctl edit
      rtkit-daemon.service</code>, followed by <code>sudo systemctl
      daemon-reload</code> and <code>sudo systemctl restart
      rtkit-daemon.service</code> to apply it) with the following:
    </p><pre>[Service]
LogLevelMax=info</pre><h2>Update to Debian 12</h2><p>
      Following the instructions (<a href="https://www.debian.org/releases/bookworm/amd64/release-notes/ch-upgrading.en.html">Chapter 4. Upgrades from Debian 11
      (bullseye)</a>), I executed <code>apt full-upgrade</code> to
      find out that my graphics card (GTX 660) is not supported by the
      NVIDIA proprietary driver anymore. Chose to not install the new
      nvidia-driver, but that interrupted the process, so had
      to <code>apt --fix-broken install</code>, and then <code>apt
      full-upgrade</code> again. Afterwards
      removed <code>nvidia-driver</code>,
      chose <code>mesa-diverted</code> in <code>update-glx --config
      glx</code> in order to de-blacklist nouveau drivers, rebooted,
      the system only worked for some minutes before freezing,
      rendering it unusable. Fortunately I have integrated graphics
      here (Xeon E3-1275 v2 on ASUS P8C WS), which I picked precisely
      because this sort of thing keeps happening; took the graphics
      card out, connected the display to the motherboard's DVI
      output. Apparently I disconnected the system disk while taking
      the graphics card out, so failed to boot; then reconnected it,
      and saw it via UEFI, but failed to boot still, with different
      priorities (possibly messed up the UEFI boot settings while
      poking them without the disk connected properly). Managed to
      boot into the system by booting grub from a live USB stick, then
      pointing it to the system's grub.cfg using grub shell's
      <code>configfile</code> command. Tried to fix it with
      efibootmgr, that did not work, but it worked to just
      do <code>grub-install</code> and <code>update-grub</code>,
      leading to a working system into which I can boot directly,
      albeit without a graphics card. See <a href="https://wiki.debian.org/GrubEFIReinstall">GrubEFIReinstall</a> for more
      options.
    </p><p>
      Additionally, some texlive packages failed to update, and some
      fcitx5 ones were kept back.
    </p><p>
      Afterwards I did <code>apt autoremove</code>, which removed
      telnet, so had to <code>apt install telnet</code> again.
    </p><p>
      mu4e broke as well: had to update mu4e-alert via Emacs, since it
      came from melpa, but then it kept failing with "Mu server
      process ended with exit code 1". Dug the approximate command out
      of the sources (<code>/usr/bin/mu server --debug
      --muhome=~/.mu/thunix</code>), executed it manually, saw the
      error message: "error: expected schema-version 465, but got 451;
      cannot auto-upgrade; please use 'mu init'", "Please
      (re)initialize mu with 'mu init' see mu-init(1) for
      details". Did <code>mv ~/.mu/ ~/.mu-old/</code>, then <code>mu
      init --muhome=~/.mu/thunix --maildir=~/Maildir/thunix
      --my-address=defanor@thunix.net</code> (and similar ones, for
      other mailboxes), and then it worked. As many other programs,
      mbsync deprecated "master/slave" terminology, introducing its
      unique alternative: "far/near".
    </p><p>
      Had to <code>M-x customize-group RET ansi-colors RET</code>,
      since <code>ansi-color-names-vector</code> became obsolete.
    </p><p>
      I had an unused PostgreSQL 13 (used primarily for local
      testing), and PostgreSQL 15 was installed by the system upgrade,
      so I just cleaned up the old version: <code>sudo pg_dropcluster
      --stop 13 main</code>, <code>sudo apt remove
      postgresql-13 postgresql-client-13</code>.
    </p><p>
      Then I was left with a bunch of other "installed,local" packages
      (<code>apt list '?narrow(?installed,
      ?not(?origin(Debian)))'</code>), so cleaned some of those up,
      after checking that they do not seem to be necessary: <code>sudo
      apt remove haskell-platform gcc-10 gcc-9-base gcc-10-base
      clang-11 python-numpy-doc openjdk-11-jre openjdk-11-jdk
      openjdk-11-jre-headless openjdk-11-jdk-headless libx264-160
      libx265-192 libwebp6 libvpx6 libswresample3 libssl1.1 libsepol1
      firmware-intelwimax linux-image-5.10.0-8-amd64
      linux-image-5.10.0-23-amd64 iukrainian libffi7 libbpf0
      libprocps8</code>.
    </p><p>
      Had to use <a href="https://www.linuxquestions.org/questions/linux-software-2/fbreader-writes-hyphen-after-each-word-4175679113-print/">a workaround for the FBReader's
      hyphenation-after-each-word bug</a>.
    </p><h2>Servers</h2><p>
      It is handy to host servers locally, particularly for
      communication: they are always available from the primary system
      then, the latency is reduced, regular TLS allows for
      peer-to-peer connections. As a downside, issues with the primary
      system also lead to downtime of those.
    </p><h3>XMPP server</h3><p>
      Eventually I decided that having a properly configured XMPP
      server locally is useful as a backup, for lower-latency calls,
      and to decrease load on remote servers. Having just an A record
      pointing to my static IP address (a free dyndns service in this
      case, to avoid dependencies on domain names at once), and port
      forwarding configured on the router for ports 80, 5222, 5269,
      5281, 3478, 49152-49155, I have set nginx and uacme to obtain an
      X.509 certificate for TLS, configured nftables to decrease spam
      in the logs (only accepting connections on port 80 when renewing
      a certificate), then configured Prosody and coturn. <code>sudo
      apt install nginx uacme nftables prosody
      coturn</code>. My <code>/etc/nftables.conf</code>, slightly
      abridged to focus on relevant parts:
    </p><pre>#!/usr/sbin/nft -f

flush ruleset

table inet filter {
  set not-clients {
    type ipv4_addr
    flags interval
    elements = { 1.0.0.0/8 }
  }
  set blocks {
    type ipv4_addr
    flags interval
    elements = { 1.1.1.1 }
  }
  set open-ports-s2s {
    type inet_service
    flags interval
    elements = { 5269 }
  }
  set open-ports-c2s {
    type inet_service
    flags interval
    elements = { 5222, 5281, 3478, 49152-49155 }
  }
  chain input {
    type filter hook input priority 0; policy drop;

    # Mitigate TCP reset attacks performed by the ISP.
    ip saddr @blocks tcp sport 443 tcp flags rst drop;

    # Allow traffic from established and related packets.
    ct state established,related accept

    # Allow loopback traffic.
    iifname lo accept

    # Allow incoming TCP and UDP packets on @open-ports-s2s.
    tcp dport @open-ports-s2s accept;
    udp dport @open-ports-s2s accept;

    # Drop connections from spammy addresses.
    ip saddr @not-clients drop;

    # Allow incoming TCP and UDP packets on @open-ports-c2s.
    tcp dport @open-ports-c2s accept;
    udp dport @open-ports-c2s accept;
  }
  chain forward {
    type filter hook forward priority 0;
  }
  chain output {
    type filter hook output priority 0;
  }
}</pre><p>
      Then set <code>/usr/local/bin/uacme-hook.sh</code>,
      modifying <code>/usr/share/uacme/uacme.sh</code>:
    </p><pre>--- /usr/share/uacme/uacme.sh   2023-02-15 23:31:43.000000000 +0300
+++ /usr/local/bin/uacme-hook.sh        2024-01-30 09:49:06.505761694 +0300
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
 
-CHALLENGE_PATH="${UACME_CHALLENGE_PATH:-/var/www/.well-known/acme-challenge}"
+CHALLENGE_PATH="${UACME_CHALLENGE_PATH:-/var/www/html/.well-known/acme-challenge}"
 ARGS=5
 E_BADARGS=85
 
@@ -37,6 +37,8 @@
         case "$TYPE" in
             http-01)
                 printf "%s" "${AUTH}" &gt; "${CHALLENGE_PATH}/${TOKEN}"
+                # Temporarily allow connections to port 80
+                sudo nft add element inet filter open-ports-s2s {80}
                 exit $?
                 ;;
             *)
@@ -48,7 +50,10 @@
     "done"|"failed")
         case "$TYPE" in
             http-01)
+                sudo nft delete element inet filter open-ports-s2s {80}
                 rm "${CHALLENGE_PATH}/${TOKEN}"
                 exit $?
                 ;;
             *)</pre><p>Then:</p><pre>sudo mkdir -p /var/www/html/.well-known/acme-challenge
sudo mkdir /etc/prosody/certs/example.com/
sudo touch /etc/prosody/certs/example.com/{fullchain,privkey}.pem
sudo chmod 640 /etc/prosody/certs/example.com/{fullchain,privkey}.pem
sudo chown root:prosody /etc/prosody/certs/example.com/{fullchain,privkey}.pem
sudo uacme -v new
sudo uacme -h /usr/local/bin/uacme-hook.sh issue example.com
sudo -e /etc/cron.daily/uacme-cert-update
sudo chmod +x /etc/cron.daily/uacme-cert-update</pre><p>With the following in <code>/etc/cron.daily/uacme-cert-update</code>:</p><pre>#!/bin/sh
set -e
/usr/bin/uacme -h /usr/local/bin/uacme-hook.sh issue example.com
cp /etc/ssl/uacme/example.com/cert.pem /etc/prosody/certs/example.com/fullchain.pem
cp /etc/ssl/uacme/private/example.com/key.pem /etc/prosody/certs/example.com/privkey.pem</pre><p>In <code>/etc/turnserver.conf</code> I have only set <code>external-ip</code>, <code>static-auth-secret</code>, <code>use-auth-secret</code>, <code>max-port=49154</code>.</p><p>Relevant lines of <code>/etc/prosody/prosody.cfg.lua</code>:</p><pre>interfaces = { "192.168.1.8", "127.0.0.1", "::1" }
modules_enabled = {
--- [...]
	-- Other modules
                "turn_external";
                "http";
}
-- TURN
turn_external_host = "example.com"
turn_external_secret = "secret here"

-- HTTP
http_host = "example.com"

VirtualHost "example.com"

Component "upload.example.com" "http_file_share"</pre><p>
      Then restart or reload the services, add users with <code>sudo
      prosodyctl adduser &lt;jid&gt;</code>, and it works.
    </p><h3>Voice conferences</h3><p>
      For <a href="voice-conferences.html">voice conferences</a>, apparently a particularly easy to set and
      properly working option is Mumble. <code>sudo apt install
      mumble-server mumble</code>, set a password
      in <code>/etc/mumble-server.init</code>, open UDP and TCP ports,
      and it is ready to use with desktop clients or Mumla or Android.
    </p><h3>IRC</h3><p>
      Similarly to XMPP and voice conferences, one may set an IRC
      server (or a small network) for private chatting. InspIRCd is
      available from Debian repositories and easy to configure, simply
      by setting the desired hosts, names, and passwords in its
      configuration file. And links (the spanningtree module) for use
      with multiple servers. Anope IRC services seem popular, and also
      available from Debian repositories, but perhaps unnecessary for
      a small private (and possibly local) network. To make it
      available over Internet, one may want to both enforce TLS and
      add restrictions for those connection classes; to do so, one may
      define a single connection class allowing no connections, then
      inherit one for plain connections, and one for TLS connections
      on a different port (corresponding to the Internet-facing
      endpoint), with additional restrictions (e.g., requiring a
      password).
    </p><h2>Shared machines</h2><p>
      If a machine is shared among multiple users, one may prefer to
      encrypt home directories, or at least subdirectories within
      those, individually in addition to the block device
      (LUKS/dm-crypt) encryption. That can be done with fscrypt,
      eCryptfs (an older option; also other stacked file systems). For
      instance, to create an encrypted directory:
    </p><pre># with fscrypt
# Enable and check the "encrypt" feature for the target ext4 file system
sudo tune2fs -O encrypt /dev/sda1
sudo dumpe2fs /dev/sda1 | grep features
# Install fscrypt and its libpam module at once
sudo apt install fscrypt libpam-fscrypt
# Setup fscrypt for the root partition (globally)
sudo fscrypt setup
# Create and encrypt a directory
mkdir private
fscrypt encrypt private/

# with eCryptfs
sudo apt install ecryptfs-utils
# Load the module
sudo modprobe ecryptfs
# Load it on boot as well
echo ecryptfs | sudo tee /etc/modules-load.d/ecryptfs
# Setup a private directory, in ~/Private/
ecryptfs-setup-private
# Mount it
ecryptfs-mount-private</pre><p>
      See <code>ecryptfs-migrate-home(8)</code> for encryption of the
      whole home directory.
    </p></xhtml:div></content></entry>
  <entry><link rel="alternate" href="https://thunix.net/~defanor/notes/food.html"/><id>https://thunix.net/~defanor/notes/food.html</id><author><name>defanor</name></author><title>Food</title><summary>Reasonably healthy, quick, and easy to cook meals</summary><published>2021-06-02T12:00:00Z</published><updated>2026-01-10T11:00:00Z</updated><content type="xhtml"><xhtml:div xmlns="http://www.w3.org/1999/xhtml"><h1>Food</h1><p>
      It is easy to be annoyed by the need to eat, which generally
      takes more effort than other human physiological needs. But it
      can also be a source of joy, and as with many other areas,
      trying to avoid learning about it leads to poor and/or
      overpriced results. I consume food regularly, so decided to
      write down some notes on it.
    </p><h2>Dietary guidelines</h2><p>
      There are <a href="https://en.wikipedia.org/wiki/Healthy_diet">healthy diet</a> guidelines issued by WHO and some
      governments, which seem sensible: they recommend to consume a
      lot of fruits and vegetables (at least 400 grams per day), some
      cereal, meat/fish/eggs (apparently mostly as protein sources,
      though there are other sources as well; usually it is
      recommended to consume at least 0.8 g of protein per kg of body
      weight daily, but for certain exercise types some recommend to
      increase it, up to around 2 or 3 grams per kg), and dairy. They
      also recommend to reduce sugar, salt, and butter consumption. If
      you mix together and heat up sugar, salt, and butter, you get
      toffee or similar confections (depending on temperature and
      other minor parameters). <a href="https://en.wikipedia.org/wiki/Saturated_fat">Saturated fat</a> and alcohol are also
      recommended to avoid, and <a href="physical-exercises.html">physical activity</a> is recommended by
      some of those (despite not being directly related to food).
    </p><p>
      Humans evolved to survive on available food in bad conditions,
      so it is not a big deal if proportions are imperfect: eating
      edible foods you are not sick of should keep you alive. Trying
      to balance them and not completely ignoring some of the <a href="https://en.wikipedia.org/wiki/Food_group">food
      groups</a> should be pretty healthy.
    </p><p>
      Apparently it is still unclear how useful <a href="https://en.wikipedia.org/wiki/Dietary_supplement">dietary supplements</a>
      (multivitamins and others) are, assuming a relatively healthy
      and diverse diet. Speaking of things with little evidence and a
      lot of marketing or followers, there also are "<a href="https://en.wikipedia.org/wiki/Organic_food">organic
      food</a>", <a href="https://en.wikipedia.org/wiki/GMO_conspiracy_theories">GMO conspiracy theories</a>, <a href="https://en.wikipedia.org/wiki/Fad_diet">fad diets</a>.  So beware of dubious
      marketing, if you try to stick to evidence/science/studies
      (though there is plenty more of controversy around topics like
      that, even around the studies: the ones people are commonly
      interested in, but which are tricky to study precisely).
    </p><p>
      For calculations of food nutrition, there are <a href="https://www.verywellfit.com/recipe-nutrition-analyzer-4157076">Recipe Nutrition
      Calculator</a> and <a href="https://www.webmd.com/diet/healthtool-food-calorie-counter">Food Calculator</a>; for estimation of the needed
      calories, there are <a href="https://www.mayoclinic.org/healthy-lifestyle/weight-loss/in-depth/calorie-calculator/itt-20402304">Calorie Calculator</a> and another <a href="https://www.bodybuilding.com/fun/macronutcal.htm">Calorie
      Calculator</a> (which includes estimates of macronutrient
      needs). And a similar <a href="https://www.calculator.net/macro-calculator.html">Macro Calculator</a> (with more calculators on
      that website). Plenty more information at <a href="https://exrx.net/Nutrition/DietDevelopment">ExRx.net - Diet and
      Nutrition</a>.
    </p><h2>Motivation and time</h2><p>
      Cooking (and even eating) may be seen as a chore and
      inconvenience, but to many even computing does look that way,
      and in both cases it is possible to enjoy the process, making it
      a hobby. There are hacks one may attempt to reduce bothering
      with food (<a href="https://en.wikipedia.org/wiki/Meal_replacement">meal replacements</a>, eating out, relying on others to
      cook in general), but the results seem similar to people
      avoiding bothering with computers: reluctance to put a bit of
      time and effort into learning leads to poor results and
      continuous frustration, while after learning the basics it is
      rather fun to tinker. Also as with computers, maths, and likely
      most of the other activities, it can be intimidating at first,
      but experience builds confidence and makes it easier. For
      increased inspiration and motivation, there are plenty of
      cooking videos available online. It does take some time though.
    </p><p>
      As an additional benefit, the breaks taken to make a coffee or
      cook something may count for the breaks commonly suggested to
      heavy computer users, to avoid just sitting all day long (with
      potential adverse effects on one's health).
    </p><p>
      To speed up both cooking and dishwashing, one can cut some
      corners, especially after learning which ones are okay to cut:
      perhaps cut vegetables into less consistently-sized and larger
      chunks, roll out the dough less carefully, cook faster at a
      higher heat, do not wash dishes overly thoroughly. But one
      should still be careful around the dangerous stuff found in the
      kitchen: contamination (from meat, eggs, etc), flame, hot oil,
      knives.
    </p><h2>Kitchen setup</h2><p>
      A nice kitchen setup and handy utensils are important for happy cooking.
      One of the important aspects (as with most of other manual labour) is
      lighting: see <a href="internal-construction.html#Light">my notes on lighting</a> for that.
    </p><p>
      The situation with cookware is similar to that with hand tools:
      odd brands hiding the companies/manufacturers behind them,
      sometimes pretending to be German, or local to a place they are
      sold at, while being Chinese or Indian. With established brands
      there is at least a hope for quality control, even if they are
      manufactured in China too. There are occasional stores that pick
      nice cookware/brands before selling it. And it wouldn't harm to
      investigate which utensils you need, which kinds of those exist,
      the properties of materials they are made of.
    </p><p>
      Some of the seemingly fine brands available here are Zwilling,
      WMF, Arcos. Possibly also Le Creuset, Beka. Vitrinor, Brabantia.
    </p><p>
      Common advices in articles and videos on kitchen setup are
      straightforward: keep the items you need often easily accessible
      and easy to fetch: pots and pans hanging (or otherwise fixed in
      a rack) instead of being stacked and stashed somewhere, knives
      on a magnetic bar, oils and spices visible and at hand, not
      hidden in a closed cabinet. While the unused stuff shouldn't
      occupy valuable space.
    </p><h2>Knives</h2><p>
      Much of food preparation is about slicing and chopping
      vegetables, which can be time-consuming. To speed it up, it's a
      good idea to learn how to hold and guide a knife properly, as
      well as to keep it sharp. Here is a couple of videos
      demonstrating the usage basics: "<a href="https://www.youtube.com/watch?v=G-Fg7l7G1zw">Basic Knife Skills</a>", "<a href="https://www.youtube.com/watch?v=aoqVGdmVlKk">The Only
      Knife Skills Guide You Need</a>". For basic sharpening and
      re-aligning, see "<a href="https://www.youtube.com/watch?v=Wk3scs5FqCY">How To Sharpen Dull Knives</a>".
    </p><p>
      European-style knives are made of softer steel, making them
      easier to sharpen. while Japanese ones are harder (and harder to
      sharpen too). It's generally suggested to avoid buying knife
      sets/blocks, since they have some knives you will not use, while
      taking space.
    </p><p>
      Other interesting bits of information and references on the
      topic are available from <a href="https://news.ycombinator.com/item?id=37396479">the Hacker News thread on "Forming an
      Edge"</a>.
    </p><h2>Cookware</h2><p>
      There is a Wikipedia article on <a href="https://en.wikipedia.org/wiki/Cookware_and_bakeware">cookware and bakeware</a>. The most
      common materials:
    </p><dl>
      <dt>Ceramic and other non-stick surfaces</dt>
      <dd>
        Non-stick and easy to clean. They require non-metal tools,
        lower temperatures (that is, not quite suitable for searing),
        and they wear down over time anyway. With teflon, PTFE can be
        unsafe at higher temperatures, PFOA is toxic, and apparently
        the environmental impact of their production is pretty
        bad. Additionally, there are dubious "granite" or "marble"
        non-stick surfaces, which don't contain granite or marble, or
        "diamond", which apparently contain diamond dust, so care
        should be taken with unusual ones.
      </dd>
      <dt>Cast iron, carbon steel, cast aluminium</dt>
      <dd>
        Those are non-stick with seasoning, durable, cast iron ones
        have high heat retention and are suitable for searing
        (see <a href="https://en.wikipedia.org/wiki/Maillard_reaction">Maillard reaction</a>). Shouldn't be used with acidic food
        too much (tomatoes, wine, vinegar, lemon juice, blueberries,
        and see more in the <a href="https://pickyourown.org/ph_of_fruits_and_vegetables_list.htm">Master List of Typical pH and Acid Content
        of Fruits and Vegetables for Home Canning and Preserving</a>;
        might be hard to look pH values up online, since apparently
        many people who write about food started using "alkaline" and
        "acidic" to mean "good" and "bad" respectively) or cleaned
        with soap, since it can ruin the seasoning. The overall
        maintenance (seasoning, cleaning, not ruining the seasoning)
        is relatively tricky, though apparently becomes easier with
        experience.
      </dd>
      <dt>Stainless steel</dt>
      <dd>
        Durable and easy to maintain, but sticky (some employ
        deglazing and make pan sauces to deal with it, though even
        occasional scrubbing may be easier than dealing with cast
        iron). Clad aluminium ones are commonly used to improve heat
        distribution (either a sandwich/disk on the base, or
        clad/entire pan, which is supposedly better), though not clear
        how well it works. A supposedly suitable temperature to reduce
        sticking can be tested using <a href="https://en.wikipedia.org/wiki/Leidenfrost_effect">Leidenfrost effect</a>, with "water
        drop test". Suitable for pretty much any task, just not the
        best for searing.
      </dd>
      <dt>Copper</dt>
      <dd>
        Apparently most uniform heat and good conductivity. Commonly
        lined with stainless steel or other corrosion-resistant
        surfaces.
      </dd>
    </dl><p>
      I am mostly using stainless steel ones (without non-stick
      surfaces), with cast iron only for searing. But searing is
      possible with stainless steel, too, and one can use a single
      stainless steel saute pan (or saucier; a relatively deep or tall
      pan) for pretty much any cooking needs.
    </p><p>
      As with most other items, picking established manufacturers
      seems to be a good strategy.
    </p><h2>Discovery</h2><h3>Dishes</h3><p>
      There are various ways to discover new dishes, including
      Wikipedia's articles on regional cuisines (e.g., <a href="https://en.wikipedia.org/wiki/Italian_cuisine">Italian
      cuisine</a>, <a href="https://en.wikipedia.org/wiki/Spanish_cuisine">Spanish cuisine</a>,
      <a href="https://en.wikipedia.org/wiki/American_cuisine">American cuisine</a>), websites with recipes, cooking shows, and
      just mentions during conversations, in books, and in movies. I
      found it useful to not dismiss dishes and food items based on
      distaste for local, cheap, and/or poorly cooked versions of
      those, since they can be very different. That applies to
      store-bought dishes as well, including confections: apparently
      many of the odd and unpleasant ones are just unsuccessful
      attempts to reproduce good ones.
    </p><p>
      Along with dishes themselves, meal structures are interesting to learn and
      experiment with: see <a href="https://en.wikipedia.org/wiki/Outline_of_meals">outline of meals</a> and <a href="https://en.wikipedia.org/wiki/Italian_meal_structure">Italian meal structure</a>, for
      instance. And there's usually plenty to learn about each ingredient
      individually (which helps to pick more suitable for a given dish or
      otherwise better ones); as with many other things, Wikipedia is a good
      starting point, and then one can proceed to reading past online
      discussions and/or trying and discussing them online.
    </p><p>
      Discovering that odd local foods and beverages you have never liked are
      not consumed anywhere else, and one can live without them, is another nice
      possibility.
    </p><p>
      Some websites and databases with recipes: <a href="https://en.wikibooks.org/wiki/Cookbook">Wikimedia Cookbook</a>,
      <a href="http://www.supercook.com/">Supercook</a> (handy recipe search based on available
      ingredients), <a href="http://www.simplyrecipes.com/">SimplyRecipes</a>, <a href="https://www.allrecipes.com">Allrecipes</a>, <a href="https://foodsguy.com/">Foods Guy</a>, <a href="https://publicdomainrecipes.com/">Public
      Domain Recipes</a>.
    </p><h3>Ingredients</h3><p>
      It's useful to look closely into every ingredient: learn about their
      types, find reputable brands, try and find out which ones one prefers, and
      possibly even order them from specialized stores.
    </p><p>
      Rather often authentic ingredients will not be available
      (particularly in Russia, due to the import substitution), but
      then it is still better to substitute them and improvise than
      just to give up without trying.
    </p><h3>Cooking</h3><p>
      There are books on cooking, including Wikimedia Cookbook for
      recipes, and <a href="https://en.wikipedia.org/wiki/On_Food_and_Cooking">On Food and Cooking</a>, with nice and useful
      explanations of the common cooking processes (as well as some
      history and other bits), but plenty of useful knowledge can be
      absorbed from just cooking videos with explanations (though in a
      less systematic way). <a href="https://www.the-sourdough-framework.com/">The Sourdough Framework</a> is a seemingly
      nice book focusing on sourdough bread baking, though not so much
      on yeast-based bread baking. Here are some YouTube channels with
      nice recipes and occasional explanations:
    </p><dl>      
      <dt><a href="https://www.youtube.com/user/BrothersGreenEats">Pro Home Cooks</a></dt>
      <dd>Nice and practical everyday recipes with focus on home
        cooking, also explaining how things work.</dd>

      <dt><a href="https://www.youtube.com/c/CookwithE">Ethan Chlebowski</a></dt>
      <dd>More of everyday cooking, also with explanations and
        tips. Textual versions of the recipes are available
        at <a href="https://www.ethanchlebowski.com/">ethanchlebowski.com</a>.</dd>

      <dt><a href="https://www.youtube.com/c/FrenchGuyCooking">Alex</a></dt>
      <dd>Goes pretty deep into details and techniques, good for
        learning about cooking in general (and not just particular
        recipes).</dd>

      <dt><a href="https://www.youtube.com/user/aragusea/featured">Adam Ragusea</a></dt>
      <dd>More of general tips and comprehensive explanations, as well
        as specific recipes.</dd>

      <dt><a href="https://www.youtube.com/c/ClaireSaffitzxDessertPerson/featured">Claire Saffitz x Dessert Person</a></dt>
      <dd>Desserts. Plenty of those, with comments/explanations. But
        US-based, so the sugar from those recipes can be cut in
        half.</dd>

      <dt><a href="https://www.youtube.com/c/gennarocontaldo/videos">Gennaro Contaldo</a></dt>
      <dd>Italian cuisine, though the videos may be strangely
        emotional, making a show of it. Not that much of explanations,
        mostly quick cooking.</dd>

      <dt><a href="https://www.youtube.com/user/vincenzosplate">Vincenzo's Plate</a></dt>
      <dd>Features Italian cuisine too, and similarly a bit strange/showy.</dd>

      <dt><a href="https://www.youtube.com/user/JamieOliver">Jamie Oliver</a></dt>
      <dd>Shares many recipes.</dd>

      <dt><a href="https://www.youtube.com/c/buzzfeedtasty/featured">Tasty</a></dt>
      <dd>Many assorted recipes, apparently a part of BuzzFeed,
        occasional explanations. The measurements are inappropriate
        sometimes (e.g., flour is given by volume).</dd>

      <dt><a href="https://www.youtube.com/user/gordonramsay">Gordon Ramsay</a></dt>
      <dd>Known for abusing people in cooking shows, and being abused
        by another cook in the past, but shares many recipes, as well
        as occasional cooking guides.</dd>

      <dt><a href="https://www.youtube.com/c/JoshuaWeissman">Joshua Weissman</a></dt>
      <dd>
        A weird channel: dirty jokes, weird visual and audio effects,
        the host sings, slaps food and himself, but shares many nice
        recipes and advices. I heard that this strange behavior can be
        explained by Austin's unofficial motto "Keep Austin
        Weird". Textual recipes are available at <a href="https://www.joshuaweissman.com/">joshuaweissman.com</a>,
        and they are nicer than random ones on the Internet, with
        ingredients for baking given by weight.
      </dd>

      <dt><a href="https://www.youtube.com/user/MOMables">MOMables - Laura Fuentes</a></dt>
      <dd>
        Recipes focusing on practicality, but still nice: one-pot
        dishes, freezing advices, meal preparation.
      </dd>

      <dt><a href="https://www.youtube.com/@TheMealPrepManual">TheMealPrepManual by Josh Cortis</a></dt>
      <dd>
        Meal preparation recipes and guidelines.
      </dd>

      <dt><a href="https://www.youtube.com/user/epicuriousdotcom">Epicurious</a></dt>
      <dd>
        A mix of regular recipes and slightly chaotic comparisons of
        different methods of cooking the same dishes. The
        corresponding website, with articles on the subject,
        is <a href="https://www.epicurious.com/">epicurious.com</a>.
      </dd>

      <dt><a href="https://www.youtube.com/c/NOTANOTHERCOOKINGSHOW">NOT ANOTHER COOKING SHOW</a></dt>
      <dd>Yet another cooking show. Mostly recipes, some guides.</dd>

      <dt><a href="https://www.youtube.com/c/foodwishes">Food Wishes</a></dt>
      <dd>Relatively short videos with recipes.</dd>

      <dt><a href="https://www.youtube.com/@PreppyKitchen">Preppy Kitchen</a></dt>
      <dd>Many nice recipes; accompanied by <a href="https://preppykitchen.com/">preppykitchen.com</a>, which
        has the recipes written down (once you pass the captcha, the
        version for printing is more to the point).</dd>

      <dt><a href="https://www.youtube.com/@jameshoffmann/videos">James Hoffmann</a></dt>
      <dd>Videos on coffee brewing and related equipment.</dd>

      <dt>(Martha Stewart Living) <a href="https://www.youtube.com/@everydayfood">Everyday Food</a></dt>
      <dd>Another channel with many video recipes.</dd>
    </dl><p>
      There also are shows not strictly related to learning how to
      cook, but food-related and interesting and/or
      entertaining: <a href="https://www.youtube.com/user/jastownsendandson">Townsends</a> often covers 18th century cooking
      practices, <a href="https://www.youtube.com/c/TastingHistory/videos">Tasting History with Max Miller</a> presents recipes from
      more places and periods, <a href="https://www.youtube.com/c/WeirdHistory">Weird History</a> and other history-related
      channels cover topics such as historical diets and history of
      various food products, <a href="https://en.wikipedia.org/wiki/Food_Factory">Food Factory</a> and standalone documentaries
      demonstrate (though usually only cursorily, not getting into
      industrial and manufacturing engineering) food mass
      manufacturing processes.
    </p><p>
      There are occasional nice websites dedicated to cooking around,
      such as <a href="https://nchfp.uga.edu/">National Center for Home Food Preservation</a>, <a href="https://www.seriouseats.com/">Serious
      Eats</a>.
    </p><p>
      <a href="https://traumbooks.itch.io/the-sad-bastard-cookbook">The Sad Bastard Cookbook: Food you can make so you don't die</a>
      looks amusing, though as the title implies, the recipes are not
      particularly exciting.
    </p><h2>Meals by complexity</h2><p>
      I find it useful to compose a menu of the dishes you like and know how to
      cook. Below is mine, with meals grouped by complexity and cooking time.
    </p><h3>Virtually no cooking</h3><p>
      The following dishes don't require any heating, or even much of cutting,
      and are mostly about putting things together (or just eating them whole):
    </p><ul>
      <li>Muesli (granola) with milk or yoghurt, overnight oats.</li>
      <li>Standalone fruits, vegetables, and beans; fresh, dried, or
        canned. Also nuts, cheese, yoghurts, bread, ham.</li>
      <li>Sandwiches: depending on ingredients, they can cover pretty
        much all the food groups; see the <a href="https://en.wikipedia.org/wiki/List_of_sandwiches">list of sandwiches</a> for
        inspiration. The "<a href="https://www.youtube.com/watch?v=0rmrZZj1Hjs">Why are Deli Subs better than homemade
        ones?</a>" video contains nice submarine sandwich building
        tips. Around the time of writing, <a href="https://en.wikipedia.org/wiki/Avocado_toast">avocado toasts</a> seem to be a
        bit of a fad, but they are actually nice and easy to
        make. <a href="https://en.wikipedia.org/wiki/Bruschetta">Bruschetta</a> shares those qualities, too, and one can make
        particularly easy versions of those by simply combining
        (optionally toasted) bread, whole garlic, salt, olive
        oil.</li>
      <li>Pre-made/store-bought meals (including take-out and food
        deliveries).</li>
      <li>Desserts: oatmeal balls.</li>
      <li>Beverages: water, juices, milk, maybe lemonades.</li>
    </ul><h3>Minimal cooking</h3><p>
      The following dishes are comparable in complexity to brewing
      tea/coffee/cocoa, requiring just a few ingredients (hence little
      planning), little skill or action, and not much of attention:
    </p><ul>
      <li>Homemade muesli/granola (e.g., mixing and baking it once in
        a while, then just adding milk or yoghurt to make a
        breakfast).</li>
      <li>Porridge (oatmeal and others).</li>
      <li>Eggs: boiled eggs, scrambled eggs, omelettes, poached eggs,
        fried eggs, <a href="https://en.wikipedia.org/wiki/Egg_in_the_basket">egg in the basket</a>. Can be combined with vegetables
        (e.g., <a href="https://www.allrecipes.com/recipe/268132/scrambled-eggs-with-tomato/">scrambled eggs with tomato</a>, <a href="https://en.wikipedia.org/wiki/Stir-fried_tomato_and_scrambled_eggs">Stir-fried tomato and
        scrambled eggs</a>,
        <a href="https://en.wikipedia.org/wiki/Shakshouka">shakshouka</a>), staple foods (rice -- <a href="https://en.wikipedia.org/wiki/Omurice">omurice</a>, potatoes
        -- <a href="https://en.wikipedia.org/wiki/Spanish_omelette">Spanish omelette</a>) or other leftovers (<a href="https://en.wikipedia.org/wiki/Frittata">frittata</a>). A nice
        protein source. See also: <a href="https://en.wikipedia.org/wiki/List_of_egg_dishes">a list of egg dishes in
        Wikipedia</a>. Similarly to meat and fish, eggs are important to
        not overcook: not only overcooking harms the texture, but it
        also leads to the release of unpleasantly smelling hydrogen
        sulfide. Plain scrambled eggs on a stainless steel pan seem to
        be best cooked on a low heat, allowing to stir sufficiently
        before they stick too much, and simplifying the cleaning.</li>
      <li>Meatballs. Soaked bread crumbs can be used as a binder,
        while with eggs there is a danger of unpleasant smell,
        especially if one is not careful with temperature
        control. Possibly cooking those in a sauce would help with
        temperature control though, similarly to poaching eggs or
        cooking them in shakshouka: water helps to limit the
        temperature. Store-bought ground meat simplifies the process,
        though one should look for a decent one in case of using it,
        since they tend to throw in too much of connective tissue and
        stuff like that in cheaper ones (which is unpleasant to
        eat). It is nice to add cooked onion and garlic into the
        meatball mixture, for better flavor and texture.</li>
      <li>Baked potatoes (whole, potato wedges, or "oven fries"),
        which are supposedly healthier than fried or even boiled ones
        (though those are easy too, and even quicker). Other fruits
        and vegetables can be baked as well. The "<a href="https://www.youtube.com/watch?v=zKEwA__rOHk">Why are a
        restaurant's vegetables so much better than homemade ones?</a>"
        video features a few tips (use of salt and oil, possibly
        pre-heating the tray and/or pre-boiling the vegetables, higher
        heat, spacing).</li>
      <li>Baked meat or fish, too. Though fish tends to produce fishy
        smell, as with pan-frying (except for tuna); something like
        steaming may be a nicer strategy for that. But baking is
        well-suited for thicker beef steaks, larger chicken or turkey
        breasts.</li>
      <li>Pan-fried turkey or chicken (or other meat) pieces. Possibly
        approaching stews or paprikash, or simply as a way to cook
        those quickly.</li>
      <li>Steamed salmon (or perhaps other fish): potentially faster
        than baking, doesn't smell fishy, can be done using a single
        pan (e.g., as in <a href="https://www.allrecipes.com/recipe/263335/citrus-salmon-with-new-potatoes/">Citrus Salmon with New Potatoes</a>).</li>
      <li>Pancakes (plenty of nice recipes around; a particularly nice
        and easy batter consists of mashed bananas, one egg per banana,
        flour with baking powder added to achieve suitable
        consistency).</li>
      <li>Syrniki, a cross between pancakes and cheesecakes. One of
        the nice recipes includes 280 g of tvorog, 40 g of flour, up
        to 40 g of sugar, one egg yolk; combine those, fry on a pan a
        little, then bake for about 5 minutes at 180 degrees Celsius,
        or just bake for 10 to 15 minutes. Mixing tvorog with ricotta
        also works.</li>
      <li>Quesadillas.</li>
      <li><a href="https://en.wikibooks.org/wiki/Cookbook:Making_Salads">Salads</a>: a <a href="https://en.wikipedia.org/wiki/Salad_dressing">salad dressing</a>, vegetables (e.g., some combination
        of cucumbers, tomatoes, lettuce, avocado, olives, salad
        onions, etc), possibly feta/mozzarella/parmesan cheese,
        croutons/bread, chicken/tuna. Preparation is a bit
        time-consuming (takes me about 20 minutes, including
        dishwashing), but one can peel and chop everything for 2-3
        portions at once, and just store it in a refrigerator without
        dressing (salt in particular, since it pulls the water
        out). Or even refrigerate a complete salad for a few
        days. Some also prepare and store dressings
        separately. Apparently tomatoes from sunny places tend to have
        a much nicer flavor; in Russia those usually come from
        Azerbaijan or Uzbekistan. Kumato tomatoes are fine, too. Less
        common is (Viennese) potato salad, and pasta salads.</li>
      <li>Smoothies.</li>
      <li>Gazpacho (basically a vegetable smoothie).</li>
      <li>Soups based on dry soup mixtures (including legumes, pasta, spices).
        Some make such mixtures instead of buying pre-made ones.</li>
      <li>Soups based on frozen vegetable bags, possibly along with
        dry or canned beans, pasta or rice.</li>
      <li>Pasta (ranges from plain boiling of whatever is at hand to
        picking good ingredients and following proper recipes, such as
        pasta al pomodoro, <a href="https://en.wikipedia.org/wiki/Cacio_e_pepe">cacio e pepe</a>, pasta alla gricia,
        amatriciana, carbonara, and more complex ones, and possibly
        even making pasta yourself). 80 (± 20) grams of dried pasta
        per person may be used as a reference value for a meal, though
        some use 150 grams.</li>
      <li>Store-bought frozen pizzas and other store-bought
        meals.</li>
      <li>Burgers.</li>
      <li>Hot dogs (caramelized onions fit well in those; related:
        "<a href="https://slate.com/human-interest/2012/05/how-to-cook-onions-why-recipe-writers-lie-and-lie-about-how-long-they-take-to-caramelize.html">Layers of Deceit: Why do recipe writers lie and lie and lie
        about how long it takes to caramelize onions?</a>").</li>
      <li>Steaks. Searing and careful inner temperature control are
        important, nice meat and meat cuts are desirable, such as rib
        eye steak or strip steak, the Aberdeen/Black Angus breed,
        properly aged (aging makes them darker); butter, thyme, and
        garlic are optional, but the butter should only be added in
        the very end: it contains water, so the temperature will go
        down to about 100 degrees Celsius, while Maillard reaction
        needs 140 to 165. And it is unclear whether basting is any
        useful. Quick and simple, though side dishes (or turning those
        into steak sandwiches) may take more time and effort. Some eat
        fat and sinew, but apparently the steaks are sold with fat to
        cook with/on it, and for those who like it, while it's fine to
        not like and trim it off: either throwing away, along with
        sinew, or using for cooking (probably it's a common knowledge,
        but apparently many also view it as an important part of meat
        and something that shouldn't be thrown away, so I used to be
        uncertain and to feel uneasy about it). Thicker steaks are
        awkward to cook on a stove alone (burning, leading to fumes
        and messing up cast iron pans, as well as possible
        over-searing), so they are better to either slice beforehand
        or finish in an oven. Beef, lamb, and pork steaks take a while
        to digest, so it's best to avoid eating them late (before
        sleep, for dinner).</li>
      <li>Pan-fried potatoes, also working as an easy side dish for a
        steak. It's commonly suggested to simmer them for 5 minutes,
        then fry for about 10 (can be done while a steak is resting,
        reusing the same pan), adding enough oil to make them crispy,
        and stirring occasionally to make them uniformly crispy (some
        call it <a href="https://en.wikipedia.org/wiki/Saut%C3%A9ing">sauteing</a>, though it may be closer to <a href="https://en.wikipedia.org/wiki/Shallow_frying">shallow
        frying</a>).</li>
      <li>Chicken or turkey breasts: poached (it is important to not
        overcook, preferably use a thermometer, and to add some salt
        and spices into the water, or even to use a stock; a useful
        trick is to take the water to a boil, and then turn the heat
        off, waiting for the chicken to warm up slowly), or optionally
        butterflied, then tenderized, marinated (commonly some oil,
        vinegar or lemon juice for acidity, salt, and spices to taste)
        or just seasoned, and pan-fried. Can be eaten by itself, used
        in a salad, in a sandwich, combined with fresh or cooked
        vegetables, and so on.</li>
      <li>Pumpkin soup.</li>
      <li>Burritos. Ground beef (or any other ground meat, or meat
        pieces) can be used as an ingredient for the filling/sauces
        (similar to a ragu or stews in general), producing
        protein-rich food easily, and can be stored for multiple meals
        (either the filling separately from tortillas, or the burritos
        can be refrigerated or frozen).</li>
      <li>Cooked cheese, such as fried <a href="https://en.wikipedia.org/wiki/Halloumi">halloumi</a> (which should be
        cooked on a low heat, with occasional flipping, to avoid
        burning it).</li>
      <li>Dips and sauces: guacamole, pesto, allioli, mayonnaise
        (though raw eggs may be risky). Hummus involves soaking and
        boiling of chickpeas, but it is easy to prepare, tasty, and
        protein-rich.</li>
      <li>Beverages: tea, coffee, cocoa. They can be enjoyable, and
        there is plenty of variation. Also more varied ones, with
        added ginger, honey, and so on; beverages akin
        to <a href="https://www.allrecipes.com/recipe/242148/ginger-turmeric-herbal-tea/">Ginger-Turmeric Herbal Tea</a> can be nice, too. For coffee
        brewing, I like to use AeroPress, though different methods may
        be better for a variety, even when you have a generally
        preferred method.</li>
      <li>Desserts: cookies (including oatmeal, chocolate chip,
        <a href="https://www.gutekueche.at/vanillekipferl-rezept-3720">Vanillekipferl</a>, gingersnap), banana bread, key lime pie,
        cobblers and crumbles (aka crisps), cheesecake (crustless
        ones, including Basque cheesecakes, can be nice and
        nutritious: e.g., 600 g ricotta, 200 g Greek yogurt, 3 eggs, 2
        tbsp flour, 1 tbsp honey, vanilla powder; pour into a
        springform pan lined with parchment paper, bake for an hour at
        200 degrees Celsius), panna cotta (common proportions are
        about 1 g of gelatin per 100 ml of liquids and less than 10 g
        of sugar). Cookie recipes, especially US ones, tend to include
        a lot of sugar (and sometimes salt); depending on one's taste,
        it may be a good idea to reduce those -- sometimes by a half
        or more. To my taste, sugar content (measured as a portion of
        total mass) of 1/8 or 1/7 is fine, 1/4+ or 1/6+ is too
        much.</li>
    </ul><p>
      Many of these can be used as bases to build upon: leftovers and
      fruits/vegetables can be added into soups (including pre-mixed
      ones), on top of frozen pizzas and lasagnas, into scrambled
      eggs, and into other dishes. <a href="https://en.wikipedia.org/wiki/Relish">Relishes</a> are easy to add to some of
      those. Stocks/broths (either store-bought or homemade) are
      useful for soups, needed for risotto, and one can make sauces
      with them.
    </p><h3>Medium complexity</h3><p>
      The following dishes require some planning to get and use the ingredients,
      some timings and attention, but still nothing fancy and not too easy to
      mess up:
    </p><ul>
      <li>Risotto: just a bit more complex and time-consuming than
        some of the pasta dishes, and quite similar generally, but
        those pasta dishes are pushing the limits of "minimal
        cooking", so perhaps here a line can be drawn. Also as other
        "medium complexity" dishes, risotto is fine to reheat. A
        similar dish is Spanish rice (with tomatoes).</li>
      <li>Dal tadka: similar to pasta dishes, but with lentils instead
        of pasta. But pasta has easier versions, with simply boiling
        it, while this one requires a pot and a pan (as do most nicer
        pasta dishes), so not quite as minimal cooking.</li>
      <li>Minestrone (with fresh vegetables): easy, but takes plenty
        of vegetable slicing and a bunch of ingredients for a nice
        one. See, for instance, <a href="https://www.allrecipes.com/recipe/13163/classic-minestrone/">a "classic minestrone" with canned
        beans recipe</a>.</li>
      <li>Chicken soup. Takes up to an hour of active cooking (or less
        with experience). Can be combined with cooking poached
        chicken.</li>
      <li>Stews, ragout, chili con carne (not very different from
        soups though). Common beef stew advices: "<a href="https://www.allrecipes.com/article/how-to-make-beef-stew/">How To Make the Best
        Beef Stew No Matter How You Cook It</a>". Additionally, apparently
        fat can be rendered out by simmering longer (or simply
        trimming it and rendering out beforehand), and for thickening
        one can rely on starch from potatoes or similar vegetables. An
        approximate ingredient list: olive oil, mirepoix (onion,
        carrot, celery), garlic, red bell pepper, button mushrooms,
        ground beef, eggplant, zucchini, potato, tomatoes, spices
        (salt, paprika, black pepper, cumin, etc); takes me 2.5 hours
        to prepare. A chili may be considerably easier and faster:
        e.g., chopped onion, peppers, garlic, then ground meat, maybe
        diced eggplant, spices, canned kidney beans, diced tomatoes,
        salt and flour to thicken in the end. With addition of
        tortilla chips, topped with grated cheddar cheese and mashed
        avocado, chili can be turned into nice nachos.</li>
      <li>Casseroles. There are easier ones (e.g., <a href="https://en.wikipedia.org/wiki/Shepherd's_pie">Shepherd's pie</a>),
        but something like lasagna (e.g., "<a href="https://tasty.co/recipe/the-best-lasagna">The Best Lasagna</a>") takes a
        while, since the sauces are made separately, and then it is
        assembled with multiple layers.</li>
      <li>Pizza. The ingredients are generally simple and widely
        available, but the dough takes time to rise, and it's tricky
        to transfer an assembled pizza onto the cooking surface
        without deforming the pizza (though there are various
        strategies for that; dusting the surface with the widely
        suggested semolina flour is indeed helpful). Another potential
        issue is the dough rising too much while being cooked: I
        noticed that happening while having possibly a bit too much of
        yeast, and while letting it to rise just for an hour instead
        of overnight. Here's <a href="https://www.buzzfeed.com/marietelling/pizza-dough-recipe">the Tasty pizza recipe</a>; <a href="https://www.youtube.com/watch?v=1-SJGQ2HLp8">the Gennaro
        Contaldo pizza dough recipe</a> is 500 g strong flour, 1 tsp salt,
        7 g dry yeast, 325 ml warm water; <a href="https://www.joshuaweissman.com/post/homemade-authentic-pizza">the Joshua Weissman pizza
        dough recipe</a> -- 800 g 00-Tip flour, 512 g water (64%
        hydration, or 39%, using the definition of hydration comparing
        liquid content to total weight, rather than to dry
        ingredients), 3-5 g active dry yeast, 16 g fine sea salt; <a href="https://www.youtube.com/watch?v=8Q_9h6VKm9c">the
        Johnny Di Francesco pizza dough recipe</a> -- 600 ml water, 1 kg
        flour, 30 g salt, 1-2 g yeast. Actually a pizza may be even
        pretty hard to cook smoothly and correctly, but it uses few
        ingredients and there are not many steps in the process.</li>
      <li>Pies. Sweet or savory: pumpkin pies, meat pies, small or
        large ones. Tarts and other similar pastry, too. I hear key
        lime pies with Graham cracker crust are nice, but haven't
        tried those.</li>
      <li>Small pies, hand pies, turnovers, pasties, samosas,
        embanadas (or empanadillas).</li>
      <li>Cakes: chocolate cake (e.g., <a href="https://www.joshuaweissman.com/post/chocolate-cake">a chocolate cake recipe using
          simple ingredients</a>, with the sugar halved, or <a href="https://preppykitchen.com/chocolate-bundt-cake/">a chocolate
          Bundt cake</a>, which is even easier), carrot cake (e.g., "<a href="https://preppykitchen.com/carrot-and-walnut-cake/">easy
          carrot cake recipe</a>", though that one contains about 1 kg of
          added sugar total, which is the quantity one should spread
          over a month; one may try heavily reducing the amount of
          frosting, reducing the sugar in dough a little, making a
          smaller cake, and sharing the cake, though even then it is
          quite a lot, not for regular consumption).</li>
      <li><a href="https://en.wikipedia.org/wiki/Cheesesteak">Cheesesteak</a> sandwiches are nice, but unlike most of the
        other sandwiches, they take a rather long time to make
        carefully and nicely (more than an hour, if you slowly render
        the fat out, caramelize onions on it, cut everything thinly
        beforehand). Though it might be possible to do quickly, with
        experience, and maybe some compromises: see "<a href="https://www.youtube.com/watch?v=lUurLJa2A5E">The 22 minute
          Philly Cheesesteak</a>".</li>
      <li><a href="https://en.wikipedia.org/wiki/Paratha">Paratha</a>, a flatbread: the ingredients are very basic, and
        the procedure is simple, but can be tiring and take quite a
        bit of time to roll them out. Apparently requires practice and
        skill to improve on that.</li>
      <li>Yeast-leavened bread. Can be fairly easy, but it is even
        easier to get it from a store, so probably making it yourself
        does not qualify for "minimal cooking" -- even while it can be
        quite minimal, as in <a href="https://www.youtube.com/watch?v=YwwfI1dSp-U">a ciabatta recipe</a> (+ <a href="https://www.biggerbolderbaking.com/wprm_print/42577">text
        version</a>). <a href="https://www.youtube.com/watch?v=8clAqfrk-pk">French baguettes</a> are made quite similarly (see
        also: <a href="https://www.cookwell.com/recipe/sandwich-baguettes">Sandwich Baguettes</a>, <a href="https://www.youtube.com/watch?v=Z-husjZkxHw">The 5 minute baguette</a>, <a href="https://www.youtube.com/watch?v=iWLDmsD6D3Q">The Easiest
        No Knead Baguette Recipe</a>; the latter uses a highly hydrated
        dough, more flour should be added for it to keep its shape:
        464 grams worked better than 426). Focaccia seems to be among
        easier options.</li>
      <li>Eggs Benedict: not particularly hard or slow to cook, but
        not for regular consumption or cooking: most of other egg
        dishes are healthier, often easier and quicker to make.</li>
      <li>Chicken tikka masala. A nice dish, but may take a while to
        make (at least if you're not experienced in making it, fry
        multiple batches of chicken, and/or use fresh tomatoes for the
        sauce). Apparently an easier and structurally similar dish is
        Hungarian chicken paprikash.</li>
      <li>Homemade deli (lunch) meats (e.g., as in <a href="https://www.joshuaweissman.com/post/2-dollar-sandwich-but-cheaper">The 2 Dollar
          Sandwich</a>, which is a nice sandwich): not hard to make, but
          harder than buying them in a store, and the result is about
        the same (perhaps closer to simply baked meats though).</li>
      <li><a href="https://en.wikipedia.org/wiki/Fried_rice">Fried rice</a>. Actually pretty easy and versatile, but may take
        a longer time if many ingredients are used, and the rice
        should be cooked a day or so in advance. Chili peppers are
        commonly used; it is important to deseed those with a spoon
        (and maybe in gloves), since they do burn the skin for a few
        hours otherwise.</li>
      <li>Yogurt: adding existing yogurt into milk and keeping it warm
        (around 38 degrees Celsius) for hours (some recipes mention 4
        to 12, some mention 7 or more). Many ways to do that,
        including specialized yogurt makers. So far I tried it with
        Activia yogurt and pasteurized whole milk, keeping it warm by
        placing the bottle into a pot of warm water, under a tap, and
        occasionally opening that tap to mix in more of warm
        water. The resulting yogurt tastes very similar to the
        starter, and it is a little thicker.</li>
      <li>Strudels (e.g., <a href="https://www.gutekueche.at/oesterreichischer-apfelstrudel-rezept-4371">Österreichischer Apfelstrudel</a>, <a href="https://www.youtube.com/watch?v=rhLrPCfTxxs">Apple
          Strudel</a>). The ingredients are simple, but it takes some
          time, and the dough stretching and rolling up should be done
          carefully. I liked dough consistency with 170 ml water, 400
        g flour, 1 egg, 3 tbsp olive oil, a pinch of salt.</li>
    </ul><p>
      While these take longer to cook, many of them can be stored in a
      refrigerator and re-heated for a few days, so the cooking time
      per meal is not long.
    </p><h3>Complex recipes</h3><ul>
      <li><a href="https://www.homecookingadventure.com/caramel-apple-crisp-cheesecake/">Caramel Apple Crisp Cheesecake</a>. Not hard, but laborious:
          easily takes hours, contrary to the 40 minutes mentioned in
          the recipe.</li>
    </ul><h2>Planning</h2><p>
      In addition to reducing the number of grocery store trips,
      planning (or sufficiently good improvisation) may help to spend
      less time cooking by preparing multiple meals at once, as well
      as to get nicer meals (with stocks, possibly sauces, and other
      homemade ingredients one may prepare separately and/or for
      multiple dishes at once). Materials on the topic can be found
      using the "meal prep" keywords.
    </p><p>
      When planning goes a bit wrong and mold appears, generally soft,
      liquid/moist, or porous foods should be discarded, while
      hard/firm ones may be kept after cutting out the moldy bits. See
      "<a href="https://www.fsis.usda.gov/food-safety/safe-food-handling-and-preparation/food-safety-basics/molds-food-are-they-dangerous">Molds on Food: Are They Dangerous?</a>", "<a href="https://www.foodnetwork.com/healthyeats/2017/04/moldy-foods-when-to-toss-when-to-keep">Moldy Foods: When to
      Toss, When to Keep</a>".
    </p><h3>Meal preparation</h3><p>
      Some of the dish groups suitable (and commonly used) for meal
      prep are soups, containers with rice, some protein, vegetables,
      and sauces (refrigerated or frozen), and things like burritos,
      possibly frozen.
    </p><h3>Refrigeration and freezing</h3><p>
      For cut or chopped vegetables, USDA's "<a href="https://ask.usda.gov/s/article/How-should-I-store-cut-fruit-and-vegetables">How should I store cut
      fruit and vegetables?</a>" suggests to refrigerate cut fruits and
      vegetables in covered containers; "<a href="https://www.craftsy.com/post/storing-cut-vegetables/">So Fresh and So Clean: How to
      Store Cut Vegetables</a>" and "<a href="https://thedinnershift.com/meal-prepping/meal-prep-guides/how-to-store-prepped-vegetables/">Meal Prep Guide: How to Store Prepped
      Vegetables</a>" are more detailed guides to refrigerating and
      freezing various vegetables.
    </p><p>
      For whole vegetables, I think generally one can see how they are
      stored in a grocery store, and store them similarly.
    </p><p>
      FoodSafety.gov's <a href="https://www.foodsafety.gov/food-safety-charts/cold-food-storage-charts">Cold Food Storage Chart</a> is a handy general
      table.
    </p><h2>Peeling</h2><p>
      While a lot of fruits and vegetables should be consumed, and
      many of the fresh ones have a rather short shelf life, an
      additional difficulty for me is that I have rather unpleasant
      reaction to biting some of their skins (goosebumps and brief
      toothache), so peeling is needed. Some also peel them simply
      because they don't like the skins, and in some cases those are
      not quite edible.
    </p><p>
      <a href="https://en.wikipedia.org/wiki/Blanching_(cooking)">Blanching</a> (putting food into boiling water, and optionally into cold water
      afterwards) sometimes makes skins easy to peel; works with tomatoes and
      peaches.
    </p><p>
      A process for pepper peeling is somewhat similar to blanching:
      it's easier to peel after a few minutes in an oven (or a grill,
      or rotating on an open fire) and 5 to 60 minutes in an airtight
      container (which is supposed to produce moisture under its
      skin). Apparently some people (those cooking chiles en nogada),
      using certain varieties of peppers, manage to carefully stuff
      them after skinning, but at least with bell peppers I found it
      to be very difficult, tiring, and time-consuming to peel a
      pepper without it falling apart, whether with a vegetable peeler
      and knife, or open fire or an oven, steaming, and knife. A much
      better idea is to go slightly less fancy and just make a
      casserole, with pepper (if you want it) simply chopped into the
      mix: then you don't care if it falls apart.
    </p><p>
      A vegetable peeler is handy for carrots and cucumbers. A bit less handy
      (but quite suitable) for potatoes. One can use it for pepper too, but for
      bell pepper it works better to cut it before peeling, so that there's no
      concave bits inaccessible to the peeler.
    </p><p>
      Pretty much everything can be peeled (skinned) with a knife,
      possibly leaving a bit more waste and/or taking a bit longer
      than with the alternatives.
    </p><p>
      For standalone snacks, apples (with a tough skin) can be
      replaced with pears. Also some apples are much softer than
      others: ripe (yellow) Golden Delicious is among nice ones.
    </p><h2>Safe cooking temperatures</h2><p>
      Overcooking meat, poultry, or fish makes it tough and dry, yet
      it's pretty common, while undercooking is unsafe. So it's a good
      idea to use a thermometer, possibly to employ techniques that
      make it easier to reach and sustain desirable temperatures (that
      is, cooking longer, but at lower temperatures: poaching, sous
      vide). See <a href="https://www.fsis.usda.gov/food-safety/safe-food-handling-and-preparation/food-safety-basics/safe-temperature-chart">Safe Minimum Internal Temperature Chart</a>, "<a href="https://extension.umn.edu/food-service-industry/keep-food-safe-time-and-temperature-control">Keep food
      safe with time and temperature control</a>". It should also be
      cooled quickly, and sometimes time can be traded for
      temperature. Here's a copy of the USDA chart, since I'm checking
      it often, and it'll save a click:
    </p><ul>
      <li>Beef, Pork, Veal and Lamb Steaks, chops, roasts: 145 °F
        (62.8 °C) and allow to rest for at least 3 minutes</li>
      <li>Ground Meats: 160 °F (71.1 °C)</li>
      <li>Ground Poultry: 165 °F (73.9 °C)</li>
      <li>Ham, fresh or smoked (uncooked): 145 °F (62.8 °C) and allow
        to rest for at least 3 minutes</li>
      <li>Fully Cooked Ham (to reheat): Reheat cooked hams packaged in
        USDA-inspected plants to 140 °F (60 °C) and all others to 165 °F
        (73.9 °C).</li>
      <li>All Poultry (breasts, whole bird, legs, thighs, wings,
        ground poultry, giblets, and stuffing): 165 °F (73.9 °C)</li>
      <li>Eggs: 160 °F (71.1 °C)</li>
      <li>Fish and Shellfish: 145 °F (62.8 °C)</li>
      <li>Leftovers: 165 °F (73.9 °C)</li>
      <li>Casseroles: 165 °F (73.9 °C)</li>
    </ul><p>
      Somewhat related are tips on thawing (e.g., <a href="https://www.thespruceeats.com/how-to-defrost-fish-5115722">How to Defrost
      Fish</a>): it's suggested to defrost in either a refrigerator or
      in cold water (if it has to be done quickly), but not at a room
      temperature.
    </p><h2>Units of measurement</h2><p>
      Generally 1 cup approximately equals to 284 ml (though it can be
      236 or 240 ml for an US cup), 1 tablespoon to 18 ml (15 ml for
      US ones), 1 teaspoon to 6 (5 for US) ml. <a href="https://en.wikipedia.org/wiki/Baker_percentage">Baker percentage</a> is
      both handy and important for precision (along with usage of
      weights for flour), but often it is not used, and then
      an <a href="https://www.kingarthurbaking.com/learn/ingredient-weight-chart">ingredient weight chart</a> may be useful: 1 cup of all-purpose
      flour may be about 120 grams, for
      instance. Additionally, <a href="https://en.wikipedia.org/wiki/Imperial_units">Imperial units</a> are often used in
      recipes.
    </p><h2>Long shelf life foods</h2><p>
      While <a href="https://en.wikipedia.org/wiki/Survivalism">survivalism</a> is not my hobby, the end of 2024 in Russia
      feels like uncertain times, and it may be useful to be at least
      a little prepared for various eventualities, including food
      shortages, as those happen in similar situations sometimes;
      likely it will be too late to start preparing once they will
      begin.
    </p><p>
      Some lists: <a href="https://www.primalsurvivor.net/food-long-shelf-life/">Long Term Food Storage List: 26 Foods with a Long
      Shelf Life</a>, <a href="https://www.tasteofhome.com/article/long-term-food-storage-staples-that-last-forever/">32 Long Shelf Life Foods to Keep In Your
      Pantry</a>, <a href="https://commonsensehome.com/long-shelf-life-foods/">Long Shelf Life Foods – What Lasts Best</a>, <a href="https://thepreppingguide.com/foods-with-longest-shelf-life/">Long Life Food:
      A Comprehensive List of Shelf-Stable Essentials</a>, <a href="https://emergencyprepguy.com/22-foods-that-last-up-to-25-years/">22 Foods That
      Last Up To 25 Years To Stockpile</a>. The commonly suggested
      items for very long storage (on the order of 10 years) are salt,
      sugar, honey, white rice, popcorn, freeze dried fruits and
      vegetables, vinegar, corn starch, soda, instant coffee, powdered
      milk and eggs, dried beans and legumes, pasta, flour, whole
      grains, low-fat crackers, maybe rolled oats, buckwheat, canned
      foods. Proper storage is important, and much of that is commonly
      suggested to seal in Mylar (polyethylene-laminated aluminized
      BoPET) bags with oxygen absorbers to achieve a longer shelf life
      (see <a href="https://www.usaemergencysupply.com/information-center/packing-your-own-food-storage/oxygen-absorbers-recommended-amounts">Oxygen Absorbers Recommended Amounts</a>). Though real Mylar
      bags seem tricky to find in some places, and one may have to
      look into other options: food storage buckets, glass jars.
    </p></xhtml:div></content></entry>
</feed>
