• Turning my apartment into a smart home, part 1: Fundamentals and lights

    For the longest time, I’ve resisted the urge to make my home smart, because I’ve always heard how difficult it was and how it made no sense unless you owned your home. The examples I’d seen were not at all that impressive either. I’ve visited supposed “smart” homes that involved shouting “Okay Google, turn on the lights” when entering, and having my lights be dependent on someone else’s servers being up,1 as well as having a device listening to every word I say, simply didn’t appeal to me.

    Finally, in 2026, I decided that I was sick of manually controlling my lights. Why should I have to use my phone as a flashlight after turning off the bedroom lights every night? Why should I have to turn on the lights when I am working in the middle of the day and a storm comes? Surely, there must be a better way…

    Thus, I did some research and quickly learned that most of the supposed difficulties were overblown. With less than a $200 investment and a day’s work, I was able to control all my lights at will, with lights automagically turning on depending on my presence, the availability of sunlight, and whether I’ve decided to sleep. Instead of having to ask Google or find the light switch, I can simply walk into a room, and if it’s dark, the lights just turn on.

    And naturally, it’s more than just lights that could be automated. With a bit more investment, I’ve managed to automate fans, air purifiers, and perhaps created the world’s first offline smart bed. But let’s not get ahead of ourselves and instead start with the lights.

    (Read more...)
  • Fixing a bricked AMD 7040 series Framework 13" laptop with $20 tools

    In 2023, I was in need of a new laptop that should hopefully last me for a while. While looking at my options, I was seduced by Framework’s promise of a repairable and upgradable laptop that supports Linux out-of-the-box without weird driver issues, as well as the option to assemble the laptop myself1 and buy the RAM and SSD I want separately2, back when they were cheap.

    For three years, the laptop has served me well, until Framework suggested via newsletter to install the latest BIOS3 update, version 3.20, with a bunch of security fixes. Unfortunately, the system hung and displayed a corrupt image on the screen, signifying a failed BIOS flash.

    Naturally, I reached out to Framework support, who told me to unplug the laptop, let the battery drain, and power it back on again afterwards, hoping the laptop would recover by itself. Unfortunately, it never did, and after giving Framework a bunch of information, they informed me that since my 1-year warranty has expired, I have no option but to purchase a new Framework motherboard, which will cost at least CA$500.

    A quick search revealed that many people had issues with BIOS flashes with this specific BIOS update on the Framework forums, even those in warranty, and on a different thread, people have been having similar issues with BIOS flashing in general on this model since at least March of 2025. To my knowledge, Framework has never acknowledged the issue or offered any indication that the problem was fixed, so buying a new motherboard would simply be playing Russian roulette if I ever wanted to update the BIOS again, on top of spending CA$500+ through no fault of my own.

    Thus, I opted against buying a new motherboard and embarked upon a journey to flash the BIOS myself. I documented this journey in excruciating detail so that hopefully, by following along, you’ll understand exactly how you might fix similar problems.

    Update (2026-08-22): This post showed up on the front page of Hacker News on 2026-08-18 and Framework finally acknowledged the issue when asked by Ars Technica and promised relief to affected customers. See updates.

    (Read more...)
  • The Art of Time-Keeping, Part 5: Maya Calendar

    I can’t believe it’s been a few years since I built the French Republican Calendar web application and explained how it works in a blog post, which is really part of the series on the art of time-keeping. However, I was not exactly satisfied with making a web application for that one calendar when there are so many more interesting calendars in the world.

    Thus, I decided to explore a different calendar system with a completely different philosophy—the Maya1 calendar. Whereas the original version of the French Republican Calendar is completely based on astronomy and required calculation of the autumnal equinox, the Maya calendar system is entirely based on math and fixed-length cycles. I thought this would make a lovely contrast in calendar design philosophies.

    However, before we dive in deeper, it is important to mention that there isn’t just one “Maya calendar,” but rather three—the Tzolkʼin2, Haabʼ, and the Long Count. These cycles are also not exclusive to the Maya, but are used by many other Mesoamerican cultures, such as the Aztecs, under slightly different names.

    All three calendars are used in conjunction to tell the time, as the Tzolkʼin and Haabʼ are both unnumbered cycles. Only the long count can be used to identify an exact calendar date. Separately, there is also the Lords of the Night, which forms a 9-day week cycle.

    The finished implementation can be found here.

    (Read more...)
  • Resurrecting a 13-year-old high school project: the BSoD lock screen

    One day, during the winter break away from work, I was reminded of this ancient program I built in high school—a Blue Screen of Death (henceforth BSoD) simulator. It really has been a while since I’ve covered coding topics on this blog, so I thought it might be time to dig up the program and resurrect it.

    But you might ask the very natural question: why did I write such a program? For that, I blame the school. You see, I had to deal with school computers a lot back in the day, not being one of those “cool kids” who brought their own laptops to school. Naturally, the school computers ran Windows XP1. For some reason, the school administrators decided to deploy group policy to deny screen locking.

    This posed a conundrum: if I had to step away from the computer—like say, answering the call of nature—I was confronted with two deeply uncomfortable choices:

    1. Save all my work, close all applications, and log out, then wait forever to log back in on those slow computers, while hoping that no one else took the fastest one of the bunch2; or
    2. Leave the computer unattended, and if someone does something sketchy as a prank, I’d be the one in trouble.

    One day, I saw a school computer stuck with a BSoD, and no one ever touched it, and that gave me an idea: what if I wrote my own custom “lock screen” program that masqueraded as a BSoD? And thus was the program born.

    (Read more...)
  • 2025: Year in Review

    For the past three years, I’ve been writing year-end reviews to look back upon the year that had gone by and reflect on what had happened. As yet another year has gone by, it is time to continue the tradition.

    Like last year, I’ll divide this into several areas, as opposed to grouping by month as I had done in the years before:

    1. BGP and operating my own autonomous system;
    2. My homebrew CDN for this blog;
    3. My home server;
    4. My ADS-B feeder;
    5. My coding projects;
    6. My mechanical keyboard;
    7. My travel router project; and
    8. My music hobby.

    Without further ado, let’s begin.

    (Read more...)
  • Joining your first Internet Exchange

    Last time, I covered the process of announcing your very first route to the Internet via BGP, but that’s only the beginning. I promised to dive into the process of joining an Internet Exchange to bring better connectivity to a fledgling network, and now is the time.

    For this exercise, I will be connecting the BGP VM running AS200351 to the Ontario Internet Exchange (ONIX), which has gladly provided me with a port for my test network to help me write this post. While ONIX isn’t the biggest Internet Exchange in Toronto, for that honour belongs to TorIX, it nevertheless has a reasonable amount of big peers, such as Hurricane Electric, which will come into play later.

    Without further ado, let’s dive in.

    (Read more...)
  • Announcing your first routes to the Internet via BGP

    A while back, I wrote about what I wish I knew when I got my ASN, which has helped many embark upon the epic quest of hobby networking. I’ve also written plenty about the theory of Internet routing. However, what was conspicuously missing was an introductory practical guide to make use of a new ASN and IP space. I’ve decided to rectify this gap now.

    For this exercise, I will breathe new life into my original ASN, which I’ve since replaced globally with the new ARIN ASN 54148 for my main network.1 Now, I will set up AS200351 on a new BGP VM2 on AS54148’s infrastructure as a downstream, i.e. AS54148 will be the service provider that connects AS200351 to the Internet.

    (Read more...)
  • Building a global WireGuard mesh “backbone” network with OSPF

    Years ago, before I tried to build my own autonomous system and run BGP, I had a few servers in different locations,1 and I wanted them to be able to talk to each other over some sort of encrypted VPN, allowing plaintext protocols to be run between locations securely. WireGuard was a good option, but the classic deployment would necessitate all servers to connect to one main server. That simply wouldn’t do when I had multiple servers on each side of the Atlantic. If I put the main server on one side of the Atlantic, then two servers on the other side talking to each other would have to cross the Atlantic twice. That simply wouldn’t do.

    Instead, I thought to myself: what if I had a bunch of WireGuard tunnels between the different locations I had, and then have something intelligent select an optimal path between nodes? Open Shortest Path First (OSPF) seemed like the perfect option, allowing optimal routes to be selected based on the lowest possible cost (typically latency) based on Dijkstra’s algorithm, while routing around any failed links. Better yet, it did so without requiring every location to be connected to every other location. This meant that I could connect nodes on each side of the Atlantic to each other for low latency, while creating redundant trans-Atlantic links. It was also able to route traffic faster than the direct connection at times, when that used horrible routing.2

    Years later, when I started building my own BGP network, I ran into the problem of trying to use the same IPv4 /24 in multiple locations.3 While I could announce the same prefix from multiple locations as anycast, if I want to route an IP to a single host, I’d need something with which to route packets to that host, no matter which location it entered my network. Typically, a backbone network is used for this purpose. For large networks, this involves actual optical fibre between locations, but we can make do with tunnels for smaller networks. To keep things simple, I turned my existing WireGuard OSPF mesh into my very own “backbone”.

    In this post, we’ll explore how to use WireGuard, how to use OSPF, and how to use them to construct a backbone network and an encrypted VPN connecting distinct sites.

    (Read more...)
  • Enabling highly available global anycast DNS modifications with Galera

    Last time, we set up a global anycast PowerDNS cluster with geolocation and health checks. This enables it to provide high availability for other services, always sending the user to a node that’s up.

    However, there was one flaw—there is a single master node, which is the single point of failure for writes. When it goes down, it becomes impossible to make changes to the DNS, even though the “slave”1 nodes in the anycast will continue to serve the zone, including performing availability checks.

    Last time, I also hinted at MariaDB Galera clusters becoming important. This time, we’ll leverage Galera, a multi-master solution for MariaDB, to eliminate the dependency on the single master. We’ll also make poweradmin highly available so that we can edit DNS records through a nice UI, instead of running API requests through curl or executing SQL queries directly.

    Without further ado, let’s dive in.

    (Read more...)
  • Building highly available services: global anycast PowerDNS cluster

    As I’ve written about before, this blog has multiple geographically distributed backend servers serving the content, with my anycast PowerDNS cluster selecting the geographically closest backend server that’s up and returning it to the user.

    Due to various outages I’ve experienced recently, I’ve been thinking a lot more about making my self-hosted services highly available (HA), staying up even if a few servers go down. This is mostly for the sake of my sanity, so that I could just shrug if a server goes down and wait for the provider to bring it back up, instead of panicking. Of course, the added availability also helps, but it’s probably a bigger concern in the enterprise space than it is for hobbyists. As a bonus, if you have nodes spread out across multiple locations, you can also route the user to the geographically closest one for lower latency and faster response times.

    Either way, I thought it was time to start a series about building highly available services. We begin with the most important building block—DNS, which is basically required to make any other service highly available.

    The stack I’ve chosen for this is MariaDB and PowerDNS, mostly because these are fairly easy to set up and I already have experience with them. Many other alternative tech stacks are probably equally viable, but that’s left as an exercise for the reader. The general idea should apply anyway. Note that anycast isn’t really required, since you can still follow along and deploy two unicast DNS servers for redundancy.

    Without further ado, let’s dive in.

    (Read more...)