Notes from Docker Up & Running

Docker Up & Running

Recently I was taking a deep dive into the workings of Docker with the help of Docker: Up & Running. These notes list useful commands and info for later use, covering ways to handle, check, and tune containers and images.

Monitoring and Stats

docker stats <container-name>

This one shows a live feed of resource usage stats for running containers, like CPU percentage, memory use, and network I/O. It acts as a real-time performance checker in the terminal, highlighting resource demands or spikes—handy for keeping an eye on container health without extra tools. The output refreshes constantly to track trends, and pairing it with glances gives a broader view of system and Docker stats together.

read more →

Coding challenge – HTML web server in PHP

I wanted to learn a bit more about concurrency and network programming, so I built two TCP socket servers in PHP as a coding challenge. It’s a practical way to practice and get a grip on managing multiple connections at once. I’m not going for anything complex—just experimenting and picking up the basics step by step. The code can be found in my repository: github.com/lzag/webserver

I found it quite useful to go through the Beej’s guide to network programming to understand the inner workings of sockets programming and have a better idea of how the PHP wrappers work underneath. I added comments in the code linking to relevant sections of the guide. Another helpful resource is Mastering Swoole PHP, which explains concurrency concepts and includes some network programming examples.

read more →

Notes from Grokking Concurrency

Introduction

I wrote this summary of Grokking Concurrency to take notes and help me remember the main ideas about parallel programming. The book covers things like multitasking and synchronization with examples and explanations that I want to understand better. It’s a way for me to keep track of what I’m learning so I can use it later.

Sequential Programming: Pros and Cons

Sequential programming refers to executing tasks one after another in a single-threaded, linear fashion.

read more →

Setting up MySQL replication with Docker

Introduction

Setting up MySQL replication is a powerful way to enhance the reliability, scalability, and performance of your database system. In simple terms, MySQL replication is a process where data from one MySQL database server (known as the primary or master) is automatically copied to one or more additional servers (called replicas or slaves). This creates a live backup of your data, ensuring that if the primary server fails, a replica can step in with minimal downtime. Beyond redundancy, replication also allows you to distribute read-heavy workloads across multiple servers, improving efficiency and speed for applications that rely on quick data access.

read more →

Thoughts on software architecture and decision-making

Recently, I read the book Software Architecture and Decision-Making by Srinath Perera. It contains a lot of content that is available in other software architecture books but offers some unique angles on certain topics.

I think the author is right to point out that you need to design deeply things that are hard to change, especially database schemas. For businesses, data is gold, and making changes to it comes with enormous risks. Therefore, changes are very rare and done only when absolutely necessary. The same applies to customer-facing APIs (or even internal APIs). These are usually contracts that other parts of the system adhere to, so changes to them come at a big cost. Facebook was famous for following the adage “move fast and break things,” but after they annoyed developers with constantly breaking APIs, they changed their attitude to “Move fast with stable infrastructure.”

read more →

hello world

New site, new stack. Ditched WordPress for Hugo + Cloudflare Pages.

Posts are Markdown files, resume is built from LaTeX, everything is in git. No database, no PHP, no plugin updates at 2am.

read more →

Removing bloatware from Android phones

Most Android phones come with many preinstalled apps that you might not ever use, but they do take up valuable space and clutter the interface. If you try to uninstall them the way you would any other apps you will find that it’s not possible. So is there a way to get rid of them?

It’s actually not too complicted to uninstall them using the right tool which are available for every major operating system.

read more →

Overview of PHP code quality tools

General

Below tools provide a comprehensive set of rules and analyse the code from different angles.

PHPStan

PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line.

read more →

How does browser fingerprinting work?

What is browser fingerprinting?

Nowadays, most people are familiar with cookies - information stored in browsers that helps websites keep track of our settings and track our actions online. Many users know how to delete cookies or navigate in private mode hoping that this will grant them privacy and prevent companies from following their actions online.

However, there is a technique that allows to track the user online without the need for cookies called browser fingerprinting. One might think that just based on some general system settings it would be hard to tell computers from one another, but the blend of our systems’ settings makes them quite unique and it’s usually possible to tell them apart.

read more →

Difference between virtual machines and containers

Definition

Virtualization and containerization might seek to achieve the same goals but they are different concepts.

The virtual machine loads an OS on its own it can be any type of OS that you would like. The virtual machine has its own hard drive, network interfaces etc. that are then mapped to the physical hardware of your machine. So you can easily run a Windows or macOS machine on you Ubuntu if you’d like to. Virtualization however is different from emulation, so you’re still limited to the hardware that you have available.

read more →