Plurrrr

week 20, 2020

10 most common mistakes using kubernetes

We had the chance to see quite a bit of clusters in our years of experience with kubernetes (both managed and unmanaged - on GCP, AWS and Azure), and we see some mistakes being repeated. No shame in that, we’ve done most of these too!

I'll try to show the ones we see very often and talk a bit about how to fix them.

Source: 10 most common mistakes using kubernetes, an article by Marek Bartik.

You don't need an image to run a container

As we already know, containers are just isolated and restricted Linux processes. We also learned that it's fairly simple to create a container with a single executable file inside starting from scratch image (i.e. without putting a full Linux distribution in there). This time we will go even further and demonstrate that containers don't require images at all. And after that, we will try to justify the actual need for images and their place in the containerverse.

Source: You don't need an image to run a container, an article by Ivan Velichko.

socat

I learned about socat a few years ago and am generally surprised more developers don’t know about it. Perhaps I appreciate it all the more since I saw it being used for the first time to fix a production issue, and these sort of incidents leave a lasting impression on one’s mind.

socat has a bit of a learning curve compared to tools such as netcat. While I still often use netcat and friends (in no small part due to muscle memory), socat truly is the Swiss Army Knife of network debugging tools.

Source: socat, an article by Cindy Sridharan.

Parameterize Python Tests

Why parameterize tests?

  1. It follows DRY(Do not Repeat Yourself) principle.
  2. Changing and managing the tests are easier.
  3. In a lesser number of lines, you can test the code. At work, for a small sub-module, the unit tests took 660 LoC. After parameterization, tests cover only 440 LoC.

Source: Parameterize Python Tests, an article by Krace Kumar.

Using jq and curl to check the weather

Have you ever wondered what the weather was like, but not wondered enough to run some web app that takes 120 seconds to load a bunch of tracking javascript and ads, let alone actually go outside. In this post I'll show you what is in my opinion the best way to get your weather report. First though, we need some tools.

Source: Using jq and curl to check the weather, an article by Stone Tickle.

Backup and Restore on NetBSD

Putting together the bits and pieces of a backup and restore concept, while not being rocket science, always seems to be a little bit ungrateful. Most Admin Handbooks handle this topic only within few pages. After replacing my old Mac Mini's OS by NetBSD, I tried to implement an automated backup, allowing me to handle it similarly to the time machine backups I've been using before. Suggestions on how to improve are always welcome.

Source: Backup and Restore on NetBSD, an article by Jörg Kollmann.

Removing Duplicate Lines From a File

I came across a post on Cloudflare Blog where the author was describing his experience on tackling the issue of removing duplicate lines from a large file. The following text is a comment sharing my experience and alternative approach to the task that yields performance results similar to the author’s but without going down the route of coding in C. Funnily, this comment was rejected by Cloudflare Blog moderators. Thus, not to lose a couple of hour’s worth of work, I am putting it out here.

Source: Removing Duplicate Lines From a File, an article by Ivan Pesin.

KVM host in a few lines of code

KVM is a virtualization technology that comes with the Linux kernel. In other words, it allows you to run multiple virtual machines (VMs) on a single Linux VM host. VMs in this case are known as guests. If you ever used QEMU or VirtualBox on Linux - you know what KVM is capable of.

But how does it work under the hood?

Source: KVM host in a few lines of code, an article by Serge Zaitsev.

Securing Linux's master sysadmin command: Sudo

Sudo is one of the most powerful and dangerous tools in the Unix or Linux system administrator's toolbox. With it, an ordinary user can run commands just as if he or she were the superuser or any other user. Now, One Identity, the company behind the utility, has released a new version of sudo, called sudo 1.9, which gives it better auditing, logging, and security than ever before.

Source: Securing Linux's master sysadmin command: Sudo, an article by Steven J. Vaughan-Nichols.

Eurasian coot family

On the way back from shopping Esme and I stopped to look at the Eurasian coot family that lives close to our house. Each time we count the chicks and, luckily, each time the number is six.

Eurasian coot, Fulica atra, family
Eurasian coot, Fulica atra, family with 3 of the 6 chicks.

The coots are not afraid of humans and actually came quite close to us, probably expecting to be fed. So we guess someone is feeding them.

Pterinochilus murinus opened its burrow

In the evening I noticed that the Pterinochilus murinus sling I keep had opened its burrow; a cork tube halve that the small tarantula had closed off with webbing and substrate shortly after I got it.

I put a pre-killed mealworm, Tenebrio molitor, near the entrance of the burrow and soon after it was gone.

I suspect the tarantula has molted while in hiding.

What Writing DRY Code Really Means

Most developers early in their careers learn an important programming principle called Don’t Repeat Yourself (DRY). For most engineers this basically means avoid writing the same lines of code more than once, and realistically that’s the best place to start when learning how to write efficient code. While DRY is an important code-writing concept, it’s far from the whole story.

Source: What Writing DRY Code Really Means, an article by Shawn Deprey.

Spam Filtering Using Bag-of-Words

In this post, we’re going to employ one simple natural language processing (NLP) algorithm known as bag-of-words to classify messages as ham or spam. Using bag of words and feature engineering related to NLP, we’ll get hands-on experience on a small dataset for SMS classification.

Source: Spam Filtering Using Bag-of-Words, an article by Nikita Sharma.

Learning Haskell: Getting Setup

This is the first part of my series of articles on learning Haskell, I’ll be taking you through my journey learning the functional programming language.

Before we can start writing any Haskell we should first get it setup on our machine.

Source: Learning Haskell: Getting Setup, an article by Grant Leadbetter.

Two Ways to Categorize Errors

Errors are under-appreciated. I discovered that on a greenfield project when it occurred to me that I had essentially no tools in my developer utility belt for architecting them.

Sure, I write code for handling errors every day, and every programming language has built-in tools for handling errors. But the majority of error architecture that I’ve seen is not exactly graceful. Instead, it seems like programmers (myself included) opt to handle errors totally ad-hoc, as if they’re not an integral part of the larger piece of software.

Source: The Error Handbook, Part 1: Two Ways to Categorize Errors, an article by Aaron King.

CSS fix for 100vh in mobile WebKit

Not long ago there was some buzz around how WebKit handles 100vh in CSS, essentially ignoring the bottom edge of the browser viewport. Some have suggested avoid using 100vh, others have come up with different alternatives to work around the problem. In fact, this issue goes further back a few years when Nicolas Hoizey filed a bug with WebKit on the subject (the short of it: WebKit says this is “intentional” 🧐).

Source: CSS fix for 100vh in mobile WebKit, an article by Matt Smith.