Fast DB Branching With BTRFS Subvolumes as Docker Volumes

I encounter a “rather” PITA problem that I’ve had for years: How do I load production DB into a test/integration/you-name-it environment without waiting half a day for it. Ok maybe you have a nice set of fixtures for your app, which eliminiates this need. Still, this need is pretty common. I previsouly stumbled upon this doc of BTRFS/ZFS as a driver for docker storage. And then I remembered this filesystems had CoW1 and snapshot capabilities. ...

May 8, 2025 · 2 min · 373 words · Rémi Desgrange

Python Spatialite on Apple Silicon with Pyenv

For rapid prototyping or for running simple test cases in Django I like to use spatialite the geospatial extension to sqlite. To use Spatialite, you need to have SQLite compiled with extension support. However, both the built-in SQLite on macOS and the one from Homebrew lack this support. As a result, the Python version compiled by Pyenv also lacks this support, since it compiles a near-default configuration of Python, with SQLite extensions disabled by default. ...

April 28, 2023 · 2 min · 249 words · Rémi Desgrange

How to Handle Browser Clipboard in JS

The other day I wanted to be able to copy/paste files to an HTML textarea. like in Github or GitLab. Since I’m not a frontend expert I quickly browsed to MDN. <textarea id="mytextarea"></textarea> const myTextArea = document.querySelector("#mytextarea") myTextArea.addEventListener("paste", (e) => { let paste = (event.clipboardData || window.clipboardData).files; console.log(paste) }) Even if you didn’t read the doc, you might think that if you paste some text, the files element would be empty. Think twice. The clipboardData object contains 2 DataTransferItems objects that are iterator, files and items. An iterator means, once you have consulted it, data is gone. ...

December 15, 2022 · 2 min · 260 words · Rémi Desgrange

TLS Debugging Nightmare With Macos and Nginx

I have a server running Nginx for years 1, and it just work super nice. On thing that I do is watching video with VLC, streaming the video from the server. It worked well on Linux and Windows but not on MacOS. But Why ? The server was TLS 1.3 only. I’m the only one using it so it has a very narrowed cipher suite and just TLSv1.3. It’s working on every OS. Except MacOS. Because VLC uses the “SecureTransport API from MacOS, and it doesn’t support TLS 1.3. ...

May 15, 2022 · 2 min · 258 words · Rémi Desgrange

Qgis Share and Store Style in DB

QGIS is able to save your layers “styles” to a postgresql databases. By style, QGIS means all your layer customization (like labels, fields, form etc…). The annoying part is: by default, the user who created the style is the only one able to open it. Actually QGIS store the (postgres) user who created the style in the db, and filter it QGIS side 1. So, here is a little hack to make QGIS happy and still being able to open style whatever the user request it. ...

April 26, 2022 · 2 min · 368 words · Rémi Desgrange

Booting Qemu-KVM VM Without Grub (or any bootloader)

I am looking more and more into Cloud-Hypervisor or Firecracker. The other day I had this random thoughts: “These trendy new hypervisor can boot a kernel directly, why can’t qemu do it?”. It turned out that it can perfectly does that. Here is a random recipe to have a working Ubuntu, without having to use grub or any bootloader. Note that ubuntu first boot is still utterly slow and bloated (snap and cloud-init, I’m looking at you !). ...

January 21, 2022 · 3 min · 494 words · Rémi Desgrange

Ssh Client Config Tips

This post concat some tips I learned along the way about the SSH which makes me more productive. Put generic Host config at the end The config file is read sequentially, and the first rule that matched will be taken into account. If you put your Host * 1 at the top of your ~/.ssh/config then further rules won’t be applied. Host foo Username bar Hostname foo.baz # this rule will apply to all connection. and appened to the "toto" host definition. Host * AddKeysToAgent yes IdentityFile ~/.ssh/ed25519 Split your config files By default, ssh client, will read his config from /etc/ssh/ssh_config and ~/.ssh/config. The the later one, I like to add this line of config: ...

December 8, 2021 · 2 min · 395 words · Rémi Desgrange

An Abstraction Failure. How a Frankernel Bites Us

Last week a colleague ping us on #container-support slack channel to report us a weird bug. A container worked on his machine, but not on our OpenShift cluster. He said that the dynamic linker was not able to resolve the libQt5Core.so.5. This was new since it worked perfectly for QGIS 3.10 but not in 3.16. Result of ldd /usr/local/bin/qgis_mapserv.fcgi|grep Core where: libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found libQt5Core.so.5 => not found What the hell happened on OpenShift that did not happened on the dev host (which is a ubuntu host)? Why in hell do we have lots of not found line? First Assumption We first (by we I mean colleagues and I) thoughts of: ...

January 29, 2021 · 3 min · 507 words · Rémi Desgrange

Emoji on Linux

I tried several stuff to configure emoji properly on Linux. I really suffer to get it working Here is my desktop setup : Distro: Arch Linux WM: Wayland DE: Gnome Terminal: Alacritty If you don’t know Alacritty, you should check it out. They still have a weird bug with emoji but it’s a great terminal emulator. I installed the noto emoji, but it emoji one also works. On arch: pacman -S noto-fonts-emoji On ubuntu ...

May 7, 2020 · 6 min · 1220 words · Rémi Desgrange

Views vs Generated Columns

We are going to talk about SQL Views and Generated Columns in postgresql. Introduction Views Have you heard about views in SQL? Maybe! Since it has been here since approximatly forever. For those who don’t what a view is, here is a example : CREATE TABLE person ( p_id uuid primary key, p_firstname text, p_lastname text, p_whatever_you_need_to_know text, ); CREATE VIEW v_person AS SELECT p_firstname, p_lastname FROM person; So views are basically a SELECT. ...

April 23, 2020 · 2 min · 395 words · Rémi Desgrange