Extract 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

Switching from Aurelia CLI to Webpack

Posted on 2020-07-04 in Aurelia • Tagged with JavaScript, Aurelia, Webpack

Recently I decided to change the build system I use on my main Aurelia project. I changed in April 2016 from JSPM to Webpack (JSPM was really not awesome at the time, I can't say for now), again in August 2016 from Webpack to the CLI and now I am …


Continue reading

Should you build a SPA?

Posted on 2020-06-15 in Programmation • Tagged with JavaScript, Web, Django

This article is an update to a previous article why you want to build a SPA which I think was laking some nuance and precision. Reading this article is not required to read this one. I'm writing this update because SPAs are very popular and I recently though more about …


Continue reading