week 34, 2022

The Investigator

By age twenty-four, Letty Davenport has seen more action and uncovered more secrets than many law enforcement professionals. Now a recent Stanford grad with a master’s in economics, she’s restless and bored in a desk job for U. S. Senator Colles. Letty’s ready to quit, but her skills have impressed Colles, and he offers her a carrot: feet-on-the-ground investigative work, in conjunction with the Department of Homeland Security.

Several oil companies in Texas have reported thefts of crude, Colles tells her. He isn’t so much concerned with the oil as he is with the money: who is selling the oil, and what are they doing with the profits? Rumor has it that a fairly ugly militia group—led by a woman known only as Lorelai—might be involved. Colles wants to know if the money is going to them, and if so, what they’re planning.

Letty is partnered with a DHS investigator, John Kaiser, and they head to Texas. When the case quicky turns deadly, they know they’re on the track of something bigger. Lorelai and her group have set in motion an explosive plan . . . and the clock is ticking down.

In the evening I started in The Investigator, book 1 in the Letty Davenport series by John Sandford.

SSH Agent Explained

The SSH agent is a central part of OpenSSH. In this post, I’ll explain what the agent is, how to use it, and how it works to keep your keys safe. I’ll also describe agent forwarding and how it works. I’ll help you reduce your risk when using agent forwarding, and I’ll share an alternative to agent forwarding that you can use when accessing your internal hosts through bastions.

Source: SSH Agent Explained, an article by Carl Tashian.

Interfaces and Metaclasses in Python

Have you ever heard of metaclasses in Python? I hadn’t until recently, and I had been using them for months without actually knowing how they work. Python’s metaclass functionality is one of those language features you’ll probably never need to know about, much less mess with, but it offers some keen insight into Python’s OOP model, and is actually quite powerful.

Source: Interfaces and Metaclasses in Python, an article by Joseph Bergeron.

File Management Tools for Your Favorite Shell

Going around your files and directories using the shell can feel slow and confusing, and not only when you’re a beginner. Personally, I was using GUIs (Graphical User Interfaces) to display, rename, move, and delete my files for a long time. It took me a couple of years to really get used to the shell to perform these operations. Today, I only use the shell to manage my files, and I think it is the better way.

Source: File Management Tools for Your Favorite Shell, an article by Matthieu Cneude.

Hotel Swooni (2011)

In a luxurious hotel, the lives of 6 people cross. A story about love, life and the search for happiness.

In the evening Esme and I watched Hotel Swooni. I didn't like the movie much and give it a 6 out of 10.

Please do not use Python for tooling

A lot of people are learning Python these days. Python is highly fashionable and people tell you that if you learn Python, you will have an easy time getting a job. This is probably true. Python presents low barriers for entry, a rich flora of decent libraries for everything from web programming to machine learning, and a lenient language that lets you be a bit vague in terms of types and whatnot. Or to be more precise: a language that allows you to be a bit sloppy.

Source: Please do not use Python for tooling, an article by Bjørn Borud.

How I use Emacs to write Perl

This post is about how I use Emacs to write Perl. I do not claim to have the best Perl setup of all time or anything like that. The features I need to write Perl effectively are syntax highlighting, auto-indentation, linting, and code navigation.

Source: How I use Emacs to write Perl, an article by Nicholas Hubbard.

The Lemon Parser Generator

Lemon is an LALR(1) parser generator for C. It does the same job as "bison" and "yacc". But Lemon is not a bison or yacc clone. Lemon uses a different grammar syntax which is designed to reduce the number of coding errors. Lemon also uses a parsing engine that is faster than yacc and bison and which is both reentrant and threadsafe. (Update: Since the previous sentence was written, bison has also been updated so that it too can generate a reentrant and threadsafe parser.) Lemon also implements features that can be used to eliminate resource leaks, making it suitable for use in long-running programs such as graphical user interfaces or embedded controllers.

Source: The Lemon Parser Generator.

A Critique of SQL, 40 Years Later

The SQL language made its first appearance in 1974, as part of IBM’s System R database. It is now over 50 years later, and SQL is the de facto language for operating the majority of industrial grade databases. Its usage has bifurcated into two domains – application programming and data analysis. The majority of my 12 year career (data engineer and data scientist) has been concerned with the latter, and SQL is by far the language that I have used the most. I love SQL for the productivity it has afforded me, but over time I’ve also become aware of its many flaws and idiosyncrasies.

Source: A Critique of SQL, 40 Years Later, an article by Carlin Eng.

How SQLite Scales Read Concurrency

If you scour Hacker News & Reddit for advice about databases, some common words of caution are that SQLite doesn't scale or that it is a single-user database and it's not appropriate for your web-scale application.

Like any folklore, it has some historical truth. But it's also so wildly out-of-date.

Source: How SQLite Scales Read Concurrency, an article by Ben Johnson.

How to Debug Better with Chrome

Has your JavaScript ever failed to execute correctly and you struggled to figure out why? Has your CSS ever behaved strangely and you struggled to figure out why or get it to display as intended? Debugging is a fundamental component of programming and an essential skill for all software developers.

Source: How to Debug Better with Chrome, an article by David Herbert.

Simulating memory load with fio

Recently at work I was tasked with simulating the workload of a client’s infrastructure consisting of several virtual machines. For our use case, this turned out to be a largely solved problem, thanks to existing tools like fio.

For those who don’t know it, fio is a simple yet powerful program that allows simulating various kinds of I/O workloads. Its simplicity stems from two basic facts: (1) it’s a standalone, CLI executable and (2) it uses plain INI files to define workloads. It’s also powerful because of its extensibility: thanks to I/O engines, it’s not limited to just I/O simulation.

Source: Simulating memory load with fio.

Manage multiple working trees

A git repository can support multiple working trees, allowing you to check out more than one branch at a time. With git worktree add a new working tree is associated with the repository, along with additional metadata that differentiates that working tree from others in the same repository. The working tree, along with this metadata, is called a "worktree".

Source: Git - git-worktree Documentation.

Is COUNT(*) slow in MySQL?

You have probably read in a bunch of different places that you shouldn't use SELECT(*) in MySQL when you don't need all the data. SELECT(*) selects all the columns in the table, not just the ones that you might need. This is generally good advice! Limiting the amount of data that the database needs to return can increase performance.

Does the same warning apply to COUNT(*)? Is that something that should be avoided too? Why would you use the full width of the table columns when you're really just looking for a count of the rows?

That's a common misconception about COUNT(*), it doesn't use the full width of the table! While SELECT(*) selects all the columns, COUNT(*) is specifically optimized to count all the rows. The star means different things in different contexts.

Source: Is COUNT(*) slow in MySQL?, an article by Aaron Francis.

GIT Branching Strategies in 2022

In modern software development, speed and agility are crucial when it comes to developing and releasing software. However, when you have a large team of developers working simultaneously, branching and merging code can become messy fast.

Therefore, teams need to have a process in place to implement multiple changes at once. This is where having an efficient branching strategy becomes a priority for these teams.

Source: GIT Branching Strategies in 2022, an article by Manuel Herrera López.