When I use ZSH with a custom theme or with starship in a container, sometimes completion is broken: I type some characters (let’s say ts) then TAB for autocompletion and I’ll get the characters I typed and then the completion (in my example, tstsc for tsc). This doesn …
If you use Python, you probably already know of super to call a method from the base class. You probably also know you can use a function as a method if it takes the instance as 1st parameter. What you cannot do is call super().my_method() directly in such a …
While wondering how to run some tests with JavaScript, I discovered that deno, a JavaScript runtime like NodeJS, has support for jupyter notebooks thanks to this article. It works perfectly. Install deno (probably available in your distribution repositories), run deno jupyter --install and you are good to go!
I’ll give some tips to reuse field and model validators and serializers. All my examples will use validators, but it works exactly the same for serializers.
As part of my work to uniformize my server setup around systemd, I decided to make nginx log everything with journald. By default, it logs accesses and errors in log files under /var/log/nginx. I already had one log file per vhost.
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 lists while IN doesn’t. Psycopg will also correctly adapt …
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!
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 …