RSSAmplifier

Blog

Roman's Random Thoughts

Recent content on Roman's Random Thoughts

blog.opencore.chRSS feed ↗8 posts

Latest posts

The Convenience Trap: Why Seamless Banking Access Can Turn 2FA into 1FA

Multi-factor authentication (MFA) is the bedrock of modern digital security. Its principle is simple and powerful. As Wikipedia defines it, MFA is: an electronic authentication method in which a user is granted access to a website or application only after successfully presenting two or more distinct types of evidence (or factors) to an authentication mechanism. The key phrase here is distinct…

Splitting a string into multiple lines in Solidity: How hard can it be?

For the on-chain SVG generation of an NFT, I recently needed to split an (arbitrary) string into multiple lines. Each line should contain 40 characters. Pretty easy, right? Let’s assume that we use an external function which takes a string and returns a string[] array containing the individual lines. A straight-forward implementation looks like this: solidity First approach function…

Boost.Python: A minimal CMake Config

Although most of the examples and Boost’s documentation uses bjam , you can also use CMake for your Boost.Python projects. A minimal CMakeLists.txt to compile your Python library is provided below. cmake_minimum_required(VERSION 3.10) project(yourlib) set(CMAKE_CXX_STANDARD 17) find_package(Boost COMPONENTS system python3 REQUIRED) find_package(Python3 COMPONENTS Interpreter Development…

Using SavaPage as a Frontend for uniFLOW

A uniFLOW Queue (that is available over SMB) can be integrated quite easily into SavaPage with the CUPS SMB backend. To add it, simply run the following command on the SavaPage server: lpadmin -p uniflow_queue -v smb://serviceaccount:servicepassword@domain/uniflow_server/uniflow_queue -P path/to/driver.ppd While this works, all print jobs will arrive at the uniFLOW server with the used…

Exposing C/C++ Data as a Python NumPy Array

I recently needed to use memory that was allocated inside a C++ library in a Python application which expects a NumPy array without performing any copies. With ctypes , this can be implemented quite easily. Let’s say we have a shared library libcpp.so where a function get_shared_memory returns the pointer to an array of doubles that is stored on the heap: cpp double*…

Setting up Metricbeat on a Docker Swarm Cluster

To monitor your Docker Swarm hosts (and containers) with Metricbeat, you can set up a global sidecar service. You need to mount the host’s filesystem, /sys/fs/cgroup , /proc , and /var/run/docker.sock inside the container to do so. An example compose file for the sidecar looks like this: yaml docker-stack.yml version: '3.7' services: metricbeat: image:…

How to perform zero-copy S3 uploads with the AWS C++ SDK

If you’re ever using the AWS C++ SDK in some constrained environment (such as Lambda functions with limited memory) or care about memory copies, you probably run into the issue of how to upload an existing buffer without copying it ( as other developers did ). You can write your own streambuf wrapper to do so, but if you’re already using boost in your project,…

Unicode Normalization Forms: When ö != ö

Some time ago, a very weird issue was reported to me about a Nextcloud system. The user uploaded a file with an “ö” on a SMB share that was configured as an external storage in the Nextcloud server. But when accessing the folder containing the file over WebDAV, it did not appear (no matter which WebDAV client was used). After ruling out the usual causes (wrong permissions,…