2026

Preventing Segfaults in Shared Memory IPC: Using Semaphores to Signal Data Readiness

mmap() succeeding doesn't mean the data behind it is valid. A close look at the race where a reader touches shared memory before the writer is done, and how a semaphore closes it.

Safe Length-Based Data Sharing in C

Don't ask where the '\0' is. Ask how many bytes are valid. A progressive look at why strcpy() fails on shared data, and how length-delimited buffers fix it.

2024

Saving the state of an interactive container

Sometimes we need to start a Docker container in an interactive shell for testing, but an interrupt destroys everything. Here is how to save its state.

Install OpenCV 4.5 on Ubuntu 22.04

OpenCV installation can be tricky on Linux. A correct process for building OpenCV 4.5 from source, for both Python and C++.

Real-time Disk Size Expanding in a Linux virtual machine

I was compiling the Linux kernel in a VM with a full 20GB logical volume. Here is how to expand the disk without losing your data, step by step.

2023

CAFE BABE, if you know, you know. JVM enthusiast.

Each program has a magic word in its machine code that defines its identity. For Java class files, it's CAFE BABE, and the story behind it is great.

How your program's functions are handled in memory?

Because I always forget how the kernel handles a program's functions in the call stack, I wrote it down. Function prologue, %rbp, %rsp, and calling conventions.

What the heck is locality of reference, and why will I waste brain cells bytes to know it?

Locality of Reference is a critical Computer Science topic that helps improve your software's performance, if you're aware of it.

How the heck a C program is compiled from human comprehensible language to 0's and 1's

You may have wondered how programming language lexemes are turned into a series of 0's and 1's, aka binary files. Let's discover that together, step by step.

Why the heck the _state variable in task_struct structure is 4 bytes

The Linux process state needs six flags, so why is it stored in an unsigned integer with 2^32 possible values? The answer is in READ_ONCE/WRITE_ONCE.

Why the heck gateways are invented in computer networks?

I've always wondered why the default gateway is needed in computer networks. I finally realized, so I wanted to share that with you guys :)