Skip to main content

Links from my inbox May 21 2022

· 6 min read

Good Reads

  • 2022-04-17 What Does "Shitty Job" Mean in The Low-Skill, Low-Pay World?

    There’s all sorts of terms and experiences I’m sure I could apply this to, but right now the one that interests me most is the phrase a shitty job. I recently transitioned from having lived my whole life doing the kind of jobs you could do with zero day’s training and no developed skills. I’ve heard the phrase (and some classier high-end equivalents) since then, but it’s used much differently; it’s describing a different set of worries as experienced by a different kind of person living a different sort of life. The Author - Resident Contrarian on Substack - writes about different kinds of people issues.

Good old reads

Because of that I usually make all my services and systems crash only. End up using things like use atomic file moves, open files with append-only, use kill -9 to stop services and so on. To make your system crash-onl,y you have to go down the base system calls.
Some observed effects so far (many are covered in the article):
* Faster restarts (if your regular operation involves restarting lots of processes).
* Less code (don't have to handle both the clean shutdown and dirty shutdown).
* Recovery/cleanup code if it is needed, is often ends up moved to startup instead of shutdown (you might have to recover corrupt files when you start up again. For example re-truncate the files to a known offset based on some index).
* Something else might need to manage external resources (OS IPC resources, shared memory, IPC message queues etc). This could be a supervisor process.
* If you do a lot of socket operations on localhost, your sockets could get stuck in TIME_WAIT state and you'll eventually run out of ephemeral ports if you do a lot of restarts (say during testing). SIGTERM signals often are caught and processes (libraries) perform a cleaner shutdown.
* Think very well about the database you use and see if it can can support crash only operation. Some do some don't ( I won't name any names here ).
  • 2022-05-21 Files are hard

    on exactly how hard it is to save data without corruption or data loss 🚀

How the things work

  • 2022-05-14 Time-series compression algorithms, explained

    Delta-delta encoding, Simple-8b, XOR-based compression, and more - These algorithms aren't magic, but combined they can save over 90% of storage costs and speed up queries. Here’s how they work.

Fun

C

  • 2022-05-14 A lock-free, concurrent, generic queue in 32 bits

    While considering concurrent queue design I came up with a generic, lock-free queue that fits in a 32-bit integer. The queue is “generic” in that a single implementation supports elements of any arbitrary type, despite an implementation in C.

🥑 Rust

🐚 Bash

trap 'echo "# $BASH_COMMAND";read' DEBUG
echo line1
echo line2
echo line3
echo "Hello World";

Interview

Projects

Resilience

PowerShell

PS C:\>
function prompt { 'PowerShell: ' + (Get-Location) + '> '}

PowerShell: C:\>
The function that defines the prompt includes a Get-Location command, which is run whenever the prompt appears in the console.

CSharp