Skip to main content

How does the 6 digits number in multifactor authentication works?

· 15 min read

What is that 6 digits number in the authenticator app? Why those numbers change every 30 seconds? How are they generated? How does the server know that this is the correct number? How does it work offline?

Also, why do we need to scan a QR code when setting it up? What does the QR code contains? How secure is the whole system? What are the limitations? What to consider if implementing a server to support this authentication method?

We will start with a some simple intuitive explanation and slowly go into the technical details and algorithms. Hopefully you can answer all the above questions after reading this. This is not a high level explanation of why it's good to have MFA, or how to deploy it, there are plenty of resources explaining that already. This article focus on the details of the technology under the hood.

How I use keyd to remap my keyboard in Ubuntu 22.04 with Wayland

· 13 min read

Think about how you use your keyboard. Imagine how good it would be if your CapsLock can be used as Ctrl, how much better it would be for your left pinky? That is the power of remapping the keyboard. It means you can customize the functionality of each key on your keyboard.

This is a walkthrough of my setup in Ubuntu using keyd. A guide I wish it existed when I first try to find out how to remap my keyboard in Ubuntu.

Don't say it's a weird bug, because it makes you look stupid

· 6 min read

Often when someone is debugging an issue, you might hear:

  • It's a weird bug
  • Somehow it throws an error, it's weird
  • I followed the README, but weirdly it doesn't work

As if something outside their control misbehaved, they expect someone to help them eliminate the "weirdness". I find that a bit annoying. What does "weird" actually mean?

We think "it's weird" because we feel like we did nothing wrong, and the outcome is not what we intended. We do not understand why something unexpected happened, and our first instinct is to label it as "it's weird". If the system is "weird", then it is no longer our problem.

However, is this true? Should you ever say computers behaved "weirdly"?

Dual Boot Windows and Ubuntu with Secure Boot and Full Disk Encryption

· 12 min read

A few months ago, I finally took the time to set up dual boot on my laptop. I would love to try Ubuntu as my daily driver again, while keeping the Windows OS just in case. I treated this as a learning opportunity and configured dual boot with secure boot still enabled and have full disk encryption configured for both operating systems.

I wrote this blog because I could not find a single guide explains all steps for secure boot and full disk encryption sequentially, and these steps interleave each other. So, I made some notes before the installation to ensure I am doing the right thing at the right time. For example, I won't accidentally skip a step about configuring secure boot when I am focused on following another guide about full disk encryption. This guide is a cleaned up version of the notes that I compiled for my dual boot set up.

I organized the whole flow into 6 general steps:

  1. Preparing in Windows: set boot mode, partition disk, etc.
  2. Configure BIOS: boot mode and other BIOS settings
  3. Configure Ubuntu Partition: boot and data partition
  4. Install Ubuntu: configure dual boot and mounting volumes correctly
  5. Set up crypttab for full disk encryption
  6. Reboot and fix some other issues