week 19, 2023

Python libs that I wish were part of the standard library

When you spend a lot of time with a language, you start noticing patterns in what you reach for. Things you always recode. Stuff you always install.

Eventually you start wishing that stuff would be part of the language itself.

For the libs presented in this article, this obviously can't happen. They are too big, they are moving too fast, they may be too specific.

So of course, they are not, and will never be part of the Python stdlib.

But since I like them so much, I suppose you may want to know about them as well.

Source: Python libs that I wish were part of the standard library.

The Super Mario Bros. Movie (2023)

The story of The Super Mario Bros. on their journey through the Mushroom Kingdom.

In the early afternoon we went to Delft. After quite some shopping we ended up at the movie theatre and decided to watch The Super Mario Bros. Movie, which started at 6PM. I liked the movie more than I expected and give it a 7 out of 10.

A Primer on Elliptic Curve Cryptography

ECC is the next generation of public key cryptography and, based on currently understood mathematics, provides a significantly more secure foundation than first generation public key cryptography systems like RSA. If you're worried about ensuring the highest level of security while maintaining performance, ECC makes sense to adopt. If you're interested in the details, read on.

Source: A (Relatively Easy To Understand) Primer on Elliptic Curve Cryptography, an article by Nick Sullivan.

How Go’s Simplicity Brings Complexity

Golang, aka Go, is a modern programming language known for its simplicity, ease of use, and ability to handle high-concurrency tasks. However, this simplicity can sometimes bring complexity to the code you write. As a software developer, I learned this while delving deeper into coding with Go.

Transitioning to a new programming language can be challenging, and Go is no exception. In this article, I’ll explore some of the challenges I faced when migrating to Go from another language.

Source: How Go’s Simplicity Brings Complexity, an article by Bisma Pervaiz.

pytz: The Fastest Footgun in the West

Whenever I give a talk about time zones, someone comes up to me afterwards and tells me that they have broken code currently in production, because they misunderstood how pytz works. This is because pytz uses its own non-standard interface for handling time zone information that is partially but not entirely compatible with the way Python's datetime library was intended to work, which leads to a lot of confusion from people naively using pytz as a time zone provider. This incompatibility is why, as of Python 3.6, the tzinfo documentation recommends rather than pytz as an IANA time zone provider. [1]

In this post, I will cover both time zone models and if I cannot convince you to switch to, at least provide some intuition about the differences between pytz and the standard time zone model.

Source: pytz: The Fastest Footgun in the West, an article by Paul Ganssle.

Programing Best Practices 2023

The list below isn't meant to be exclusive, it's more so a collection of links that have helped me out along the way (and can hopefully help you). As you'll see, I've focused on Web Development such as: Ruby, Rails, Javascript. There is also a wealth of information on interview prep and applying to jobs.

With the list bellow, I hope I can help developers improve their skills and rise up in their career path.

Source: Programing Best Practices 2023, an article by Derek Nguyen.

Understanding WASM

Today, we're going to talk about virtualization, instruction set architectures, and machines. This post isn't meant to get into all of the details, but should give you a good mental framework with which to place these concepts, and serve as a nice jumping-off point for further research.

Source: Understanding Wasm, Part 1: Virtualization, an article by Chris Dickinson.

SSH quick and easy login setup

When you often login into servers with SSH there’s time to be saved. This article will help you save time and lessen distractions on remembering user- and servernames. There’s three ways of making thing easy: Aliasing, SSH tweaking and TAB completion.

Source: SSH quick and easy login setup.

Restoration Techniques Using PostgreSQL Point-In-Time Recovery

This blog is aimed at beginners trying to learn the basics of PostgreSQL but already have some experience under their belt. For this tutorial, we will assume you have PostgreSQL correctly installed on Ubuntu. All of these steps were done using PostgreSQL 16 (development version) and Ubuntu 22.10. We’ll go over 3 different restoration methods, the “default” restore to “latest” method, restore by Log Sequence Number (LSN) and restore by timestamp.

Source: Various Restoration Techniques Using PostgreSQL Point-In-Time Recovery, an article by Tristen Raab.

Why your TCP-based VPN stutters

  1. Tunneling TCP connections over a TCP-based VPN leads to conflict between the reliability mechanisms of the two connections, resulting in decreased bandwidth and stutter-y performance. Always tunnel TCP over UDP when you can.
  2. In rare cases, overly restrictive firewalls may block UDP traffic, in which case you should obfuscate the tunnel’s UDP traffic as TCP to bypass restrictions.
  3. The adoption of UDP-based QUIC will make more internet traffic be on UDP, forcing firewalls to be less restrictive towards UDP traffic.

Source: Why your TCP-based VPN stutters (and how to fix it), an article by Carl Dong.

The Covenant (2023)

During the war in Afghanistan, a local interpreter risks his own life to carry an injured sergeant across miles of grueling terrain.

In the evening I watched The Covenant. I liked the movie a lot and give it an 8 out of 10.

Which Go router should I use?

When you start to build web applications with Go, one of the first questions you'll probably ask is "which router should I use?".

It's not an easy question to answer, either. There are probably more than 100 different routers available, all with different APIs, features, and behaviors. So for this blog post I've evaluated 30 popular ones, and created a shortlist of the best options along with a flowchart that you can use to help guide your choice.

Source: Which Go router should I use? (with flowchart), an article by Alex Edwards.

A ports test builder for aarch64 in Oracle Cloud

Since aarch64 moved to Tier-1 for FreeBSD, it’s a good idea to also test your ports on that architecture. But if you don’t own hardware for that, you will quickly run into limitations with the qemu-user-static plus native-xtools approach for cross-building. Some ports just won’t work with this.

One possible solution is to subscribe to the Oracle Cloud. They offer some resources as “always free”; you can use them to configure one aarch64 machine with specs good enough for occassional ports testing.

At the moment, you can pick one FreeBSD RELEASE image, which will give you a root partition with UFS. For ports testing with poudriere, you will need ZFS to do it efficiently, and you should run -CURRENT to also test that. This document describes the steps needed to get there.

Source: A ports test builder for aarch64 in Oracle Cloud, an article by Felix Palmen.

How to submit a patch by email, 2023 edition

In 2009, I wrote a blog post How to submit a patch by email, which became popular at the time and also ended up in the PostgreSQL wiki. That article was written pre-Git and pre-cfbot, so maybe it’s time for a refresher, as we head into the next PostgreSQL development cycle.

The short answer is: Use git format-patch. That takes care of almost all of the conventions and details.

Source: How to submit a patch by email, 2023 edition, an article by Peter Eisentraut.

Debunking the Dunning-Kruger effect

The Dunning and Kruger experiment did find a real effect – most people think they are better than average. But according to my team’s work, that is all Dunning and Kruger showed. The reality is that people have an innate ability to gauge their competence and knowledge. To claim otherwise suggests, incorrectly, that much of the population is hopelessly ignorant.

Source: Debunking the Dunning-Kruger effect – the least skilled people know how much they don't know, but everyone thinks they are better than average, an article by Eric C. Gaze.

Scoped CSS is Back

Several years ago, I made a plea to save scoped CSS. One of the top features on my CSS wishlist was on the chopping block, and despite a pretty big push from the community, it died.

Well, great news — it’s back. And it’s so much better than the previous version.

Even better, the W3C spec is mostly stable, and there’s a working prototype in Chrome now. We just need a little interest from the community to entice other browsers to build their implementations and kick this over the finish line.

Source: Scoped CSS is Back, an article by Keith J. Grant.