PostgreSQL using ANY instead of IN

Posted on 2025-03-31 in Trucs et astuces • Tagged with PostgreSQL, Database

I recently learned while reading psycopg’s documentation (a Python driver for PostgreSQL), that you should use WHERE id = ANY(:values) instead of WHERE id IN :values when filtering over lists. That’s because the ANY operator works with empty list while IN doesn’t. Psycopg will also correctly adapt …


Continue reading

Monitor certificates statuses

Posted on 2025-03-30 in Trucs et astuces

Let’s encrypt recently announced they will stop sending emails when certificates must be renewed. Following this announcement, I created a small script to monitor the status of my certificates and receive an email if they are not renewed in time. Since it can be handy, here it is!

The …


Continue reading

From matomo to plausible

Posted on 2025-03-09 in Blog • Tagged with Web

For several years, I hosted my own Matomo instance to track traffic on my blog and projects while respecting the privacy of my users. It worked well, but it was the only service I had running on MariaDB. All the other ones are running on PostgreSQL. And I had several …


Continue reading

Writing a browser extension

Posted on 2025-02-16 in Programmation • Tagged with Web

I recently wrote a browser extension for Firefox and Chromium based browsers for my Legadilo (RSS feeds aggregator and articles saver) project. The goal is to make it easier and faster to save an article or to subscribe to a feed directly on a web page without forcing you to …


Continue reading

Using podman for containers

Posted on 2025-02-09 in Programmation • Tagged with Docker, podman, containers, systemctl, Linux

Podman is an alternative to Docker and Docker compose. It uses the same CLI interface than Docker and uses the same standardized image format. So you can use an image built with Docker with it or build an image and then use it with Docker. Its podman-compose command is compatible …


Continue reading

Systemd Timers

Posted on 2025-02-01 in Programmation • Tagged with systemctl, Linux

After using anacron for years to run a backup script regularly, I decided to have a look at systemd timers. Overall, anacron worked fine: I could run tasks as my user and it would start tasks if they missed a run. But, I was still frustrated with how it worked …


Continue reading

My take on UV and Ruff

Posted on 2025-01-25 in Programmation • Tagged with Python

I recently tried the new and shiny tools made by astral. I only used them on my personal projects yet, but I’m still very impressed! You may already have heard of them. I’ll try to keep the article concise and won’t dig too deep into the tools …


Continue reading

Execute Python scripts over SSH without copying them

Posted on 2025-01-05 in Trucs et astuces • Tagged with SSH, Linux

You can run scripts (written in Python or any other language) directly on a server if the proper interpreter is installed. I recently used it to run a Python script over several servers without the need to copy the relevant script on the server. It all relies on the following …


Continue reading

Weird test behavior in my Django project test suite after an IntegrityError

Posted on 2024-12-01 in Programmation • Tagged with Python, Web, Django

Recently I encountered a very weird behavior in my Django project test suite. I created a view that caught an IntegrityError from the database (caused by duplicates in a unique index). When this error occurs, I want to respond with a 409 - CONFLICT status code and an error message.

TL …


Continue reading

Offline support almost without Javascript

Posted on 2024-02-27 in Programmation • Tagged with PWA, HTML, Javascript

Recently I wandered wether I could build a website with offline support without building a full SPA. The answer is yes it’s doable: you only need Javascript for the service worker. Just for the fun, I also tried it with navigation done with HTMX and without much surprise it …


Continue reading