Practical Engineering
open-menu closeme
Engineering
github linkedin rss
  • GPG is still in use to verify downloads

    calendar Feb 23, 2025 · 2 min read · Linux Cryptography  ·
    Share on: twitter copy

    This week, I needed to install the Amazon SSM Agent and was surprised to find that GPG (GNU Privacy Guard) was the only way to verify the download. I had assumed that software downloads verification had largely transitioned to PKI (Public Key Infrastructure). This short post is a refresh on GPG. OpenPGP is an open …


    Read More
  • Debug systemd race condition with reboot loop

    calendar Jan 20, 2025 · 1 min read · Linux Bottlerocket  ·
    Share on: twitter copy

    Hello! https://github.com/bcressey/bottlerocket/commits/debug-unified-fips/ https://github.com/bcressey/bottlerocket/commit/a2f3ef75b080d3cce1b077e9bc313bc0126c70c4


    Read More
  • Why does GOMEMLIMIT take up significant physical memory for unused virtual memory?

    calendar Jan 19, 2025 · 4 min read · Go Linux  ·
    Share on: twitter copy

    While debugging memory bloat in a Go application recently, I found that removing the GOMEMLIMIT soft memory limit and disabling transparent huge pages partially mitigated the issue. However, I couldn't fully explain why these changes worked. So I thought why not ask the internet about it. A simplified memory bloat …


    Read More
  • Don't Use stderr to Determine Process Failure Because Logs Default to stderr

    calendar Nov 30, 2024 · 6 min read · Go Guide  ·
    Share on: twitter copy

    It's a beautiful day, and it started with a simple code review: 1# tools/foo/main.go 2- fmt.Println("found it") 3+ log.Println("found it") The author explained the advantages of using a logging library over plain printf. The rationale was straightforward, so I approved the change without hesitation. …


    Read More
  • AL2023 vs. AL2: less disk space with ext4?

    calendar Nov 17, 2024 · 7 min read · Linux  ·
    Share on: twitter copy

    We started migrating from Amazon Linux 2 (AL2) to Amazon Linux 2023 (AL2023) a month ago. While testing workloads on AL2023 in the pre-production environment, I noticed slightly higher disk usage compared to the same workload on AL2. In this post, I'll share my investigation. AL2023 Has Less Free Disk Space with ext4, …


    Read More
  • Ways Go programs die

    calendar Nov 10, 2024 · 4 min read · Go  ·
    Share on: twitter copy

    Our Go programs recently triggered an alarm due to excessive panics. Panic is a Go runtime mechanism that halts execution. It got me thinking about different ways a Go program can die. I don't expect many - not like A Million Ways to Die in the West. In this post, we'll go through the various ways Go programs die. …


    Read More
  • Missing Container Disk I/O Stats with cgroup v1 on Kernel 6.1

    calendar Nov 9, 2024 · 4 min read · Linux Container  ·
    Share on: twitter copy

    As Amazon Linux 2 (AL2) approaches its End of Life on June 30, 2025, we have started migrating our container platform from AL2 to Bottlerocket. The migration encountered a few speed bumps. In this post, we'll examine one of them: missing container disk I/O stats. Why are container I/O dashboards blank? Since …


    Read More
  • Mind ordering cycles in systemd: how systemd breaks them can brick server startup

    calendar Oct 16, 2024 · 3 min read · Linux  ·
    Share on: twitter copy

    I've been building a service for a month, and the day finally arrived when I had the artifact - an EC2 AMI. The AMI passed my "rigorous" manual tests so I launched 100 EC2 instances. Surprise! Around 28 instances failed to launch. What's going on? All failed instances were stuck in the …


    Read More
  • Monotonicity: Find 1-3-2 Pattern

    calendar Oct 14, 2024 · 3 min read · Algorithms Interview  ·
    Share on: twitter copy

    Given an array of numbers A, find out whether it contains a 1-3-2 pattern. A 1-3-2 pattern is a subsequence of three numbers, A[i], A[j] and A[k] such that i < j < k and A[i] < A[k] < A[j]. For clarity, let's call the 1-3-2 pattern the Bronze-Gold-Silver pattern. If A[j] is Gold, then we should consider the …


    Read More
  • Hoare Partition, one of the simplest and most beautiful algorithms

    calendar Jun 17, 2024 · 4 min read · Algorithms  ·
    Share on: twitter copy

    Tony Hoare invented QuickSort in 1961. At the time of its publication, the best comparison-based sorting algorithm was merge sort. Merge sort divides an unordered array into two equally sized subarrays, sorts each subarray, and then merge the two subarrays to produce a sorted array. Merge sort is simple to understand. …


    Read More
    • ««
    • «
    • 1
    • 2
    • 3
    • 4
    • 5
    • »
    • »»

Peng Zhang

Software Engineer

Recent Posts

  • cached-imds-client: cache static IMDS responses to improve robustness
  • Using WaitGroup to Track Work Items, Not Workers: A Multi-threaded BFS Example
  • Simplify device path on boot with udev
  • Use KillMode=process with caution: restart loop could deplete resources
  • Spawning a New Process for Socket-Activated Daemons is Error-Prone
  • Be careful making thread-aware syscalls in Go: lock the thread
  • Speed up building Bottlerocket image in AWS CodeBuild
  • Mysterious Image Pull Failures: "401 Unauthorized" and "Not Found" After Migrating Containerd to v2

Tags

GO 19 LINUX 19 ALGORITHMS 8 BOTTLEROCKET 7 INTERVIEW 7 CONTAINER 5 CONCURRENCY 3 GUIDE 3 AWS 2 DISTRIBUTED-SYSTEM 2 SELINUX 2 SYSTEMD 2 WEB 2 CRYPTOGRAPHY 1
All Tags
ALGORITHMS8 AWS2 BOTTLEROCKET7 CONCURRENCY3 CONTAINER5 CRYPTOGRAPHY1 DATABASES1 DISTRIBUTED-SYSTEM2 DOCKER1 EC21 GO19 GUIDE3 INTERVIEW7 LINUX19 SELINUX2 SHELL1 SYSTEMD2 TESTING1 WEB2
[A~Z][0~9]
Peng Zhang

Copyright 2022-  PENG ZHANG. All Rights Reserved

to-top