Plurrrr

week 44, 2022

The essence of Reed-Solomon coding

Let’s say we want to store some data on multiple drives, so that we can recover from drive failures.

One obvious (and valid!) first attempt is to just store everything multiple times – usually called “mirroring”. The most common form of mirroring is to store things twice: if one drive fails, the data is still in the other.1

Reed-Solomon coding gives us much more flexibility, allowing us to store our data over n=k+t drives, so that any t drives can fail while still not losing data.2

Source: The essence of Reed-Solomon coding, an article by Francesco Mazzoli.

Getting Started with Google APIs in Python

Google has literally hundreds of APIs, including ones for Gmail, Drive, Maps, Translation, Analytics and more. All of these share the same concepts like authorization, pagination or media uploads/downloads. In this article we will explore all of these concepts and also get our hands dirty with some of the above-mentioned APIs to learn about all the cool things you can do with any and all of Google's APIs.

Source: Getting Started with Google APIs in Python, an article by Martin Heinz.

Hey Emacs, where did I take that photo?

I was recently browsing through an old archive of holiday photos (from dired of course). I wanted to know where the photo was taken, which got me interested in extracting Exif metadata.

Luckily the exiftool command line utility does the heavy lifting when it comes to extracting metadata. Since I want it quickly accessible from Emacs (in either dired or current buffer), a tiny elisp snippet would give me just that (via dwim-shell-command).

Source: Hey Emacs, where did I take that photo?, an article by Álvaro Ramírez.

NFS on NetBSD: server and client side

Since I only run Windows occasionally (mainly for MS-Office or MATLAB) and all of my machines either run NetBSD, Slackware or Tribblix, it makes sense for me to opt for NFS as a distributed file system protocol to share files from my server over the local network.

Source: NFS on NetBSD: server and client side, an article by Paolo Vincenzo Olivo.

Binary Packet Parsing

Today we're back with a new problem walkthrough, this time from Day 16 of last year's Advent of Code. In some sense, the parsing section for this problem is very easy - there's not much data to read from the file. In another sense, it's actually rather hard! This problem is about parsing a binary format, similar in some sense to how network packets work. It's a good exercise in handling a few different kinds of recursive cases.

Source: Binary Packet Parsing.

The Ice Road (2021)

After a remote diamond mine collapses in far northern Canada, a 'big-rig' ice road driver must lead an impossible rescue mission over a frozen lake to save the trapped miners.

In the evening we watched The Ice Road. I liked the movie and give it a 7 out of 10.

Postgres Insider Terminology

When I first started going to Postgres conferences and listening to talks by Postgres core developers I suddenly found myself at sea. What were these strange words and phrases they were using?

It turns out that a lot of them are taken from the Postgres code base, which in turn naturally uses them because they are part of Codd's relational model, the theoretical information architecture that underpins all relational databases.

Source: Postgres Insider Terminology, an article by Paul Ramsey.

Extraction (2020)

Tyler Rake, a fearless black market mercenary, embarks on the most deadly extraction of his career when he's enlisted to rescue the kidnapped son of an imprisoned international crime lord.

In the evening Alice, Esme, and I watched Extraction. For the first halve I liked the movie a lot but it soon became very repetetive. Still, I give it a 7 out of 10.

Hard user separation with NixOS

If you use the same computer in different contexts, let’s say for work and for your private life, you may wish to install two different operating systems to protect your private life data from mistakes or hacks from your work. For instance a cryptolocker you got from a compromised work email won’t lock out your family photos.

But then you have two different operating systems to manage, and you may consider that it’s not worth the effort and simply use the same operating system for your private life and for work, at the cost of the security you desired.

I offer you a third alternative, a single NixOS managing two securely separated contexts. You choose your context at boot time, and you can configure both context from either of them.

Source: Hard user separation with NixOS, an article by Solène Rapenne.

Good old-fashioned code optimization never goes out of style

Pushing calculation down to a faster implementation is just one way to speed up software. Another way to get faster results is to remove code that is redundant, repetitive, superfluous, needless, or otherwise does unnecessary work. The fastest software, after all, is software that doesn’t run at all.

In short, sometimes all you need is some good old-fashioned speed optimization.

Source: Good old-fashioned code optimization never goes out of style, an article by Itamar Turner-Trauring.

6 Underground (2019)

Six individuals from all around the globe, each the very best at what they do, have been chosen not only for their skill, but for a unique desire to delete their pasts to change the future.

In the evening I watched 6 Underground. I liked the movie, especially the parkour parts. I give it a 7 out of 10.

My Simple Kubernetes Setup for Side Projects

“You might not need Kubernetes; you’re not Google” – I hear that quite often. And while it is true that the full power of Kubernetes is not needed for smaller-scale web projects, it can come in quite handy.

In this article, I will showcase the benefits of using Kubernetes for smaller projects, and we will set up a Managed Cluster on the Digital Ocean platform.

Source: My Simple Kubernetes Setup for Side Projects, an article by Bas Steins.

Comparing TCP and QUIC

There is a common view out there that the QUIC transport protocol (RFC 9000) is just another refinement to the original TCP transport protocol [1] [2]. I find it hard to agree with this sentiment, and for me QUIC represents a significant shift in the set of transport capabilities available to applications in terms of communication privacy, session control integrity and flexibility. QUIC embodies a different communications model that makes intrinsically useful to many more forms of application behaviours. Oh, yes. It’s also faster than TCP! In my opinion It’s likely that over time QUIC will replace TCP in the public Internet. So, for me QUIC is a lot more than just a few tweaks to TCP. Here we will describe both TCP and QUIC and look at the changes that QUIC has bought to the transport table.

Source: Comparing TCP and QUIC, an article by Geoff Huston.

A Visual Guide to SSH Tunnels

SSH is yet another example of an ancient technology that is still in wide use today. It may very well be that learning a couple of SSH tricks is more profitable in the long run than mastering a dozen Cloud Native tools destined to become deprecated next quarter.

One of my favorite parts of this technology is SSH Tunnels. With nothing but standard tools and often using just a single command, you can achieve the following:

  • Access internal VPC endpoints through a public-facing EC2 instance.
  • Open a port from the localhost of a development VM in the host's browser.
  • Expose any local server from a home/private network to the outside world.

And more 😍

Source: A Visual Guide to SSH Tunnels (with labs), an article by Ivan Velichko.

Data validation in Haskell

Haskell is one of my favorite programming languages, and one of the reasons I like it so much is how nicely it supports modeling string-like data with newtypes when doing web programming. Much of web development involves dealing with strings (idk why exactly but I imagine mostly because JavaScript and the fact that most web communication protocols use strings as primitives), but not all strings are created equal! Strings can be emails, or addresses, or routing numbers, or can be a range of possible enums, and just using type String to capture all of the variance is a poor data model: it doesn’t have the granularity needed to distinguish between different use cases.

This is where using newtypes can help. Using newtypes (and their associated smart constructors) to model string-like data is a nice approach for adding granularity to strings to help differentiate string-like types from each other. Furthermore, the enhanced data modeling provided by newtypes can be extended (via aeson) all the way to JSON parsing, which makes it possible to write a JSON API client in Haskell that provides a type-safe parsing experience with ergonomic errors and a high degree of confidence with respect to data validation. It’s even easy to write tests! To explain more about what I mean, let’s dive into an example of some data modeling I’m doing for an upcoming project that takes advantage of newtypes smart constructors, and custom JSON parsing with aeson.

Source: Data validation in Haskell with newtypes, smart constructors, and aeson, an article by Dylan Martin.

Python 3.11 micro-benchmark

When I first heard the faster CPython initiative, I was intrigued to find out, how does it translate to small application performance across various versions since a lot of critical components are already in C like Postgresql driver. The faster CPython presentation clear states, the performance boost is only guaranteed for pure python code and not C-extensions.

In this post, I’ll share my benchmark results on a couple of hand picked snippets. There is a PyPI package data, do some transformation or do some network operations or file operations. How does that perform against different Python versions.

Source: Python 3.11 micro-benchmark.

Golang Aha! Moments: Generics

I work with Golang every day as a developer on the OpenZiti project. In learning Go, I've hit various stumbling blocks, settled on some best practices and hopefully gotten better at writing Go code. This series exists to share some of the 'Aha!' moments I've had overcoming obstacles and finding solutions that sparked joy.

Source: Golang Aha! Moments: Generics, an article by Paul Lorenz.

ExtensionKit

Extensions are executable code bundles, in one app that perform functions in a second, host app. Host apps declare extension points that control the kinds of functionality its extensions can implement. Extensions allow iOS and Mac apps to include code that runs inside system apps. For example, Messages provides extension points so apps can create iMessage Apps. Messages automatically finds extension bundles that target its extension points and makes them available in its app drawer. A Mac app can also declare its own extension points so that other apps can extend the Mac app’s functionality.

Source: ExtensionKit.