RSS Amplifier

Blog

Cheng Hui's Website

Cheng Hui's Website

lchenghui.comRSS feed ↗16 posts

Latest posts

How to reap zombie processes in Docker containers

tldr: Use tini to handle zombie processes in Docker containers. I have a containerized Python FastAPI service that spawns child Chrome processes to fetch web content. I deployed it on my VPS and used it for quite some time. One day, when I logged into my machine, I saw the following: Welcome to Ubuntu 22.04.5 LTS * Documentation: https://help.ubuntu.com * Management:…

Docker layer caching in Woodpecker CI

tldr: SOURCE_DATE_EPOCH value changes will invalidate WORKDIR ’s cache. The problem Recently, I switched my CI to Woodpecker, amid Cirrus CI’s shutdown. I’m both happy and sad, happy for the team at Cirrus Lab for joining one of the prestigious AI companies, and sad because the market lost such an amazing product. Back to the topic, I was setting up the workflow file for building…

Thanks PayPal, but no thanks

I have been using PayPal for a long time, mostly to pay for digital services in USD or EUR. PayPal has this “friendly” feature, where it will convert the foreign currency to your card’s currency using their conversion rate. Their rate isn’t the best but I mostly let it slide because of the convenience, and the amount I’m dealing with is usually quite small. Today I…

forrus - A bridge for Forgejo & Cirrus CI

Background I have a personal git service powered by Forgejo and I’m actively looking for a CI solution to integrate with it. Unlike a managed service like GitHub where everything is provided, running my own instance means I have to sort things out on my own. Forgejo offers a (mostly) drop in replacement for GitHub Actions called Forgejo Actions , which is quite nice after some light testing…

Spring Batch microservice optimization

Disclaimer : The views and opinions expressed in this blog are solely my own and do not necessarily reflect those of my employer or any team I am or have been a part of. This blog reflects my personal understanding and interpretation of the subject matter. A few months ago at work, I was optimizing the throughput and memory usage of our Spring Batch microservice, which was experiencing performance…

How I trained my own GPT-2 and fine-tuned it into an instruct model

This is the second blog post about LLM. All along, I had been fine-tuning models but never really trained a model from scratch. I then got recommended the video from Andrej Karpathy about LLM Deep Dive, where he introduced a few major steps to build a large language model. So this blog post is about how I trained my GPT-2-like model from scratch and fine-tuned it into an instruct-following model.…

I fine-tuned a LLM into news summarization reasoning model

I have always wanted to write about this, but I’ve recently been busy with work and life events. Over the past few months, I’ve been playing around with LLM fine-tuning using different tools like Unsloth and Axolotl for achieving different purposes, mainly for learning and fun. The most recent one is a reasoning model focusing on bullet points news summarization. I decided to write a…

The hidden cost of running a private docker registry backed by S3

Context S3 is fast and cheap. Apparently, I was wrong and this is what this blog post is about. After using S3 bucket as a Docker cache for my BuildKit instance, I wondered what else could be achieved. I then discovered about Adolfo’s blog post and learned that a docker image is just a bunch of tarballs stored in some predefined locations. When we perform a docker pull , we send GET requests…

My journey on building a remote Docker buildkit

Context Recently, I’ve been playing around with some hobby projects and need to build Docker images locally. I’m using an Apple Silicon machine, which is ARM64, and my VPS is x86, so I always build the image with multi-platform support. I knew that the x86 image built using my laptop would use the QEMU emulator with some minor performance drawbacks. I thought it would be acceptable…

Make this site high availability and optimise latency

This site had been hosted in a VPS in Germany ever since I decided to self-host it, because that was the only machine I had at that time. While it was working as intended, the time to first byte (TTFB) for Southeast Asian users wasn’t that great. I’m using Cloudflare as CDN for the website; although it does help in the client-side latency (because the client is connected to PoP instead…

From Jekyll to minimalist blog

2019 - WordPress + cPanel When this site was launched back in 2019, I was using the managed version of Wordpress as my CMS along with cPanel. It was great and suited me well as a beginner, but not for too long. Having abundant features sounds excellent, but sometimes, it is just unnecessary and daunting. Stuff like a mail server, plugins and themes will increase the complexity of the website and…

Services that I use

The Internet is moving fast and we often forget about the individuals/organizations contributing excellently to open-source projects. I am a big fan of open-source projects and have been using them. Below is a list showing some of the ones that I recommend the most: Miniflux (Minimalist feed reader) bitwarden (Password manager) Teddit (Alternative front-end for Reddit) Kavita (Online book reader)…

Why nobrl for mount.cifs

What happened? In the progress of setting up Picoshare (image/video hosting website) for this blog, I was stumped with the following error that caused the container to crash every single time it was launched. picoshare_1 | 2023/03/11 09:47:27 sqlite.go:48: failed to set pragmas: database is locked I’m mounting an online storage using cifs to my server, and other containerized applications…

Use Nginx Reverse Proxy to forward request to your Docker app

Introduction Very often, we have a lot of Dockerized applications running on different ports on our server. While some of the applications may offer automatic domain name binding and SSL generation, but most of them are not. In this post, we are going to use Nginx Reverse Proxy function to forward request to our Docker application, and use Let’s Encrypt to generate a SSL certificate for our…

My journey on the Programming League National (PLN) 2020

This post captures the moment I participated in my first competitive programming competition earlier this year. My two teammates and I got second place in our university’s Programming League National 2020 (Closed Category). We tried our best to tackle the remaining questions and were left with two unsolved. p/s: We were the team with the most first-solve in our category.

How to setup a cloud server for Deep Learning and Cloud Gaming

In this tutorial, I will explain how to set up a fully working Windows cloud server in Google Cloud Platform. You can use this cloud server for artificial intelligence model training purposes or play your AAA games with it since it has a very powerful GPU and a huge amount of RAM. Before we start, what you need Credit / debit card Gmail Account Government Issued ID (e.g. IC, driving license..) I…