Expect the unexpected

“You sound like a broken record” Is something we complain when someone repeats again and again the same concepts. But even broken disks can sometime be useful DISCLAIMER: No filesystem or device were harmed in the making of this experiment 😉 Image credits: Mick Haupt In this article I would like to explore the powerful tools we have in Linux to simulate dealing with broken disks, that is, drives that more or less randomly report errors....

November 19, 2023 · Andrea Manzini

A trip on the rusty D-Bus

Intro 🚌 D-Bus is a message bus system and standard for inter-process communication, mostly used in Linux desktop applications. Both Qt and GLib have high-level abstractions for D-Bus communication, and many of the desktop services we rely on export D-Bus protocols. Also the omnipresent systemd can be only interfaced via D-Bus API. However, D-Bus has its shortcomings — namely a lack of documentation. In this article we’ll explore how to write our own D-Bus Service in Rust and connect it to our D-Bus client....

October 4, 2023 · Andrea Manzini

Using containers for unit testing of bash functions

Intro Unit testing of Bash functions involves the process of systematically verifying the correctness and reliability of individual functions within a Bash script. While Bash is primarily used for scripting and automation, it’s important to ensure that the functions within your scripts work as expected, especially as scripts become more complex. Unit testing in Bash can help catch bugs and prevent unexpected behavior. Fixing bugs Working on a bugfix for an internal shell script, I wanted to add some unit tests to ensure correctness....

August 17, 2023 · Andrea Manzini

Embed git commit hash into an executable

The problem When we write our programs or libraries, usually we ship to the end user a packaged binary. If a user wants to report a bug or ask for a feature, one of the most important information to have is “which version of the software are you using ?” Since as any good programmer you likely use a source code control system, you should not rely only on the numeric version, but it’s practical to include also the git commit hash of the software you are actually shipping....

July 1, 2023 · Andrea Manzini