I has this customer who uses Hashicorp vault for database access management. When I logged in into the database I noticed that there were a lot of old expired roles that should have been revoked. The roles are created with this creation statement: This parent role is the owner of the database, granting the new…
Author: joris
[C++/QT/OpenSSL/JWT] Minimalistic implementation to create a signed JTW token.
This code should be quite self explanatory. And this is how you can use it. Of course you should never have your private key in your code.
[C++/QT] QFuture delay method
With credits for ChatGPT which after several promts still coulnd’t make 100% functional code. But it gave me the broad idea of the code I could use. It’s simple, It’s elegant. And somehow it isn’t in the Qt codebase for as fas as I could find.
[Vite] Copy vite build output to destination directory
When vite build your bundle, it by default cleans the build output directory. If this directory happens to also be the directory where your webserver is serving the files from, then you might temporary have 404 errors being served to visitors from of your application. Or course you can solve this with separating your building…
[Python][Clang] Extract variabele value from a c++ file in python
Once in a while you want to extract some values from a source file. For example if you want to extract a version number from code to process in a CI server. This example uses the python clang bindings to parse a cpp file and extracts a version number form it. This example used some…
[ASP.net Core] Body based routing with custom MatcherPolicy
From time to time you have to implement an API that has to have the same endpoint but has to do something differently based on the content of the request. For example take the OAuth2 /token endpoint. (This is an example, in real world use you would choose something more secure than this legacy oauth…
Let docker and ufw work nicely
There are a lot of good guides online that show some facets of letting docker work nicely with ufw as firewall. Unfortunately they all miss some small details that I needed to find out myself. Notably I want to give some credits to this post which helped me the most. https://www.mkubaczyk.com/2017/09/05/force-docker-not-bypass-ufw-rules-ubuntu-16-04/ But now what I…
I am going to Mars
Or at least my name is. The Mars 2020-rover has a chip on board with the names of people who have signed up their name. Do you want your name to also go to mars? Fill in the form in this page and get your own boarding pass. https://mars.nasa.gov/layout/embed/send-your-name/mars2020/certificate/?cn=1
Multiplicative persistence
After watching this @numberphile video I wanted to give it a try. Then I came up with this piece if python code to try to find a possible 12 iteration sequence. Result: Just put the prime factors after each other and you have your initial number. You don’t have to search any further because 222222222222222222222222222222222222222222222222222222…
Calculating prime numbers on all your cores
I was playing a bit with OpenMP in GCC and decided to try something fun. Like calculating the first X number of prime numbers. You know… Numbers that are only dividable by one and itself and that are greater than one. So, 2 is prime. 2 is also the only even prime number because all…