Python's os.path.abspath or Path.absolute are great: you give them a path, which might not exist, and you get a path you can use regardless of the current directory. os.path.abspath will also normalize it, while Path will not by default because with Paths a normal form is less needed. This is great to normalize input, regardless of if it's an existing file you're needing to open, or a new file you're needing to create. In C++17, there is a filesystem library with methods with enticingly simil...| Enrico's blog
I upgraded to Debian testing/trixie, and my network printer stopped appearing in print dialogs. These are notes from the debugging session. Check firewall configuration I tried out kde, which installed plasma-firewall, which installed firewalld, which closed by default the ports used for printing. For extra fun, appindicators are not working in Gnome and so firewall-applet is currently useless, although one can run firewall-config manually, or use the command line that might be more user frie...| Enrico's blog
I use borg and restic to backup files in my system. Sometimes I run a huge download or clone a large git repo and forget to mark it with CACHEDIR.TAG, and it gets picked up slowing the backup process and wasting backup space uselessly. I would like to occasionally audit the system to have an idea of what is a candidate for backup. ncdu would be great for this, but it doesn't know about backup exclusion filters. Let's teach it then. Here's a script that simulates a backup and feeds the results...| Enrico's blog
On Android, there's a spellchecker popup that occasionally appears over the keyboard, getting very annoyingly in the way. See for example this unanswered question with screenshots. It looks like a feature of the keyboard, but it's not, and so I looked and I looked and I could not find how to turn it off. The answer is to look for how to disable the spellchecker in the keyboard section of the android system settings, not in the android keyboard app settings. See for example this answer on stac...| Enrico's blog
I climbed on top of a mountain with a beautiful view, and when I started readying my new laptop for a work call (as one does on top of mountains), I realised that I couldn't right click and it kind of spoiled the mood. Clicking on the bottom right corner of my touchpad left-clicked. Clicking with two fingers left-clicked. Alt-clicking, Super-clicking, Control-clicking, left clicked. Here's there are two ways to simulate mouse buttons with touchpads in Wayland: clicking on different areas at t...| Enrico's blog
My new laptop Framework (Framework Laptop 13 DIY Edition (AMD Ryzen™ 7040 Series)) arrived, all the hardware works out of the box on Debian Stable, and I'm very happy indeed. This post has the notes of all the provisioning steps, so that I can replicate them again if needed. Installing Debian 12 Debian 12's installer just worked, with Secure Boot enabled no less, which was nice. The only glitch is an argument with the guided partitioner, which was uncooperative: I have been hit before by a ...| Enrico's blog
This looks straightforward and is far from it. I expect tool support will improve in the future. Meanwhile, this blog post serves as a step by step explanation for what is going on in code that I'm about to push to my team. Let's take this relatively straightforward python code. It has a function printing an int, and a decorator that makes it argument optional, taking it from a global default if missing: fromunittestimportmockdefault=42defwith_default(f):defwrapped(self,value=None):ifvalueisN...| Enrico's blog
Suppose you have a meson project like this: meson.build: project('example','cpp',version:'1.0',license:'…',default_options:['warning_level=everything','cpp_std=c++17'])subdir('example') example/meson.build: test_example=executable('example-test',['main.cc']) example/string.h: /* This file intentionally left empty */ example/main.cc: #include<cstring>intmain(intargc,constchar*argv[]){std::stringfoo("foo");return0;} This builds fine with autotools and cmake, but not meson: $mesonsetupbuilddir...| Enrico's blog
Slides Slide sources Talk page (including video) Abstract Debusine manages scheduling and distribution of Debian-related tasks (package build, lintian analysis, autopkgtest runs, etc.) to distributed worker machines. It is being developed by Freexian with the intention of giving people access to a range of pre-configured tools and workflows running on remote hardware. Freexian obtained STF funding for a substantial set of Debusine milestones, so development is happening on a clear schedule. W...| Enrico's blog
Slides Talk page (including video) Abstract Although Debian has just turned 30, in my experience it has not yet fully turned adult: we sometimes squabble like boys in puberty, like children we assume that someone takes care of paying the bills and bringing out the trash, we procrastinate on our responsibilities and hope nobody notices. At the same time, we cannot assume that people have the energy and motivation to do what is needed to keep the house clean and the boat afloat: Debian is based...| Enrico's blog
Debian: when you're more likely to get a virus than your laptop| Enrico's blog
Uhm, salsa is not resolving: $ git fetch ssh: Could not resolve hostname salsa.debian.org: Name or service not known fatal: Could not read from remote repository. $ ping salsa.debian.org ping: salsa.debian.org: Name or service not known But... it is? $ host salsa.debian.org salsa.debian.org has address 209.87.16.44 salsa.debian.org has IPv6 address 2607:f8f0:614:1::1274:44 salsa.debian.org mail is handled by 10 mailly.debian.org. salsa.debian.org mail is handled by 10 mitropoulos.debian.org. ...| Enrico's blog
Gtk4 has interesting ways of splitting models and views. One that I didn't find very well documented, especially for Python bindings, is a set of radio buttons backed by a common model. The idea is to define an action that takes a string as a state. Each radio button is assigned a string matching one of the possible states, and when the state of the backend action is changed, the radio buttons are automatically updated. All the examples below use a string for a value type, but anything can be...| Enrico's blog
I acquired some unusual input devices to experiment with, like a CNC control panel and a bluetooth pedal page turner. These identify and behave like a keyboard, sending nice and simple keystrokes, and can be accessed with no drivers or other special software. However, their keystrokes appear together with keystrokes from normal keyboards, which is the expected default when plugging in a keyboard, but not what I want in this case. I'd also like them to be readable via evdev and accessible by m...| Enrico's blog
str.endswith() can take a tuple of possible endings instead of a single string About JACK and Debian There are 3 JACK implementations: jackd1, jackd2, pipewire-jack. jackd1 is mostly superseded in favour of jackd2, and as far as I understand, can be ignored pipewire-jack integrates well with pipewire and the rest of the Linux audio world jackd2 is the native JACK server. When started it handles the sound card directly, and will steal it from pipewire. Non-JACK audio applications will likely c...| Enrico's blog
Migrating from procmail to sieve| Enrico Zini