Skip to content

Instantly share code, notes, and snippets.

@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 / arq-ssh.md
Last active February 22, 2024 21:03
Generating SSH keys that will work with Arq

Generating SSH keys with Arq

Tested with Arq 5.

I encountered some issues trying to add my existing SSH key pairs with Arq. I saw errors like:

[path to key]: Key 'OPENSSH' is not supported.

or

@natanlao
natanlao / syncthing-photo-sync.md
Last active February 12, 2024 13:01
Syncing iPhone photos with Syncthing

For those who prefer to avoid solutions like iCloud Photos and Dropbox for backing up photos, you can sync your iPhone photos with Syncthing. To do this, you'll need two things:

  • Möbius Sync is, to my knowledge, the only actively-maintained Syncthing client for iOS. It's free to sync up to 20 MB, and only $4.99 (one-time) to remove that limit.

  • PhotoSync is a nifty iOS app for syncing photos to a number of different destinations. It's free for low-quality

@natanlao
natanlao / github-global-node-id.md
Last active December 27, 2023 07:04
Translating GitHub resource IDs to global node IDs

GitHub associates a unique resource ID (or "database ID" or just "ID") with each API-accessible resource. For example, each [issue][issue-id], [repository][repository-id], and [user][user-id] has a global ID. In my limited experience with it, GitHub's REST API generally does not expose endpoints by which resources can be queried by ID (though it does have some [undocumented endpoints][repo-rest]). These resource IDs have been superseded by distinct [global node IDs][global-ids] (node_id). GitHub's GraphQL API allows retrieval of a node by its ID, called a "direct node lookup".

As you can tell, you likely don't have much reason to interact with the older

@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

Problem

Cannot add Apple recovery key

Reproduced on

iPhone XR, iOS 14.2

Symptoms

@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

@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 / 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 / followups.md
Last active July 7, 2021 05:42
Job application follow-up emails