Category: Coding
-
Modern C++: Implementing a Merkle Tree
Merkle Trees store a hash of the sub-tree in each of the Nodes, so that the whole tree’s contents can be validated against tampering.They are used, for example, in Bitcoin’s blockchain, and in Cassandra to validate replicas.In this article, we will show how to implement a generic Merkle Tree using features of Modern C++. Previous […]
-
Modern C++: Writing a thread-safe Queue
The STL provides a high-performance queue class in std::queue<T>; however, the API is not very intuitive, or easy, to use and it is not safe to access from multiple threads.In this article, we will show how to wrap it in a more convenient, and thread-safe, API. The C++ Standard Template Library (STL) offers a template-class […]
-
Ubuntu: adjust mouse scroll wheel sensitivity
Honestly, it should be easier – then again, it’s Gnome, nothing really is easy. Collecting a combination of various pages (this one finally yielded the right directions) it turns out one has to install imwheel and then adjust the ~/.imwheelrc file: The magic incantation is in the first couple of lines and the value (3 […]
-
filecrypt — OpenSSL-based file encryption, release 0.7.2
Almost four years after its initial inception and release, I have entirely rewritten the CLI invocation, streamlined the encryption secrets management, and created a self-contained executable. Once you have a private/public key pair, a file can be simply encrypted using: ./filecrypt.pyz -o my_file.enc /path/to/plain.txt and decrypted using: ./filecrypt.pyz -o /path/to/plain.txt -d my_file.enc The –send option […]
-
Converting a C++ project to CMake & Conan
This post describes how to fully automate the build/install of a C++ Project, with several dependencies, using CMake and Conan, a package manager. A couple of years back, I needed a simple HTTP client to run some integration tests against a Gossip Server I was developing; it turns out that, something we take for granted […]
-
Running a Bash script forever
It is somewhat desirable to have a Bash script run forever; typical use case is for a long-running Docker container that backgrounds the service, and the startup script (e.g., invoked via the ENTRYPOINT command) needs to be kept alive (terminating the script would result in the process known-as “the container” to terminate too). I have […]
-
Uncompromising Python Formatting
I wanted to give a shout out to Black, “the uncompromising Python code formatter.” It really is liberating not to have to worry about code formatting, not having to have unproductive, sterile discussions over PRs about code minutiae and yet being reassured that all your code is nicely formatted; most importantly, the quality of the […]
-
HOW-TO Install Minikube on MacOS
Minikube is an extremely useful tool to run a development Kubernetes single-node cluster locally, on a development machine. I use it regularly on my Linux box and, as I want to do development on my MacBook Pro too, I thought I’d use it there to. In order to do so, I have created a simple […]
-
QNAP NAS Hybrid Backup Sync restart
I have now had a TS-212 QNAP NAS for many years and I am really (really!) happy with it: it works exceedingly well for what I originally bought it for (a networked backup drive, essentially) but it has also so many more facilities that I really have come to depend on it for a number […]
-
HOW-TO Move your code out of GitHub
As everyone knows by now, Microsoft has bought Github for several $BN’s. Depending on your point of view, this can be either a catastrophe or a disaster: nothing good can possibly come out of it, apart from, possibly, having prevented Github (the corporation) going into a steady, sad decline, as they seemed unable to figure […]