Skip to content

Instantly share code, notes, and snippets.

@natanlao
natanlao / recovery-codes.md
Last active April 25, 2021 22:16
Managing multifactor authentication recovery codes

I store my multifactor authentication recovery codes in plaintext on a flash drive. The flash drive is stored in a safe place that can only realistically be accessed by me. I periodically generate a PDF from these codes and print it.

There's a good amount of reading on ways that other people manage this:

In choosing this approach, I considered not only the possibility that I would need to recover access to an MFA-protected account, but also the possibility

@natanlao
natanlao / perl-multistage.md
Created August 8, 2020 00:25
Multi-stage Dockerfiles with perl and perl-slim

The benefits of using multi-stage Docker builds is well-known. Using multi-stage builds with a pure Perl setup is trivial -- all it involves is copying the /usr/local/lib/perl5 directory:

FROM perl:5.28 as builder
COPY cpanfile cpanfile
RUN cpanm --installdeps .
@natanlao
natanlao / reminders.md
Created September 29, 2020 06:24
Tracking recurring reminders

I use my Fastmail calendar to track recurring reminders, like regular maintenance, or scheduling a doctor's appointment, or requesting a credit report, etc. I create each reminder as an all-day event on a calendar only for reminders, and configure each event to send me an email reminder on the day of the event.

This approach is simple and flexible:

  • Recurrence rules make it trivial to configure a task to repeat at any interval, whether it be on the nth day of the month every m months, or every other year, etc.
  • With an Inbox Zero approach, reminders stay out of the way until they're relevant, and can be
@natanlao
natanlao / contacts.md
Last active January 12, 2023 18:30
Importing birthdays and contact images from Google Contacts to Fastmail

Fastmail offers an automated Google Contacts [import feature][import], and also supports importing contacts by CSV and vCard. Unfortunately, I've noticed that all of these import features are lossy. Regardless of import method:

  • Contact profile pictures stored in Google Contacts are not imported. (Google exports profile photos by including a link to the photo in the CSV.)
  • Birthdays without associated years (i.e., just the month and day) are sometimes not imported at all.
  • Empty ('') phone numbers are sometimes added to contacts. (This issue may have been a result of me trying to fix the two issues above, and not Fastmail
@natanlao
natanlao / zfs.md
Created October 23, 2020 07:04
Cross-platform filesystem

I spent some time recently looking for a cross-platform filesystem to store some personal data. After some deliberation, I settled on a single-volume ZFS "pool" and I'm pretty happy with it. Here's why:

  • Strong cross platform support. Works natively on Linux, macOS, and Windows.

  • [Native encryption][encryption]. ZFS supports encryption out of the box. It would have been possible to use something like VeraCrypt to encrypt a

@natanlao
natanlao / vanilla.md
Created November 28, 2020 23:45
Warning about Vanilla eGift Cards

If you receive a Vanilla eGift Card, you should know that the link to the page with your eGift card details will expire after some weeks. The link can supposedly be reissued, but it must be requested by the person who purchased you the eGift card over the phone. So, best to save the card details somewhere once you receive them.

The eGift Card funds are advertised as never expiring. It's not clear to me if that guarantee holds for funds left inactive for a long period of time.

Problem

Cannot add Apple recovery key

Reproduced on

iPhone XR, iOS 14.2

Symptoms

@natanlao
natanlao / dokku.md
Last active March 30, 2021 22:35
Dokku reference

I host side projects on a DigitalOcean droplet running Dokku. For reference:

One-time setup of Lets Encrypt

$ ssh root@platform.natan.la sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
$ ssh dokku@platform.natan.la dokku letsencrypt:cron-job --add

Creating an app

@natanlao
natanlao / uc-dcp.md
Last active January 20, 2021 07:25
Guide to the Defined Contribution Plan for UCSC undergraduates

Guide to the Defined Contribution Plan for UCSC undergraduates

First, a disclaimer: I am neither a lawyer nor a financial adviser, and if I were, I wouldn't be your lawyer or financial adviser. This is neither financial advice nor legal advice. I didn't even study this stuff.

That said, I've provided sources where appropriate. In particular, I'll refer to these documents:

  • this UCSC Career Center [Defined Contribution Plan documentation][cc], which
@natanlao
natanlao / dependabot.md
Last active November 9, 2022 14:48
Automatically merging Dependabot PRs

The best way I've found to automatically merge Dependabot PRs is to use actions/github-script to comment @dependabot merge on Dependabot PRs. There are a few reasons why I think this approach makes sense:

  • Commenting @dependabot merge on a Dependabot PR instructs Dependabot to merge the PR after tests (if any) pass, so we don't need to encode that dependency in a workflow file.

  • Unlike using an auto-merge action, nothing happens if the workflow runs on a