I'm Remy, a developer from The Netherlands with a focus on 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 and Nucleus RTOS. It controls hardware, runs the UI and has a few utilities for IoT connectivity and configuration. Technology is mostly C++ but includes Microsoft MFC, Flash, Qt 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.
Run MS Teams on a coffee machine?!? (Or: Embedded Linux Framebuffer VNC client)08-04-2021 | Remy van Elst
To fill some time during compiling I tried to get a VNC client running on a coffee machine, specifically to show MS Teams. At work I develop software for these coffee machines in C++, which allows me to do such fun stuff, because from a software point of view, it's just an ARM PC running linux with a framebuffer for graphics. I compiled a few framebuffer VNC clients, fired up an SSH tunnel and used
x11vnc to share one specific window and after a few attempts, Teams was up and running on my 'new' second monitor.
This post contains my little adventure in framebuffer VNC clients, but it's not a comprehensive guide as most of my other articles. Showing you how to set up an Openembedded server with a VariScite specific toolchain is way too much work to cross-compile a simple C program, but since that's my day job, why not use it for fun. It contains some tips for
x11vnc and shows you two different framebuffer VNC clients,
Run one specific clang-tidy check on your entire codebase05-04-2021 | Remy van Elst
Recently I did a major refactor on a piece of code that involved thousands of lines of code which were in one way or another related to string handling. All of the code handled
char* (C style character pointer arrays) and the concept of
const or ownership was literally unknown in that part of the codebase. The refactored code uses
std::string's, but due to the legacy nature, a large number of methods returned
nullptr's instead of empty strings. I understand why this was done, but finding all those instances and the fact it only gives a runtime error was a bit of a bummer.
clang-tidy is here to save the day. In my IDE, CLion, it gives a warning when you return a
nullptr. It however does that only in the file you're currently editing, and since we're talking millions of files, I wasn't going to open them by hand. You can run
clang-tidy easily on one file, and it's not hard to run it on an entire codebase as well, using the script
run-clang-tidy.py, provided in their packages.
This snippet shows you how to run one specific
clang-tidy check, in my case,
bugprone-string-constructor, on a (cmake and C++) codebase.
Three ways to print booleans as 'True' or 'False' in C++21-03-2021 | Remy van Elst
In this article I'll show you three ways to print a textual representation of a boolean in C++. Normally a bool is printed as either a
0 or a
std::cout, but more often than not, if you're printing a
bool, it's better to see
true/false. Imagine reading through lines and lines of boring, repeating log files, how easy is it to miss a
0 in a sea of
1's? I've been there many times, wishing for more verbose logs.
I'll start with a simple
printf with a ternary
(a ? this : that) and continue on to
std::boolalpha. The latter one is more flexible and allows you to set different values to be printed, for localization, and can even be used to parse input streams. That means, the string
true false results in two
booleans, the first being, well,
true and the latter, surprisingly, being
Sparkling NetworkPublished: 12-01-2019 | Last update: 20-03-2021 | 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...
Record your Linux Desktop with ffmpeg and slop to any format17-03-2021 | Remy van Elst
This two-line shell script allows you to record a region of your linux desktop to a video file, or a
ffmpeg. I use it often when a screenshot is not enough, or when you need to explain a sequence of events to someone.
Disable (debug) logging in QT and QML27-02-2021 | Remy van Elst
In QT you can use a few functions from the
qDebug.h header like
qWarning() to log information to the console. In QML you can use the likes of
console.error(). It's also very easy to implement your own logger (eg.
SyslogMessageHandler) if you want something different, like logging to syslog and the console.
In this post I'll show you how to disable both forms of logging in a release build, qml and qt have different ways to manage their output.
QT / QML Signals and Slots with C++25-02-2021 | Remy van Elst
QT has an Observer mechanism built in, which they call 'Signals and Slots'. It allows objects to communicate with each other without having to have knowledge of either ones internals. By inheriting from
QObject and defining a few
Q_PROPERTY macro's, the QT Meta Object Compiler (
moc) does all the hard work for you.
Inside a C++ class this all works handy dandy and is reasonable easy to follow, but when using QML it requires a bit more work. This small example shows you how to bind QML and C++ together using signals and slots, in QT 5.12.
Limit specific process memory on desktop linux with cgroups and earlyoom13-02-2021 | Remy van Elst
On my laptop I recently had trouble with out of memory issues when running
teams and a virtualbox VM. To combat this, I've setup cgroups to limit how much RAM specific applications can use and configured
earlyoom, a very nifty tool that checks available memory and kills the process with the highest
oom_score if available memory falls below 5%. Otherwise, my laptop would first grind to a halt (even without swap) and only after half an hour of seemingly being stuck would the OOM killer kick in. With
earlyoom this hanging behavior is gone, although sometimes applications get killed when I don't expect it. I've given firefox, thunderbird and teams a cgroup with memory limit and clion and virtualbox use their own configuration to limit their RAM usage.This post details how to setup
cgroups to limit memory of specific processes including automatically placing process inside a cgroup.
Reset the SYSTEM password on OpenVMS 8.403-02-2021 | Remy van Elst
This short post shows you how to reset the SYSTEM account password on a single OpenVMS 8.4 ALpha machine via the serial console. You need physical access to the machine and the procedure looks a lot like linux and appending
init=/bin/bash to the GRUB commandline to boot into single user mode. It is tested on the AXPbox Alpha emulator, I forgot my password after not using it for a month.
The Common Desktop Environment (CDE) is still developed and modern in 202128-01-2021 | Remy van Elst
While playing around with the GUI on OpenVMS I was looking for CDE documentation and I found out CDE is still being developed and can be installed on modern linux. This quick post shows you how to install CDE on Debian 10 and includes a bit on compiling GENERIC TETRIS, the same program I installed on OpenVMS. Really cool to compile and run a game from 1992 on a retro/modern desktop environment.Read more...
OpenVMS CDE Desktop Remote X session GUI (on AXPbox)26-01-2021 | Remy van Elst
Last year November, I posted on a new OpenVMS related project, AXPbox, the open source Alpha emulator, a fork of es40 by Tomáš Glozar. Last week I put together the first official release of AXPbox, one of the changes being in the network code, making it more stable, thus being able to run a remote X session. Meaning, you can run the CDE desktop and enjoy everything the OpenVMS GUI has to offer. This article shows you how to run the CDE GUI in a remote X session, including switching between the old Motif look and the new DECWindows and how to run Tetris.Read more...