Validation checks a value and often throws away what it learned.
Parsing returns a type that keeps those guarantees.
I wrote about what "Parse, Don't Validate" looks like in Rust: newtypes, parsing at the boundary, the shotgun parsing antipattern, a serde constructor trap, and why it matters even more with coding agents.
rdiachenko.com/posts/rust/pa…
2
186
Discovered VHS, which records terminal sessions from a script. Instead of screen recording and trimming, you write a .tape file that describes what to type, and VHS renders it into a GIF, MP4, or WebM with consistent timing and clean output.
rdiachenko.com/til/terminal/…
150
After upgrading from Postgres 16 to 18, every time I recreated my Docker container, the database started fresh. No errors, no warnings. Just `initdb` running on every startup, as if the named volume didn’t exist. The same setup worked fine with Postgres 16.
rdiachenko.com/posts/databas…
84
Claude Code supports a customizable status line at the bottom of the terminal. It's empty by default, but you can point it to a shell script.
rdiachenko.com/til/claude-co…
1
98
Claude Code adds a Co-Authored-By trailer to every commit and attribution text to PR descriptions by default. If you want clean commits without the co-author line, add this to your ~/.claude/settings.json:
84
If your Mac is randomly low on disk space and you use Claude Code, check /private/tmp/claude-*. Mine had a 324 GB surprise.
rdiachenko.com/posts/trouble…
76
24 books in 2025. 12 worth talking about. From logic and Rust to Dostoevsky and nutrition.
rdiachenko.com/posts/books/y…
96
50 days ago I tried to understand LLMs by reading papers and blog posts. I could follow the code, but the math made no sense. So I went back to the basics: logic and linear algebra. Now, 50 days later, I finally feel like I've started in the right place.
I wrote about the journey so far:
rdiachenko.com/posts/math/50…
2
127
Nice read on web typography webkit.org/blog/16547/better…. Especially relevant if you have a blog or write online.
I had never really thought about these typography issues, but fixing them can noticeably improve readability:
1. Short last lines. Sometimes the last line of a paragraph ends up with just one word. This creates extra space between paragraphs, making it look inconsistent with the rest of the spacing.
2. Too many hyphens in a row. When several lines in a paragraph end with a hyphen, it adds some cognitive load. The paragraph becomes harder to read smoothly.
3. Bad rag. When the ends of lines vary too much in length, they create a zig-zag pattern or a ragged edge. It makes the text less visually balanced and harder to follow.
4. Typographic rivers. Uneven spacing between words can accidentally form vertical paths of whitespace across a paragraph. These “rivers” pull your eyes in the wrong direction and break reading flow.
193
A story of how I brought my Synology NAS back to life after a strange network issue.
rdiachenko.com/posts/trouble…
3
210
External key vault uses one NAS as a "remote key server" and another as a "client" NAS with the encrypted volume.
They communicate using the Key Management Interoperability Protocol (KMIP), a standardized way for different systems to securely exchange encryption keys and manage them centrally.
The external vault enhances security as physical access to the client NAS alone isn't enough to access your data. However, it requires a second NAS, more setup, and a network connection between the NASes that, I think, is overkill for a mini home cloud.
1
88
Ok, there are two options for storing volume encryption keys in Synology NAS: local and external key vaults.
Local key vault uses two access keys: machine key and vault password.
The machine key is unique to each NAS and automatically loads at startup to retrieve the volume encryption key that gives you access to data.
The vault password, set during volume creation, is needed if you move your disks to a different NAS. This password allows access to the encrypted data on a new NAS with a different machine key.
While the local vault protects against disk theft, if someone gains access to both your NAS and disks, your data could be compromised.
1
2
119
Multiple keys to decrypt the primary key.
Synology's full volume encryption relies on two core technologies: the Linux Unified Key Setup (LUKS) and device mapper crypt (dm-crypt). LUKS defines the framework for volume encryption, while the dm-crypt module handles the encryption and decryption processes.
LUKS encrypts entire block devices or partitions using symmetric encryption algorithms such as AES. Synology uses the AES algorithm in xts-plain64 mode for full volume encryption.
The key management in LUKS uses a multi-layered approach. A primary key encrypts the block device, and this primary key itself is encrypted with one or more user keys. LUKS supports multiple key slots, allowing several user keys to unlock the same device.
In Synology's system, the primary key is referred to as the data encryption key, which is stored in an encrypted format on the drives comprising the volume. Upon enabling volume encryption, you receive two user keys: a recovery key and a volume encryption key.
Data written to the device is encrypted using the data encryption key. To access the data, Synology automatically provides the volume encryption key at system startup, or a user can input their recovery key. Either key is used to decrypt the data encryption key, which then decrypts the actual data on the device.
1
137
Expanding Storage with RAID 5 and SHR
With RAID 5, you can't expand your storage until you've upgraded all your drives to a larger size. For example, if you replace one of four 1 TB drives with a 2 TB drive, RAID 5 will still only use 1 TB of that new drive. You have to replace all the drives with 2 TB ones before it uses the full capacity.
SHR (Synology Hybrid RAID), on the other hand, lets you expand your storage as soon as you replace at least two drives. After you swap out the first drive, it acts just like RAID 5. But once you replace a second drive, it starts using the full capacity of the new drives.
1
103
There is a "gotcha" when using RAID with drives of different sizes. For instance, combining 2 TB, 4 TB, and two 8 TB drives in a RAID configuration leads to 12.7 TB of wasted space. This waste occurs because RAID bases its storage creation on the smallest drive in the storage pool.
Alternatively, Synology offers a system called SHR (Synology Hybrid RAID), which is like "RAID on steroids." It divides each drive into smaller chunks for storage, so in the example above, you would end up with 0 TB of wasted space. Pretty cool!
I suspect there is a tradeoff here. Most likely, SHR operates a bit slower, but I need to check this further.
2
105
I finally read Understanding Software Dynamics by R. L. Sites—a super specialized book.
The first part, focusing on tail latency and resource measurement, was the most insightful. It deals with issues that many engineers face daily, making it highly relevant.
However, the remainder of the book focuses extensively on the observation tool, KUtrace. The author details how to design such a tool and use it to identify performance issues. This knowledge is so specialized that I struggle to see its practical application for those not working as performance engineers.
So, should you read it?
Part 1: Measurement—yes, for sure! It contains a tone of value. But skim the rest unless you plan to use KUtrace or develop a similar tool.
3
135
Implementation of k-means clustering for image compression in Rust. It's a fun, visual way to see this machine learning algorithm in action.
rdiachenko.com/posts/ml/k-me…
I'm curious if I can make it into the @ThisWeekInRust newsletter 🙂
5 Essential Steps in K-Means Clustering
Step 1: Initialization
Centroids are initialized using a chosen strategy. Common strategies include Forgy, MacQueen, Maximin, Bradley-Fayyad, and K-means++.
Step 2: Main Loop
The algorithm iterates until it converges or reaches the maximum number of iterations.
Step 3: Cluster Assignment
Each data point is assigned to its nearest centroid.
Step 4: Centroid Update
New centroids are calculated as the mean of the points assigned to each cluster.
Step 5: Convergence Check
The algorithm checks if the change in SSE (Sum of Squared Errors) is below a specified threshold.
3
139


















