Author Archives: bolt

Excel Conditional Formatting

I don’t do much Excel, but when I do, it’s crap like this. Putting it here, so I remember. For applying conditional formatting to an entire sheet, do “Applies to: =$1:$1048576” For matching exact values to conditionally format, do something like =EXACT(A1;”Foo”)

Quickly generate a 10 year, base64 encoded, self signed, client cert using OpenSSL

Just a bunch of commands I might need later: #!/usr/bin/env bash set -eu certname=”MyClient” pubfile=”pub.cer” tmp=”$(mktemp -d)” trap ‘rm -r “$tmp”‘ EXIT openssl genrsa -out “${tmp}/private.key” 4096 openssl req -new -key “${tmp}/private.key” -subj “/CN=$certname” -out “${tmp}/request.csr” openssl x509 -req -days 3650 -in “${tmp}/request.csr” -signkey “${tmp}/private.key” -out “${tmp}/certificate.crt” openssl pkcs12 -export -out “${tmp}/certificate.pfx” -inkey “${tmp}/private.key” -in […]

Forcing an ARRAY() in postgres subqueries

Quick note to self, when making a complicated query, comparing to data in a subquery, the postgres query planner will sometimes decide to perform the entire outer query without the comparison, cache the results, and then run the inner query. Example: SELECT DISTINCT …FROM …INNER JOIN … ON …WHERE … AND … AND …id IN […]

TIKI-100 Documentation

Archiving some documentation for the Norwegian microcomputer TIKI-100 here, in case anyone needs it. I’ve sold mine, but Tommy Ovesen of Arctic Retro has graciously scanned the manuals I had for them. They’re here as well, for redundancy: User Manual – Instruksjonsbok TIKOS User/Technical Manual – TIKOS Bruker- og teknisk manual Software Catalog – Programvarekatalog […]

Allowing an empty JSON body, or no Content-Type, in a C# ASP.NET Core API

NOTE: In applications targeting net7.0+, Microsoft has fixed this issue, and you can set your Object to be default null (MyClass thingamagic= null), having it work as expected.Leaving the below hack in here for anyone stuck on net6 or below. — You may be here because you’re getting this: {“type”:”https://tools.ietf.org/html/rfc7231#section-6.5.13″,”title”:”Unsupported Media Type”,”status”:415,”traceId”:”00-0d785f3d1cb4fd71bc36ee25561e4b48-6bc5df1f0d070024-00″} Or this: {“type”:”https://tools.ietf.org/html/rfc7231#section-6.5.1″,”title”:”One […]

Moving columns in PowerQuery without naming every column

If you have pivoted data, you probably don’t want to name all the columns to move one, as a lot of them are going to contain dynamic data. The solution is to use the list of columns, manually moving the one you want into the desired position, as such: = Table.ReorderColumns(PreviousStepName, List.InsertRange(List.RemoveItems(Table.ColumnNames(PreviousStepName), {“ColumnToMove”}), 4, {“ColumnToMove”})) […]

Unpivoting two columns in PostgreSQL

We recently had a need to unpivot two columns with item id’s in them so they’d come out as a single column with distinct values. Some of the entries had <null> as the parent id, and null should not appear in the output. One could solve this with a simple UNION, but the view we […]