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, 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.

Latest Items

Site updates, new font for better contrast and other small CSS fixes

12-01-2021 | Remy van Elst

New year, time for some site updates. This site is generated with my self-written open source static site generator named ingsoc (named after 1984) and this update is a collection of small improvements. A new font, internal code updates to the generator and a few CSS fixes here and there. This article goes over all of them including screenshots before and after!

Read more...

Bash HTTP monitoring dashboard

Published: 27-12-2020 | Last update: 11-01-2021 | Author: Remy van Elst

This is a shell script that creates a webpage with the status of HTTP(s) sites. Parallel checking, thus very fast, only dependencies are curl and bash (version 4 or above). For all of you who want a simple script with a nice webpage to check a few websites. Perfect for a wall mounted monitoring display and a Raspberry Pi. Installation and configuration is easy to do inside the script. It scales well, both on the checking side as the information display page (dense on purpose). Failed checks appear right on top for you to act on. I had this script running at home for at least a year in that form, when I showed it to a friend he liked it, asked me to make it public, but before I did that I polished it up a bit.

Read more...

C++ std::async with a concurrency limit (via semaphores)

Published: 09-01-2021 | Last update: 10-01-2021 | Author: Remy van Elst

std::async is an easy way to do multiple things concurrently, without the hurdle of manual thread management in C++. Like batch converting images, database calls, http requests, you name it. Create a few 'std::futures' and later on when they're ready, '.get()' 'm while they're still hot. A 'future' is an object which handles the synchronization and guarantees that the results of the invocation are ready. If you '.get()' it and it's not ready, it will block. Recently I had a use case for concurrency with a limit. I needed to do hundreds of HTTP calls to a JSON API. The concurrency limit was not for the hardware, but for the server on the other side. I didn't want to hammer it with requests. There is no standard way to limit the amount of concurrent jobs via 'std::async'. You can fire of a hundred jobs and it is up to the implementation to not fry the hardware. On linux/gcc it will probably use a thread pool so you're lucky, but you cant assume that. This article will show you a simple short solution to implement a concurrency limit together with std::async, by using a semaphore, implemented with modern (C++ 11) standard library features ('std::mutex', 'std::condition_variable' and such). It also has a C++ 17 version which replaces our custom CriticalSection class with the use of an 'std::scoped_lock' and 'BasicLockable'. We start off with a shorter example showing how to fire off a set number of jobs and wait until all of those are finished before continuing. That is very useful if you have a set number of jobs and want the implementation to handle all the thread work for you.

Read more...

Lets talk about changelogs, or, how I loathe 'bugfixes and performance improvements'

02-01-2021 | Remy van Elst

This is a short personal rant to start the new year off. When you're a multi billion dollar company with more software developers than you'd ever need, how on earth is it possible that your public changelog in an app store is just 'bugfixes and performance improvements'? If that is all you're going to put there, then just leave it blank. Or be honest and put 'We can't be arsed to fill this in' there. For me as a technical user it's not actionable, and your non technical users are not going to read that page anyway.

Read more...

Hacker News vs Lobste.rs in C++, an exercise in parsing json http api's and date/time/timezones

31-12-2020 | Remy van Elst

I recently wondered how many top posts on the Hacker News frontpage are also on Lobsters. At first I reached for my trusty Python, because when I need to do some JSON API parsing that's what I'll use. (Otherwise bash is my default goto for small things, except when json, networking or associative arrays are involved.) But, then, a thought came to my mind. Why not try it with reasonably modern C++. It's what I do at work, so why not a simple personal project. It would involve dependency management (json and a http library), parsing both API endpoints and, most importantly, doing stuff with time. Time, timezones and dates are hard. This article contains a bit of my learning process, compilation and usage instructions and an example run. Go look at the code and run the code yourself. Let me know if my timezone calculations are working outside of GMT+1.

Read more...

C++ set up cpp-httplib with SSL support with cMake

14-12-2020 | Remy van Elst

For a small personal project that talks to a few JSON API's and does some data parsing I needed a header only C++ HTTP library. Header only because that is the simplest way to include it in my project, just copy and paste the file. I came across the project cpp-httplib, which fits my needs, does all the http methods, small, a few examples and it looks modern and has recent development commits. Setup and getting it working was easy, but as soon as I tried an https url, I got an exception ('https scheme is not supported.'). This guide shows you how to setup cpp-httplib for SSL support with cmake. It took me a bit longer than I wanted to set it up correctly, so why not save you the effort.

Read more...

I've packaged up Gnash as a snap, for modern linux

07-12-2020 | Remy van Elst

I hate snaps just as much as the next guy but last week I did something unexpected. I packaged up Gnash as a snap. Gnash is a GNU flash media player, not updated since 2011, and thus removed from the Ubuntu 20.04 repositories. The snap packaging is based on work by phil roche, he wrote about re-packaging older debian packages with an Ubuntu 18.04/16.04 base layer as a snap. My gnash package is confined (no '--classic' needed), the source code for the snap is on my github and on any snap-enabled distro you can now 'snap install gnash-raymii' to enjoy Gnash again.

Read more...

Semi-accurate live stream viewer count (hls/rtmp/restreamer) on the command line

25-11-2020 | Remy van Elst

Due to all the working-from-home in the past few months I had to setup a live stream. At first the stream went directly to YouTube, but after they've screwed up multiple times, we decided to not be dependent on them. Using restreamer, a piece of open source software to live stream both to your own server and to another (YouTube) at the same time, we have more control over the stream and are not surprised by YouTube doing stupid stuff unannounced. Restreamer provides a simple web player that works on all major platforms and streams to YouTube, but one thing it lacks is a live viewer count. That's a hard problem to solve correctly and accurately, in this article I'll show you how to do it semi-accurately via multiple ways, including live graphs. This article contains a rant on YouTube breaking stuff and the commands used to get a live viewer count.

Read more...

Installing OpenVMS 8.4 Alpha inside AXPbox on Debian 10 / Ubuntu 20.04 with networking

Published: 04-11-2020 | Last update: 08-11-2020 | Author: Remy van Elst

In my previous article I announced the fork of the `es40` emulator to `AXPbox` by Tomáš including bug fixes and rework allowing it to install OpenVMS 8.4 without problems. Since then I've contributed a few patches and doc updates, now NetBSD boots as well (the patches for netbsd were from other es40 forks). I've also looked into getting networking setup, since that is a bit of a tedious process due to pcap and linux, pcap being used for network emulation. SIMH (among others, a great VAX emulator) suffers from the same problems with networking. This guide will show you how to install AXPbox and get OpenVMS 8.4 ready and running with networking inside AXPbox. It's a rather long guide with a lot of information and output.

Read more...

std::accumulate in C++

Published: 23-10-2019 | Last update: 07-11-2020 | Author: Remy van Elst

I'm using codewars to practice my development skills. Today I found out about the std::accumulate method in C++ while doing an exercise there. I'm sharing it here because I never heard of it before. It is the numeric header, and it also accepts a custom binary function to apply instead of operator+. This snippet shows some examples including a lambda operator and the for loop you would use otherwise.

Read more...

Get number of incoming connections on specific port with ss

Published: 25-08-2020 | Last update: 07-11-2020 | Author: Remy van Elst

Recently I had to write a few monitoring plugins, one of which was a count of incoming connections to a specific network port. In the past I would have used netstat and a combination of grep and wc filter out only specific ports and established connections, but nowdays netstat is replaced by ss on ubuntu. ss has options to filter directly on all sorts of stuff, like state, ports, protocol, making the command I use more readable and use less pipes.

Read more...

View all Items