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....
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....
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....
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....
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 !...
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....
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....
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...
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....
My WireGuard Setup
We have a new VPN at work which works with WireGuard. There are a lot of guides on the web like : Wireguard VPN : Typical Setup : The poetry of (in)security Getting Started with WireGuard I’m going to present 2 cases: Home need: I need a VPN access for my phone and laptop in order to access block stuff in some situation. All the traffic goes throught the VPN. It’s the simplest case Work need: I need to access some ip or ip ranges but not all the traffic goes throught the VPN....