Output of "--help" of my "ftp-backup" shell wrapper for "lftp" (screenshot).

Modern Command Line Tool for FTP Backups

TL;DR: The convenient CLI-based FTP mirroring tool you wished for (hopefully, lol). In my previous blog post, I presented lftp as my CLI tool of choice in 2024 to connect to FTP servers to perform a parallel recursive download with FTPS (FTP over TLS). However, lftp is a powerful low-level building block, and you need to know how to use it to mirror a directory via FTP. I created a small convenient bash Read more…

Parallel Recursive FTPS Mirroring (Directory Download) from Command Line

TL;DR In this blog post, I show you the best option I found that you can use in 2024 to perform a parallel recursive download (backup) of an FTP directory via FTPS (explicit FTP via TLS) from the command line. lftp is the best command line tool (for Linux, macOS and other UNIX-like systems), but needs to be properly configured. For GUI-focused users, I recommend FileZilla. Introduction FTP is a quite outdated protocol Read more…

Code snippet: Command line tool lftp for a parallel recursive secure FTP download of a remote directory.

Compile Linux out-of-tree Module on NixOS in a Nix shell with an FHS Environment

In an earlier post, I talked about how you can build an out-of-tree Linux kernel module in a Nix derivation, i.e., package it in Nix. However, for quick prototyping, sometimes you want to just enter $ make in your shell, for example to check if everything compiles. Out-of-tree module projects following the recommended guidelines use a Makefile, possibly an additional KBuild file, and of course C source and header files. This header file Read more…

systemd udev Rules to Detect USB Device Plugging (including Bus and Device Number)

The other day, I was working on some udev rules to invoke a script when a USB device is added or removed from my machine. I needed the USB bus and USB port number to further process that event. I decided to use udev for that. However, getting the relevant attributes was not as intuitive as I expected, and existing documentation wasn’t that good. Here’s what I did and how I solved it. Read more…

Screenshot: Nix build: "illegal path referenced in fixed-output derivation". The part on the top shows all Nix store paths that accidentally landed in the derivation (obtained by "grep")

Fixing “Illegal path references in fixed-output derivation” in Nix

The other day I was working with fixed-output derivations. After copying several files to $out, I was facing a “Illegal path references in fixed-output derivation error”. The only helpful reference on the internet I could find was the Nix source code on GitHub. It took me a while to figure out what’s going on. You get this error when your fixed-output derivation places something in $out which contains a Nix store path! This Read more…

Accessing Network from a Nix Derivation (via Fixed output derivations)

Usually, Nix derivations are build in a sandbox that prevent any program from accessing the network. This has a good reason: We want reproducibility in Nix, and using the network is not reproducible for many reasons! But there must be a way of accessing the network from a derivation, right? Why? Because, builtins.fetchGit or builtins.fetchTarball are not flexible enough to cope with the nature of Maven, Cargo, npm or other tools that download Read more…

Code Snippet: Fixed output derivation in Nix