All Notes

Forcing a specific CA chain

Oct 20, 2026

When a CA has its certificates removed from public trust (as happened today), applications don’t always know immediately. TLDR Just set …

#security

Enforce TLS for S3

Dec 10, 2024

IAM policies can have a Condition, which must pass for the policy to apply. This can be used to require HTTPS and/or the TLS version: { …

#AWS

Create presigned URLs using AWS CLI

Oct 29, 2024

Sometimes, you only have access to the aws CLI, and need to generate presigned URLs to S3 objects. The aws s3 presign command will do this, creating …

#AWS

Optimising GIFs

Mar 12, 2024

Optimising images is a fairly well understood problem, with lots of different solutions and tools. Images can be resized, their pixels grouped, or …

#media

Scheduler-only Heroku apps

Mar 11, 2024

If everything you run is already in Heroku, it can be useful to run even simple scheduled tasks there too, to save integrating and running services on …

#heroku

Hide short Table of Contents

Feb 22, 2024

Some of my notes don’t have headings. Others have barely any. However, the Table of Contents area used to take up a large area of screen for no …

#mkdocs

Scaling Heroku's release type

Feb 22, 2024

During release, it’s possible to consume so much memory, Heroku kills the dyno before it finishes executing. heroku[release.xxxx]: Process …

#heroku

Cross-account data transfer in S3

Feb 21, 2024

To copy bucket contents from a bucket in account A to a bucket in account B: Create new S3 bucket in account B Create IAM role / user in account B, …

#AWS

Navigate mkdocs by tag

Feb 17, 2024

The sidebar for this notes site used to use tags for the hierarchy, rather than by the filesystem structure. This works by retrieving the tags for …

#mkdocs

View wide tables with psql

Jan 1, 2024

When making a query with lots of columns, it can become so wide that it wraps, making the results incredibly difficult to read. To combat this, you …

#PostgreSQL

Downmixing audio channels

Oct 27, 2021

ls -1 *.mp4 | xargs -I{} ffmpeg -y -i {} -ac 2 -c:v copy /path/to/out/{} Downmixes multi-channel audio into stereo. Reduces the chances of weird …

#media

Bulk rename files

May 14, 2021

rename 's/<in_re>/<out_re>/g' * Useful options: -v: List files renamed -n: Dry-run -d: Act just on the filename

#shell

Monitor running queries

Oct 7, 2020

View a list of running queries: SELECT datname, pid, usename, client_addr, client_port, xact_start, backend_start, query_start, state, query FROM …

#PostgreSQL