Skip to content

Instantly share code, notes, and snippets.

@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 / ccpa.md
Last active April 14, 2021 18:14
CCPA wall of shame

Over the last few months, I've been cleaning up after myself and filing CCPA requests where I can. Here are some of the less-friendly companies that I've encountered in this process.

Sift

Signed me up for marketing emails using the email address I provided for my CCPA request.

Equifax

The worst one of them yet.

@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 / gist:411ca6567540fc4aa0b2facbf257a3e0
Created April 26, 2021 02:53
Notes on mounting an external ZFS pool with NixOS
Going to come back to this at some point far in the future, forgot to keep track while I was doing it.
1. Add `zfs` to `environment.systemPackages`
2. Set `networking.hostId`, do `boot.supportedFilesystems = [ "zfs" ];`
3. Force import pool
4. Reboot
5. Things work
@natanlao
natanlao / followups.md
Last active July 7, 2021 05:42
Job application follow-up emails
@natanlao
natanlao / volume.md
Last active August 9, 2021 19:46
docker-compose: no declaration was found in the volumes section

If, when doing something like docker-compose up, you run into an error like this:

ERROR: Named volume "server/db:/usr/share/nginx/html/db:rw" is used in service "web" but no declaration was found in the volumes section.

You're missing a leading ./, so, for example:

volumes:
 - 'server/db:/usr/share/nginx/html/db'
@natanlao
natanlao / aws-s3-include.md
Created October 21, 2021 20:14
`aws s3 cp`, `aws s3 sync` not excluding/including keys properly

It turns out that the order of the --exclude and --include flags passed to aws s3 sync and aws s3 cp matters, so

aws s3 sync 's3://my-bucket' . --include '*' --exclude '*.png'

won't download anything but

aws s3 sync 's3://my-bucket' . --exclude '*' --include '*.png'
@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

Problem

Cannot add Apple recovery key

Reproduced on

iPhone XR, iOS 14.2

Symptoms

@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