Some tips to deploy Django in kubernetes

Posted on 2021-03-29 in Trucs et astuces • Tagged with devops, k8s, kubernetes, Django, Python

I am not going to go into details in this article about how you can deploy Django in kubernetes. I am just going to highlight the main points you should pay attention to when deploying a Django app. I expect you to have prior knowledge about how to deploy an …


Continue reading

Enable basic authentication to all pages of a NextJS site

Posted on 2021-03-28 in Trucs et astuces • Tagged with devops

It's not as obvious at it seems. You can protect your API routes or some pages by following the documentation, but nothing to protect everything in one go with basic authentication (to protect your pre-production site from normal user for instance). Despite NexJS having a server component, I didn't find …


Continue reading

Extra kubectl configmap/secret to .env file

Posted on 2021-03-21 in Trucs et astuces • Tagged with devops, k8s, kubernetes

You can extract data from your kubernetes config maps into a .env file with the commands below (requires you to have jq installed):

# Get the data in JSON.
kubectl get configmap my-map --output json |
    # Extract the data section.
    jq '.data' |
    # Replace each "key": "value" pair with "key=value"
    jq -r …

Continue reading

Use a dedicated user to run your database migrations on PostgreSQL

Posted on 2021-03-10 in Blog • Tagged with Django, PostgreSQL

I'll detail here how to use one user to apply your migrations and one to run you site. This method can be applied to any framework and environment as long as your database is PostgreSQL. It's of course possible to do with other databases, but the SQL syntax to achieve …


Continue reading

Small TODO apps

Posted on 2021-03-06 in Blog • Tagged with Rust, Clojure, Haskell

I recently decided to lean a bit of Haskell for fun and see what the language was like. In this context, I decided to create a small TODO app. Since I also wanted to compare my solution with solutions in other languages, I decided to write the TODO app three …


Continue reading

Server tips

Posted on 2020-09-17 in Trucs et astuces

Start systemd services automatically for a user

By default sysemtd services linked to a user – created with systemctl --user enable --now service for instance – are only started after the first login of the user. To start them when the server starts, you …


Continue reading

Make JS code communicate with a ServiceWorker

Posted on 2020-08-18 in Programmation • Tagged with JavaScript, Web, ServiceWorker

If you need to send data from your JS code to your ServiceWorker, you can do it like this:

navigator.serviceWorker.register("./sw.js").then(registration => {
    registration.active.postMessage("Some message");
});

You can then rely on this code in the ServiceWorker to read the message:

self.addEventListener("message", event => {
    console …

Continue reading

Aurelia Store and Immer

Posted on 2020-08-09 in Aurelia • Tagged with JavaScript, TypeScript, Aurelia, RxJS

I spoke last year of Aurelia store in this article At the time, it wasn't possible to combine Aurelia Store and Immer. The root cause of the issue was fixed in the latest version of Immer (7.0), so we can now combine both.

Let's study how to do this …


Continue reading

Testing a clojure web framework

Posted on 2020-08-02 in Blog • Tagged with Clojure, Luminus, Reagent

An opinion about Clojure, Luminus and Reagent after doing a test project with these technologies.


Continue reading

Retrospective on my biggest personal project

Posted on 2020-07-19 in Blog

A retrospective on my biggest and longest personal project.


Continue reading