RSSAmplifier

Blog

Posts on erenon.hu

Recent blogposts on erenon.hu

erenon.huRSS feed ↗32 posts

Latest posts

Summary of Readings

A non-exhaustive list of non-fiction books in no particular order I read recently, with some recommendation. This post was inspired by the similar posts of Eli Bendersky . Faith The Old Testament . Reading it was a challenge of the faith. Long and often difficult to understand. It is interesting to perceive how the faith of authors change over time, as they refine their understanding of their…

Multidimensional Make Targets

This is about describing targets in GNU Make that depend on many parameters that need to be sampled. Example use-case 1 : There’s a simulation with many input parameters, e.g: weather simulation, with current temperature, humidity, date, duration parameters. You want to run the simulation for some combinations of these parameters. Example use-case 2 : There’s a remote database the can…

To hang an Icon

I wanted to hang a picture, in a way that it doesn’t touch the wall directly, using a protruding hanger. If the hanger is difficult to observe, it makes a nice floating effect. I couldn’t find a “µ” shaped piece of metal, and I don’t have right drills for metal either, so I decided to 3D-print the appropriate hanger. This would have been my first time doing this.…

Restore file from editor memory

I was editing a large text file over sshfs using nvim . Probably due to a lose network cable, during save, the connection broke, and only half of the data reached the remote computer, the other half remained in the send buffers of the kernel. The editor was configured to use no swapfiles, therefore it wrote the target file directly: at this point the second half of the file was lost , and the…

No Miracles

One would argue that miracles do not exist. Long time ago, a prominent member of a now mostly abandoned web forum offered to lend a technical book (JavaScript: The Good Parts) to me, an absolute unknown nobody. For free. No strings attached. Obviously, it isn’t a miracle, just a selfless act of kindness. I was still flattered. 15 years later, I was wondering what happened to him. His blog…

Summary of Readings

A non-exhaustive list of non-fiction books in no particular order I read recently, with some recommendation. This post was inspired by the similar posts of Eli Bendersky . Adventure Endurance: Shackleton’s Incredible Voyage by Alfred Lansing. The true story of how the members of a failed Antarctic expedition struggle for years to get home. Based on journals and interviews with the survived.…

Selfhosted RSS Reader

For some time I was using a simple RSS reader on my phone. However, I wanted to: Read the same set of feeds on multiple devices Archive the scraped content Search the archived content So I looked around for different options. I ruled out proprietary options, fearing their end of life (e.g: Google Reader) or gradual degradation - I wanted something stable. The chosen architecture consists of (1) a…

Why Bazel

Some time ago I was tasked with improving the build system of a large company. Requirements: build (compile and test) a large amount of C++ code (n*100k+ lines), targeting various versions of Linux and Windows, scattered in several repositories, using an enormous number of dependencies (mostly stored as binaries), mixed with Python tests, with the possibility of extending it to Java. This post…

Summary of Readings

A non-exhaustive list of recently read non-fiction books in no particular order. Hit Böjte Csaba füveskönyve 2. , Böjte Csaba. Rövid, tömör, önmagukban megálló, bölcs gondolatok. Csaba atya férfias szeretete átsugárzik a sorain. Szülőknek és útkeresőknek kifejezetten ajánlom. Industrial Design The Design of Everyday Things , by Donald A. Norman. A few good ideas on how to design user interfaces…

LedgerSplit vim function

I manage my finances using ledger . Periodically, I export my bank statements and push them through a make pipeline to get a ledger file. The conversion assigns transactions to accounts based on a set of rules, e.g: If the payee is “Foo Shop”, the account is going to be “Expenses:Food”: 2023-03-09 Foo Shop Expenses:Food 1000 HUF Assets:Card However, sometimes I buy e.g:…

The disgust of sequential processing of binary WebSocket messages in JavaScript

Let’s process binary WebSocket messages in the browser, in the order the server has sent them. The Writing WebSocket client applications MDN article is a reasonable place to start: const ws = new WebSocket ( 'ws://foo.bar/endpoint' ) ws . onmessage = ( event ) => { console . log ( event . data ) } If we were to receive text messages , this’d be all we need. However, with binary…

Sway sessions à la tmux

A window manager allows the user to organize windows of running programs on a desktop. Desktops are mapped to outputs (i.e: monitors). Most window managers support Virtual Desktops , allowing the user to move windows to separate desktops and quickly switch which desktop is shown on a given output (how quickly depends on the window manager: on popular commercial systems, not so quickly). The used…

Summary of Readings

A list of non-fiction books in no particular order I read recently, with some recommendation. This post was inspired by the similar posts of Eli Bendersky . Energy How to Drive a Nuclear Reactor by Colin Tucker. A high level tour for laymans on how a specific kind of nuclear reactors (PWR) work. Goes from the reactor, through the two circuits, to the turbine and the grid. Deftly written, makes you…

Summary of Readings

A non-exhaustive list of non-fiction books in no particular order I read recently, with some recommendation. This post was inspired by the similar posts of Eli Bendersky . Engineering Kelly: More Than My Share of It All by Clarence “Kelly” Johnson. The autobiography of a aeronautical engineer genius, the founder of the Skunk Works. Concise and honest, inspirational. Skunk Works: A…

The Unreasonable Effectiveness of Doing Nothing

Static storage shared between compilation units

Suppose you want to create a static container compilation time, that can be inserted into by different translation units, and can be iterated runtime. For example: // a.cpp void a () { STORE ( 'names' , 'alice' ) } // b.cpp void b () { STORE ( 'names' , 'bob' ) } // c.cpp void c () { STORE ( 'names' , 'charlie' ) } int main () { for ( auto name : fetch ( 'names' )) { std :: cout << name << ',' ;…

Preprocessor foreach compile time

Assume you want to create a preprocessor macro that takes a macro F and a variable number of arguments. When expanded, it invokes F with each argument: #define FOREACH(F, ...) //... FOREACH ( G , a , b , c ) // expands to: G(a) G(b) G(c) Such a macro can be useful for example for a log library. There are several ways to implement it. Here, we compare three different implementations, with regard to…

Snapcast on Demand

Snapcast is a wonderful piece of software: a multiroom client-server audio player, where all clients are time synchronized with the server to play perfectly synced audio. It allows you to play the same music in different rooms, at the same time, using multiple devices. Normally, I listen to music on my desktop. Sometimes, however, I&rsquo;d like to broadcast music to another room. In that room,…

Review of Thriving in a Crowded and Changing World

Thriving in a Crowded and Changing World is a bulky paper written by C++ author Bjarne Stroustrup for the History of Programming Languages ACM conference. I collected a few quotes below that I found interesting. I wanted that tool to write a version of the Unix kernel that could work on multiple processors connected through a local area network or a shared memory. What happened to that vision? In…

Nextcloud on RPi4 with Arch Linux

I experimented with Nextcloud 22 on a Raspberry Pi 4 8 GB, running the aarch64 build of Arch Linux ARM. I found the setup too slow to be useful: even with caching, switching between tabs on the web interface takes seconds, while top shows php-fpm consuming a lot of CPU. Either further tuning would be required, or this hardware is simply too slim for this kind of workload, or more efficient…

Input Latency

This post was inspired by Dan Luu: Computer Latency . I felt that my work setup (see below) is sluggish, even though I got used to it. I wanted to quantify how sluggish it really is. Also, VSCode was advertised to offer a lower latency experience (compared to ssh+vim), as it runs and renders on the local machine: I didn&rsquo;t feel it - I wanted to verify my observation, knowing that I use vim…

Bootstrap aarch64 image on X86

The current (2021-Feb-05) aarch64 Arch Linux ARM image has issues on 8GB Raspberry Pi 4 models: It does not bring up the network interface, and the USB ports are not working, making any interactive fix difficult (without serial cable). A possible fix is to replace the default kernel with a Raspberry specific one. It still results in a 64bit system, only with a non-upstream kernel. If there&rsquo;s…

Automated, encrypted b2 backups with rclone

Here&rsquo;s how to create automated, secure backups on blackblaze using rclone and systemd. First, register a new blackblaze b2 account if you don&rsquo;t have one already. Make sure you select the right region during sign-up - it cannot be changed later. Create a new bucket, name it after your hostname. Create a b2 rclone remote (see doc ). Create a crypt overlay over the b2 remote (see doc ).…

Store SSH key passphrase in password manager

The ssh-agent program can be used to manage unlocked SSH keys. The ssh-add program can be used to add keys to a running ssh-agent . By default, ssh-add uses TTY to ask for a password, if the selected key is password protected. The pass program is a password manager that follows the Unix philosophy. If you want to use pass together with ssh-add, first add the private key password to it: $ pass…

Useful FreeRDP flags for good performance

I need to use RDP to connect to a Windows 10 machine. Equipped with a 4k display, on Arch Linux, with FreeRDP 2.2.0, the following combination of flags turned out to be the best: -grab-keyboard /gfx-h264:avc444 +gfx-progressive . To make it work, first make sure hardware acceleration is enabled. With AMD: $ sudo pacman -Sy xf86-video-amdgpu libva-mesa-driver freerdp Then add this .desktop file: $…

Overloading by concept without concepts in C&#43;&#43; part II

In the previous post, we&rsquo;ve seen how to select an overload from a set of functions based on concepts matching the arguments, without actual concept support in the C++ language. The described solution allows a library to define a single set of overloads. However, how to allow the client to override the library provided overload for a given concept? Simply adding a specialization would result…

Overloading by concept without concepts in C&#43;&#43;

Given the following function: void f(int); Suppose you want to make the behaviour of this function to depend on the argument type. A simple way to use overloading: void f(int); void f(double); What if you want to define an overload for a set of types, which satisfy a given concept? As of C++20, concepts can be used for overloading. Before that, the function has to be converted to a template.…

Applied Ephemeralization

Ephemeralization Do more and more with less and less until eventually you can do everything with nothing Ephemeralism Do more with less, until you can do everything with nothing Also see Wikipedia on Ephemeralization

How to share a calendar entry

Suppose you&rsquo;d like to share a calendar event over the internet, e.g: on your website. The goal is to be support as many platforms as possible: Desktop calendars (Thunderbird, macOS iCal, Outlook) Web applications (Google Calendar) Smartphone applications (Google Calendar App, iOS iCal) The most intuitive way is to create the event in your calendar of choice, and send the invites in the…

The sorcerers frog

Once there was a sorcerer who had the most shining gold. A simple and mild man came to him and wanted to buy this gold from him. The sorcerer said to the simple man: &ldquo;You will not receive this gold, unless you give me better gold and in larger quantity.&rdquo; The man said: &ldquo;I have such a great desire for your gold that I will give you what you want rather than losing it.&rdquo; He…

Bootstrap Typeahead submit on select

The Twitter Bootstrap s Typeahead is a very nice way to provide autocomplete functionality on your text inputs. However, the default configuration might be a bit confusing. When the user clicks on a suggestion in the dropdown menu, the utility populates the input but doesn&rsquo;t submit the form. It&rsquo;s usually ok, but sometimes (e.g: search boxes) it&rsquo;s frustrating. Here&rsquo;s how to…

Imprisoned Toroid - Raytrace on CUDA

The following video is created by a C++/CUDA program using the theory of raytracing which was the most interesting piece of knowledge I learned on the university this semester. Because of its as-good-as-it-should-be quality of the source, I can&rsquo;t opensource it at this precise moment. Meanwhile, take a look at OptiX , which I found a month later I had completed this. The video was rendered at…