Skip to content

Instantly share code, notes, and snippets.

@natanlao
natanlao / syncthing-photo-sync.md
Last active September 2, 2023 01:13
Syncing iPhone photos with Syncthing
View syncthing-photo-sync.md

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 / arq-ssh.md
Last active May 24, 2023 13:50
Generating SSH keys that will work with Arq
View arq-ssh.md

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 / contacts.md
Last active January 12, 2023 18:30
Importing birthdays and contact images from Google Contacts to Fastmail
View contacts.md

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
View apple-recovery-keys.md
@natanlao
natanlao / dependabot.md
Last active November 9, 2022 14:48
Automatically merging Dependabot PRs
View dependabot.md

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 / github-global-node-id.md
Last active August 12, 2022 07:46
Translating GitHub resource IDs to global node IDs
View github-global-node-id.md

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 / aws-s3-include.md
Created October 21, 2021 20:14
`aws s3 cp`, `aws s3 sync` not excluding/including keys properly
View aws-s3-include.md

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
View volume.md

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
View followups.md
@natanlao
natanlao / gist:411ca6567540fc4aa0b2facbf257a3e0
Created April 26, 2021 02:53
Notes on mounting an external ZFS pool with NixOS
View gist:411ca6567540fc4aa0b2facbf257a3e0
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