This is the third article about NeoVim tips, if you are interested in other part of this, please check here and here

Motivation: The need for a clean and organized environment file.

Quite often in a project, a developer will have to deal with a lot of environment variables and/or environment files. However, they could also be the part that's least maintained in the entire codebase. As an example, sometimes, a feature flag could be added to the environment file, but when the feature goes live, people would fail to remove them. As time gets by, there will be A LOT of this kind of variables in the environment file.

As it is the end of the year, and I really couldn't finish much dev work with the amount of time left for the new year, I opt to deal with this issue with the intention to create a clean and organized environment file.

Overview: What's in an environment file

Before I get into the problem I'm trying to solve, it is important to understand the problem we are trying to solve. For the project I'm working on, we have two kinds of environment files, one of which is only used locally, the other one is used by the Kubernetes platform and is used at runtime. Here's an example of what they look like:

Read more »

This article is a continuation of my previous article on Traefik, which you can find here. Previously, I went through some examples of how I used Traefik so this article would assume you have the basic knowledge of Traefik, if you are not comfortable with it, feel free to go back to my article or read the official documentation from traefik.

Motivation

I've been hosting some apps in my local home network using Raspberry Pi for a while now, and I've also hosted some apps on Google Cloud.

Whenever I want to access things on Raspberry Pi while not at home, I would have to use Nebula which is a tool for overlay network. I would have to connect to the VPN, and then access the applications.

This proves to be inconvenient, and not easy to use. One day, I started to play around with the idea of putting things together with Traefik, and it worked so well and drives me to write this article.

Why hosting things separately?

Some may wonder, why I would host things in both Raspberry Pi and GCP. Well, the main reason for this is cost efficiency and data privacy/security.

You can use whatever CPU and storage you want within your local network without incurring monthly costs, and you would have the added benefits of having data on premise.

Read more »

Motivation: The Need to Remember to Disconnect Bluetooth

I usually wear my Bluetooth headset at work, this is necessary because I need to talk to people or attend meetings online. One of the things that annoys me is I have to remember to turn off my headset every time I leave my workplace, otherwise because the Bluetooth is not disconnected automatically when the Mac goes to sleep, I will find a headphone with very low battery the next day. If the Bluetooth is disconnected, the headphone will turn itself off in 5 mins, so it all comes down to remembering to disconnect Bluetooth on the laptop, or to turn off the battery on the headphone. This annoys me so much that I eventually decided to spend time to solve this problem.

Read more »

I'm a big fan of Arch Linux for its simplicity, and ease to use. However, sometimes it can be the source of headache. This week, I upgraded the Arch Linux on my Raspberry Pi 3 with latest packages with the following command yay -Syu --noconfirm (WARNING: you shouldn't be doing this). When I finished upgrade, my Raspberry Pi 3 stopped working. And I had to spend quite a lot of time getting things back to normal.

Initial Investigation and Thoughts

Since I don't have any clue on what happened at all. I first tried whether SSH still works... And I got can't find zsh. That is indeed a bad sign, I can't do anything 😞. Next thing I did was reboot. And things got even worse -- I can't even SSH now, refused to connect at port 22 😢.

At this point, I had no choice but to connect the Pi to an external monitor. It didn't help. While I could see the bootloader start screen, the kernel seems broken, so machine did not start.

Read more »

Recently, I've encountered an interesting issue with a project using TypeScript. In this article, I will describe the problem, the investigation I did and how I locate the root cause, and suggest some solutions.

What happened

We have a project that's a "pure" TypeScript project -- the codebase contains no JavaScript file, except for some configuration. As part of the build process, TypeScript is transpiled into JavaScript with tsc. Within the container, the project call node and runs the transpiled index.js, something like node dist/src/index.js.

When a PR was merged and deployed into one of the test environments, the container would not start and went into a crash loop state. This obviously is not a good sign. The initial step was checking the logs emitted from within the container. This revealed the cause of the crash was an imported module (imported with non-relative path) can not be found in one of the JavaScript file.

Read more »

I've been running Traefik to self-host some of the applications I like for a few month now, I'm really happy with its performance as well as convenience and therefore would like to share my setup and experience in this article. I will give a brief introduction of what Traefik is for, how I used it, and general suggestions on using Traefik.

What is Traefik?

By definition, Traefik is a reverse proxy and load balancer ^1. It is a member of the CNCF (Cloud Native Computing Foundation) foundation, the community version of this application is written in Go, open-sourced under MIT license, and hosted on GitHub. ^2

Read more »

Recently, I've encounter several situations where I have to deal with self-signed certificate. As this is such a common issue, I've decided to write this article to document my learnings and for my own reference in the future.

This article will start by explaining what is a SSL certificate, and what is a self-signed certificate. From there, I will detail the problems I encountered recently on self-signed certificate, and how I solved them.

Read more »

This article is a continuation for my previous article on setting up Linux on this specific laptop, which I've been using daily for a little over a month. My distro is Arch Linux, so this article mainly focuses on Arch Linux-related information as well as solutions.

The major problems that bother me are listed below, and fortunately, I've found solutions to all of them, which is also why I'm writing this article to share my solutions.

  • Internal microphone not working out of the box
  • Wake from sleep takes more than 10 seconds
  • External monitor cause system lag
  • CPU frequency not optimized to use the highest possible boost frequency (4.8 GHZ)
Read more »

Recently, I bought a new laptop, it is a Lenovo Thinkpad Neo14. This is an exclusive model for the Chinese market. I was quite happy with the build quality and the look of it, only thing I dislike is it came pre-installed with Windows 11 which bundled many different kind of useless software.

To me, on the second day of getting the laptop, I start installing Linux on it. More specifically, I installed Arch Linux.

Read more »

As software developers, we all strive to write bug-free and reliable code. However, sometimes unexpected issues arise, and we need to react quickly to mitigate their impact. In this article, we will discuss several real-world incidents that occurred in a production environment. We will examine the root cause of the incident and discuss the lessons learned from this experience.

Prior events

On March 2nd, release, migration to the latest container platform, accompanied with a huge release for the squad I'm in.
On March 9th, the first release after the platform migration was deployed to production.

Read more »
0%