Mira Okafor

Mira Okafor

Backend developer in Weststadt. Writes the series here, runs stummel on a mini PC under her desk, and answers pages one week in six.

TIL

curl --json sets both headers for you

Since curl 7.82, --json sends the body as data and sets Content-Type and Accept to application/json in one go.

$ curl --json '{"url":"https://example.org/a/long/path"}' localhost:8080/api/links
{"code":"k3x9","url":"https://example.org/a/long/path"}

Before, I typed -H twice and forgot one of them every other time.

Changelog

v1.4.0: Links that expire

Links can expire after a date or a number of clicks, and the API answers 410 for them. The link list now comes wrapped in an object.

TIL

psql picks the layout with \x auto

\x auto switches psql to one column per row only when a row is wider than the terminal. Narrow results stay a table.

$ echo '\x auto' >> ~/.psqlrc

I used to toggle \x by hand and forget to toggle it back.

Incident

stummel.example was down for 47 minutes

The certificate expired at 06:00. Renewal had failed for three weeks, and the warning mails went to a folder I never open.

Resolved Major

Post

Pairing on a parser

We parsed query strings by hand for an afternoon, then deleted it and used URLSearchParams. Notes from both sides of the keyboard.

1 min

TIL

git worktree for a hotfix without stashing

git worktree add checks out a second branch in its own folder. The half-done work stays where it is.

$ git worktree add ../stummel-hotfix main
$ cd ../stummel-hotfix
$ git switch -c fix/query-string

git worktree remove ../stummel-hotfix cleans up once it is merged.

Buy Logbuch