Plurrrr

week 27, 2020

The Crimson Campaign: Good

In the afternoon I finished The Crimson Campaign, book 2 in the Powder Mage trilogy by Brian McClellan. While I liked the previous book in the trilogy, Promise of Blood, more I consider this still a good book; not bad for the middle book in a trilogy.

If you like the Powder Mage trilogy, you might like:

The Autumn Republic

Field Marshal Tamas has finally returned to Adopest, only to find the capital in the hands of a foreign power. With his son Taniel presumed dead, Tamas must gather his beleaguered forces and formulate a plan to defeat the Kez - no easy task when you're outnumbered and can't tell friend from foe.

The army is divided . . .

With their enemy bearing down on them, the Adran command is in disarray. Someone, it seems, is selling secrets to the Kez. Inspector Adamat is determined to flush out the traitor, but as the conspiracy unravels, he will learn a horrifying truth.

And all hope rests with one man . . .

Taniel Two-Shot, the powder mage who shot a god in the eye, is on the run. He possesses the sole means of defeating the Kez, but to do so he must evade treachery at every turn. If he fails, Adro will fall.

In the afternoon I started in The Autumn Republic, the final book in the Powder Mage Trilogy by Brian McClellan.

Recently molted Aphonopelma seemanni eating

In the afternoon I gave 2 pre-killed mealworms, Tenebrio molitor, to the female Aphonopelma seemanni I keep. The large tarantula started to molt the 27th of June, 2020 and still has a very colorfull fresh look so I decided to take a few photos of her.

Aphonopelma seemanni eating a mealworm
Aphonopelma seemanni eating a mealworm.

I pre-kill mealworms by crushing their heads to prevent them from burrowing into the substrate. The tarantula doesn't seem to mind that she doesn't have to hunt for her food; it's just delivered at the doorstep of her burrow.

Beginner’s Guide To Abstraction

Abstraction is hard to define but the process typically goes like this:

  1. you identify different chunks of code that you think are all basically doing the same thing
  2. you create a method or a class with a narrow interface which can be substituted in for all the chunks of code you found
  3. you go and swap out the chunks of code with a call to your method/class

Source: Beginner’s Guide To Abstraction, an article by Jesse Duffield.

Remap Enter to Control in GNU/Linux

Recently I’ve switched back from macOS to GNU/Linux, as my primary development environment, and I found out that my old article on remapping Enter to Control was no longer the optimal way to achieve this. It took me a bit of digging, but eventually I found dual-function-keys (a plugin for the interception framework), which does exactly what I needed and it does it splendidly.

Source: Remap Enter to Control in GNU/Linux (2020 Edition), an article by Bozhidar Batsov.

SSH Emergency Access

In this post we'll design a break glass procedure for reaching SSH hosts in an emergency, using security keys that you can store offline. This is just one approach, but you can adapt it to your circumstances. We will store an offline SSH Certificate Authority on a hardware security key, and have our hosts trust that CA. This will work on pretty much any OpenSSH setup, including our single sign-on SSH.

Source: SSH Emergency Access, an article by Carl Tashian.

Piping made easy in Raku

A pipe is actually a very simple construct. We start two programs and connect STDOUT of the first with STDIN of the second. From the stand point of the programs they are writing to filehandles that where opened without a filename. Raku allows us to do so by using Proc::Async.

Source: Piping made easy, an article by Wenzel P.P. Peppmeyer.

The Internet has a Cat

The Purrli® user interface
The Purrli® user interface.

The sound of a purring cat is one of the most comforting sounds available and can help soothe and calm you down when you're feeling stressed. Naturally, it's not just the sound that is important, but it's also the presence of the warm cuddly cat. Purrli tries to recreate both the sound and the presence of your very own virtual cat through a custom sound engine modelled after real purrs.

With a purr that delicately changes over time, Purrli aims at making the experience as real and lively as possible. Just like a real cat, Purrli will call for your attention. Just be careful when adjusting the last slider, if you don't want to be nagged in the middle of your work.

Source: The Internet has a Cat! Meet Purrli, the Online Cat Purr Generator. by Dr. Ir. Stéphane Pigeon.

Correlation vs Covariance

Correlation and Covariance are two commonly used statistical concepts majorly used to measure the linear relation between two variables in data. When used to compare samples from different populations, covariance is used to identify how two variables vary together whereas correlation is used to determine how change in one variable is affecting the change in another variable. Even though there are certain similarities between these two mathematical terms, these two are different from each other.

Source: Correlation vs Covariance.

Uncommon CSS Properties

There are a lot of CSS properties that some don’t know about, or they know about them, but forget to use them when they’re needed. Some of those can save you using JavaScript to achieve a specific result, or some can save your time by writing less CSS. As a front-end developer, I came across such things every now and then, and I asked myself, why not list all those less-used and interesting CSS properties in an article?

Source: Uncommon CSS Properties, an article by Ahmad Shadeed.

Or-patterns and guards may just not compose well

PEP 622 proposes adding a pattern matching construct to Python. Pattern matching allows the programmer to destructure data with a syntax that mirrors the construction syntax. The proposal brings Python in-line with many other modern programming languages, like Haskell, OCaml, and Rust. However, two features included in the proposal (or-patterns and guards) interact in a perhaps surprising way—see this paper for an explanation of this interaction as it relates to OCaml, another language with both or-patterns and guards.

Source: Python pattern matching: Guards and or-patterns might not interact in the way you expect, an article by Nick Roberts.

Port knocking with OTP to secure SSH port

An interesting concept that I’ve come across is port knocking. Note that this is just an additional layer of security. Port knocking is sending packets to a pre-defined sequence of ports, so that recipient knows it is coming from a trusted client and open the port for you. It is the same concept of making a secret doorbell ring pattern with your close friends so that you know who is ringing the door!

Source: Port knocking with OTP to secure SSH port, an article by Armin Nikdel.

Git Tags: Everything You Need to know

A git tag is a marker for a specific point in time for your repository. Well, although I say a "specific point in time", they are really just a reference to a commit. These tags are stored as files inside of the refs folder within the .git folder that is a part of every git repository.

Source: Git Tags: Everything You Need to know, an article by Alan Solitar.

Introduction to CSS Transitions

Animations have become an essential part of web design, and developers now use these to beautify content on websites. Before the release of CSS3, front-end developers had to perform animations with JavaScript, which wasn't an all pleasing process. Still, with the introduction of CSS animations, developers can now perform animations with ease.

In this article, I'm going to introduce you to CSS Transitions, walk you through the process of creating simple CSS animations, explain the Transition shorthand properties, and it's value.

Source: Introduction to CSS Transitions, an article by Nelson Michael.

New in Chrome: CSS Overview

Here’s a fancy new experimental feature in Chrome! Now, we can get an overview of the CSS used on a site, from how many colors there are to the number of unused declarations… even down to the total number of defined media queries.

Source: New in Chrome: CSS Overview, an article by Robin Rendle.

Git Switch and Restore: an Improved User Experience

If you’re like me and you’ve worked with Git for some time, you might have a couple of commands committed to your memory—from git commit for recording your changes, to git log for sensing “where” you are.

I have found git checkout to be a command that I reach for pretty frequently, as it performs more than one operation. But a single command doing more than one thing might produce a suboptimal user experience for someone learning Git.

Source: Git Switch and Restore: an Improved User Experience, an article by Ray Chuan Tay.

Promise of Blood: very good

In the early evening I finished Promise of Blood, book 1 in the Powder Mage trilogy by Brian McClellan. I liked this book a lot; it's very good. In some ways it reminded me of the Mistborn Book Series by Brandon Sanderson, especially the later books. If you have read this series you might like Promise of Blood a lot, and vice versa.

The Crimson Campaign

Tamas' invasion of Kez ends in disaster when a Kez counteroffensive leaves him cut off behind enemy lines with only a fraction of his army, no supplies, and no hope of reinforcements. Drastically outnumbered and pursued by the enemy's best, he must lead his men on a reckless march through northern Kez to safety, and back over the mountains so that he can defend his country from an angry god, Kresimir.

In the evening I started in The Crimson Campaign, book 2 in the Powder Mage trilogy by Brian McClellan.

Using Bash traps in your scripts

It's easy to detect when a shell script starts, but it's not always easy to know when it stops. A script might end normally, just as its author intends it to end, but it could also fail due to an unexpected fatal error. Sometimes it's beneficial to preserve the remnants of whatever was in progress when a script failed, and other times it's inconvenient. Either way, detecting the end of a script and reacting to it in some pre-calculated manner is why the Bash trap directive exists.

Source: Using Bash traps in your scripts, an article by Seth Kenlon.

Python's reduce(): From Functional to Pythonic Style

Python’s reduce() is a function that implements a mathematical technique called folding or reduction. reduce() is useful when you need to apply a function to an iterable and reduce it to a single cumulative value. Python’s reduce() is popular among developers with a functional programming background, but Python has more to offer.

In this tutorial, you’ll cover how reduce() works and how to use it effectively. You’ll also cover some alternative Python tools that can be more Pythonic, readable, and efficient than reduce().

Source: Python's reduce(): From Functional to Pythonic Style, an article by Leodanis Pozo Ramos.

Machine Learning From Scratch

A quick start “from scratch” on 3 basic machine learning models — Linear regression, Logistic regression, K-means clustering, and Gradient Descent, the optimisation algorithm acting as a driving force behind them.

The purpose of this article is for coders to understand the inner workings of basic machine learning algorithms. To make the best use of the article, it is recommended to follow the code on your own development environment to understand the process.

Source: Machine Learning From Scratch: Classification, Regression, Clustering and Gradient Descent, an article by Jet New.