Backing up your GPG credentials on Linux

GPG is useful especially for signing commits on GitHub. It is a good idea to pre-emptively make backups of your GPG credentials, as extracting them from an unbootable system drive is not a straightforward process.

Backing up GPG

These steps should work on most, if not all, Linux distributions.

  1. First, export your credentials

    gpg --export --export-options backup --output public.gpg
    gpg --export-secret-keys --export-options backup --output private.gpg
    gpg --export-ownertrust >> trust.gpg
    
  2. Afterwards, copy these 3 files public.gpg private.gpg trust.gpg to somewhere safe (like an external drive or NAS).

  3. You can import them on a new machine by running the following

    gpg --import public.gpg
    gpg --import private.gpg # Prompts you to type the passphrase that you used when you first created the GPG key.
    gpg --import-ownertrust trust.gpg
    

Tip: For GitHub users, if you need to sign commits using your existing GPG key on your new machine, see https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.

...more
3 min August 29, 2024 [General] #linux #gpg
Recommendations for GNOME Extensions (2024)

The GNOME desktop environment for Linux is simple, stable, and user-friendly. However, the maintainers tend to make some bizarre design decisions that reduce its usability. Thankfully it supports third-party extensions like a web browser.

Here are some extensions that I found useful, along with recommended settings. These should be compatible with most popular Linux distributions. ...more

3 min August 27, 2024 [General] #linux #gnome
Singapore MRT/LRT in 2040

Station Mean Path Length in 2040

Expansion of the MRT/LRT rail network is a major part of the Singapore Land Transport Master Plan 2040. As the rail network would be over half a century old by then, I wanted to take a look at how its fastest available routes have changed in the past, and how we can expect them to change in the future. So here is a program to calculate the fastest path between any 2 train stations, similar to the countless travel mobile apps out there, but for all known and projected stages, from the initial launch in year 1987 to 2040 and beyond. ...more

11 min August 15, 2024 [General] #mrt #lrt