Skip to main content

Raymii.org Raymii.org Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed | Gopher

Hi there!

I'm Remy, a developer from The Netherlands with a focus on C++, C, C#, Linux and embedded systems.

I currently work for De Jong DUKE were I develop software for an embedded platform that powers coffee machines. This is a C++ and Qt stack running on Yocto Linux. It controls hardware, runs the UI and has a few utilities for IoT connectivity and configuration. Technologies I'm fluid in include C, C# & C++, Windows (MFC/Win32), .NET (Core, Xaml, Framework and C++/CLI), Flash, Qt, PowerShell and ARM kernel drivers. I was Linux and UNIX sysadmin for over 10 years before I got into development.

To read more or get in touch, click here. This is my personal website, these articles do not reflect or are based on work, opinions or policies of any of my (previous) employers. Any resemblance to reality is pure coincidence.

Latest Items

Site update, cookie consent popup (for a static site)

22-03-2023 | Remy van Elst

A small site update this time, just to let you know that I've added a cookie consent popup to this static site. If you reject all cookies, you should not see any advertisements and aren't tracked by Google Analytics. It's open source, cookieconsent by Orest Bida.

Read more...

Named Booleans prevent C++ bugs and save you time

17-02-2023 20:21 | Remy van Elst

During a recent code review I found a hard to spot bug, a misplaced parenthesis in an if statement. I often employ a technique I call named booleans, which would have prevented this bug. It's a simple technique, instead of a long if statement, give every comparison a seperate boolean variable with a descriptive name and use those variables is the if statement. This post shows the bug in question, an example of my named booleans technique and another tip regarding naming magic numbers.

Read more...

Johnnie 'QObject' Walker, replace a service locator pattern while you're at it

14-01-2023 04:30 | Remy van Elst

I've seen many C++ code bases where there was the concept of a service locator. An global static object that anyone can query to get a class. This is handy with old legacy spiderweb intertwined code that gets everything from everywhere, but not so useful when you're trying to unit test code, it is not visible from the header what dependencies you need. My preference goes to dependency injection, give all the dependencies to the class' constructor and use them that way. Makes it easy to mock and if you have many dependencies, it serves as a starting point to refactor in to a more clearly separated architecture. This article shows a piece of code that uses QObject, the Qt object base class, to replace a servicelocator. All QObjects can have a parent QObject, thus a tree is formed, which you can walk back up and search. This effectively replaces the servicelocator, since you can just request a certain type of QObject.

Read more...

APT keeps complaining that the HTTPS certificate cannot be validated?

11-01-2023 05:31 | Remy van Elst

Recently a few of my Ubuntu 20.04 and Debian 11 servers failed to run an apt update because it insisted that the HTTPS certificate for a repository could not be validated, while curl on the same system had no issues connecting. Join me on a deep dive into certificate validation and troubleshooting apt, digging into the C++ source code for apt and GnuTLS and in the end, it turned out to be my own fault due to permission on a folder. However, the error messages were totally unhelpful resolving the mysterious validation problem. This article was written over the period of a few days, chronologically during troubleshooting.

Read more...

Sparkling Network

Published: 12-01-2019 | Last update: 08-01-2023 | Author: Remy van Elst

This is an overview of all the servers in the Sparkling Network, mostly as an overview for myself, but it might be interesting for others. It also has a status overview of the nodes. Prices are monthly, excluding VAT.

Read more...

Leaf Node Monitoring v2023.01 released, major performance improvements, new layout and new checks!

05-01-2023 | Remy van Elst

I'm pleased to announce the next version of Leaf Node Monitoring, the simple and easy to use open source site and server monitoring tool. Major new features include a responsive and adjustable layout, massive performance improvements and a new check type, allowing you to execute external processes, for example, the nagios/monitoring plugins. This post goes over everything that is new in this release.

Read more...

Add moc includes to speed up Qt compilation

12-12-2022 | Remy van Elst

The Meta-Object Compiler, moc, handles Qt's C++ extensions and it is required for signals and slots and properties in Qt. moc reads C++ header files and if the Q_OBJECT macro is used, it generates an extra .cpp file named moc_filename.cpp containing extra (meta-object) code. This post has a bit of background information and a shell script to automatically include moc_*.cpp files in your code whenever Q_OBJECT is used. If you use qmake, this will probably speed up your build and if you use cmake, this will probably speed up incremental builds (when CMAKE_AUTOMOC is on).

Read more...

Spinrite 6.0 on UEFI and an NVMe SSD drive

03-11-2022 21:00 | Remy van Elst

Spinrite is a hard drive recovery and maintenance utility written by Steve Gibson from GRC. It is marketed on the Security Now TWiT podcast which I often listen to. I have bought a copy of it and sometimes use it on solid state disks or SD cards. Spinrite 6.0 is written is assembly language and runs on top of MS-DOS or FreeDOS, using the BIOS. UEFI is not supported and neither are NVMe drives. This post will show you how to run Spinrite 6.0 on such a system anyway, using a modern linux live USB drive that can boot on UEFI only system and VirtualBox, exposing the NVMe disk as a SATA drive.

Read more...

OpenSSL Command Generator

Published: 08-11-2014 | Last update: 15-10-2022 | Author: Remy van Elst

This is a simple page with a form which you can use to generate OpenSSL commands to, for example, create a CSR or a self signed certificate.

Read more...

OpenSSL generate self signed certificate with SAN in one command (subject alternative name)

14-10-2022 22:02 | Remy van Elst

This small one liner lets you generate an OpenSSL self signed certificate with both a common name and a Subject Alternative Name (SAN). Most guides online require you to specify a separate config file but this guide uses a bash trick (process substitution) to pass such a config file to OpenSSL via the command line. If you are using OpenSSL 1.1.1 or higher, there now finally is a built in command line option which I'll also cover.

Read more...

Fade in / fade out in Qt/QML

19-08-2022 21:30 | Remy van Elst

This guide shows you how to add a fade in / fade out effect to a control in QML. There are a lot of built in animations in Qt/QML, but no fade in/fade out. Using a state machine and a SequentialAnimation, we can first animate the opacity, then set the visibility, achieving a fade in / fade out effect. Other ways like a PropertyAnimation are also available but are less expressive or configurable.

Read more...

View all Items