The curious case of nanosleep vs. hr_sleep
This weekend, I finally got around reading a bookmarked paper that proposes an improved nanosleep:
In the following I document a few notes.
The Papers¶
At page 4 I'm asking …
This weekend, I finally got around reading a bookmarked paper that proposes an improved nanosleep:
In the following I document a few notes.
At page 4 I'm asking …
This article describes an approach to blocking ads in audio files and introduces software that implements it.
The modern web is unbearable without a good ad-blocker such as uBlock Origin. Unfortunately, the online marketing industry, while destroying the web, providing creative distribution networks for malware and disinformation campaigns there …
This article introduces shift-tutor, a Linux program that filters shift key events to improve or verify touch typing skills.
Most keyboards contain two shift keys, i.e. one located on the left bottom and the other on the opposite side:
Source: Mliu92, ANSI US QWERTY (Windows, split + rotated), CC …
Recently, I was in the market for a Class-D amplifier to replace an aging model. This article reviews the very compact Fosi Audio TSA7498E 2 channel amplifier I bought from a China based business, via Amazon. tl;dr: Can't recommend, use something better.
I2C is a simple open-drain bus that is popular for connecting devices to microcontrollers (MCUs), such as sensors, RTCs, displays etc. Devices on the I2C bus are addressed by 7 bits and the bus data and clock lines are pulled-up by a set of pull-up resistors. A good first test …
This article describes how to measure a pulse-width-modulated (PWM) signal using the Pokit Meter device.
The Pokit Meter is a very small digital multimeter (DMM) like device that can be interfaced over Bluetooth Low Energy (BLE). Due to its design and small form factor it comes with many limitations, but …
The GD32VF103 is an inexpensive 32 bit RISC-V CPU that integrates a bunch of peripherals. In other words, it's a cheap RISC-V microcontroller (MCU). This article describes how to hook it up, to set up an development environment and do some first steps with its peripherals.
It's well known that syscalls are expensive. And that software mitigations against CPU bugs (such as Meltdown) even have made them more expensive. But how expensive are they really? To begin to answer this question I wrote a small micro-benchmark in order to measure the minimal costs of a syscall …
More and more open source projects seem to switch to the Meson build tool, in the last years. In an attempt to quantify this development I looked at the build tools usage by Fedora packages, during the last 14 years.
Meson is a build tool with good C …
The beauty of perfect hashing is that you never have to deal with any collisions during item lookup. I recently created libphashtable, a perfect hashing hash table library for C/C++ which focuses on minimizing item lookup latency jitter. This article presents benchmarking results that show how its lookup times …
Deploying a new virtual machine 'in the cloud' is simple enough and fast. As long as one doesn't need to setup an encrypted root filesystem. This article shows how to automate the setup of a Fedora system with an encrypted root filesystem remotely - 'in the cloud' - on e.g. a …
When deploying a VM in a remote location one might end up in an impossible situation: a VM base image doesn't contain SSH host keys as otherwise the image couldn't be shared between multiple hosts. But if SSH host keys are auto-generated during the first boot one doesn't know their …
Perhaps the most interesting part of the open RISC-V instruction set architecture (ISA) is the vector extension (RISC-V "V"). In contrast to the average single-instruction multipe-data (SIMD) instruction set, RISC-V vector instructions are vector length agnostic (VLA). Thus, a RISC-V "V" CPU is flexible in choosing a vector register size …
Recently, I launched MANPATH.be - a site for convenient man page browsing. It provides access to the man pages of different distributions, including Fedora, CentOS and OpenSolaris. The about page concisely describes some of the sites features, e.g. human readable links like f30/3/memcpy, permalinks and various kinds …
Some time ago, I was contacted to fix a computer running Ubuntu. Basically, after many flawless LTS distribution upgrade the last one failed and made the graphical boot hang hard. Thus, the fix was to backup the home directory, re-install a fresh Ubuntu and restore the home. Color me surprised …
Getting along without touch typing is possible. But learning touch typing is usually a big productivity boost, reduces stress and may prevent typical keyboard induced health risks. This article describes some learning approaches and optimization opportunities.
The first thing to learn is to place the fingers in a …
Lately, Google mail servers are getting more extravagant in what mail they accept. Setting up a Sender Policy Framework (SPF) DNS record is a relatively low effort way to get mail though users of the Google mail service. (Those users aren't necessarily identifiable by the Gmail domain as it's also …
This article features a watch list of work related movies. A list for getting some peace of mind in the evening after working overtime.
Each movie has some relation to a pathological work related setting. Not always on the surface, but more on a deeper layer of interpretation.
Some of …
Going through an old hardware stash, I've noticed a harddisk that was part of a Solaris test system of mine I disassembled 10 years ago. The disk contains an interesting artifact I implemented at that time: a proof-of-concept for capturing user entered passwords with DTrace.
This article illustrates how the virtual memory (VM) subsystem of the Linux kernel is able to cache files that are located on an NFS server.
In this small experiment we just need two Linux machines on a local network, where one …
Debian recently released a warning advisory regarding a hardware bug in the hyperthreading implementation on certain Skylake/Kaby Lake Intel CPUs. It can be mitigated by a microcode firmware update - at least on some models. This article is about checking a non-Debian system for this issue and verifying if the …
A stock Android device is locked down, by default. Rooting
is the process of getting access to the root user (think: installing
su
). This article lists several advantages of a rooted device.
Grml is a Linux Live CD distribution geared towards system administration tasks and other console work. Unfortunately, its development has slowed down in the past years, i.e. the latest stable release is from 2014. In 2017, when dealing with modern hardware, modern features like Btrfs, SELinux etc. this is …
The firmware updates for the Samsung 840 EVO SSDs come as ISO images which isn't very helpful if your system doesn't have a CDROM drive. It turns out that the ISO images just contain DOS binaries, though. This article describes how to use a FreeDOS USB stick for flashing, instead …
Traditionally, UNIX filesystems also maintain the access time (atime) of a file. This is very much an anti-feature because it yields a write operation for each read operation. Which is obviously bad for performance. Since Btrfs is a copy-on-write (COW) filesystem maintaining atimes is even more painful. Thus, a sensible …
Dell distributes BIOS updates for the Latitude E7270 as PE32 Windows GUI executables. It turns out that the BIOS itself is able to extract the firmware images from such executables and to apply them.
https://www.dell.com/support/home …
When sending a POST request with curl it sometimes automatically
adds an Expect: 100-continue
header. The following summarizes under
which conditions curl/libcurl adds this header.
The Expect: 100-continue
header is specified in HTTP 1.1 and
allows the server to acknowledge or reject a POST/PUT request
immediately …
The Link Layer Discovery Protocol (LLDP) probably isn't the most popular protocol but it can be useful for troubleshooting purposes and for mapping the neighbourhood of a host.
Its purpose is basically to send/receive key/value pairs that are of general interest. For example the switch port number the …
This article discusses hardware performance counter measurements obtained for a character search benchmark running on Intel x86 and SPARC hardware. Those results help to explain the big runtime differences between a SPARC T5 system and Intel x86 ones (SPARC being much slower), as well as differences between the different implementations …
The article std::find() and memchr() Optimizations contains benchmark results for an Intel Core i5, an i7 and an older AMD system. This followup also adds results for a relatively recent SPARC system and an older PPC one.
First released in 2013, the SPARC T5 is a relative …
Assume you need to parse a record based format with flexible
width and one-byte delimiters. When using C++, the std::find()
STL
algorithm is the obvious choice for efficiently locating the
delimiters. The idiomatic C solution is to use memchr()
.
The purpose of the LD_LIBRARY_PATH
environment variable is to instruct the
linker to consider additional directories when searching for libraries. Its
valid use case is the test of alternative library versions installed in
non-standard locations. In contrast to that, globally setting the
LD_LIBRARY_PATH
(e.g. in the profile of a …
There are several products for shipping books in Germany. Two products are really book specific ('Bücher- und Warensendung'), they are cheap but they are slowly transported and there is no tracking. The following table compares different attributes and constraints of the products available in the market (last update: 2020-06-01).
Company … |
---|
The sprintf()
and snprintf()
C library functions are commonly
used for formatting a string and writing the result into a buffer.
But sometimes it is surprising in how many ways sprintf()
can
be misused.
Some enterprise C programs look like submissions to …