Category Archives: Reference

Short references for personal… reference. Basically a howto for the tech-savvy.

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

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 or more validation errors occurred.”,”status”:400,”traceId”:”00-8ab7d4ff2d97d5ec040c25058b8d6fff-64b7c8e21e11563b-00″,”errors”:{“”:[“A non-empty request body is required.”]}} Or even this: {“type”:”https://tools.ietf.org/html/rfc7231#section-6.5.1″,”title”:”One or more validation errors occurred.”,”status”:400,”traceId”:”00-2fec89d15f0fbc0a7deaf1dd96656e15-e7fabe160575f645-00″,”errors”:{“$”:[“The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: […]

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 […]

Recursive PostgreSQL user manager query for PowerBI path value, with loop handling

Recursive SQL queries. They’re hard to read, and even harder to wrap your head around. They’re handy when you have a self-referencing table (intermediates allowed, but complicates things) that somehow represents a tree, such as the management tree of a corporation, where each user has a manager_id that’s also a user_id in itself. There’s a […]

AWS RDS IAM Login pitfalls and checklist

So, you’re struggling with your IAM role login? psql: error: FATAL: password authentication failed for user “mydbuser”psql: error: FATAL: PAM authentication failed for user “mydbuser” This list is specifically for PostgreSQL, accessed by ECS containers and developers, but most of it would apply to any IAM compatible setup. First, check that you have allowed IAM […]

Office Volume License Keys (VLK)

I keep having to look these up, so I stored them here. Office 2019 Product KMS Client Setup Key Office Professional Plus 2019 NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP Office Standard 2019 6NWWJ-YQWMR-QKGCB-6TMB3-9D9HK Project Professional 2019 B4NPR-3FKK7-T2MBV-FRQ4W-PKD2B Project Standard 2019 C4F7P-NCP8C-6CQPT-MQHV9-JXD2M Visio Professional 2019 9BGNQ-K37YR-RQHF2-38RQ3-7VCBB Visio Standard 2019 7TQNQ-K3YQQ-3PFH7-CCPPM-X4VQ2 Access 2019 9N9PT-27V4Y-VJ2PD-YXFMF-YTFQT Excel 2019 TMJWT-YYNMB-3BKTF-644FC-RVXBD Outlook 2019 7HD7K-N4PVK-BHBCQ-YWQRW-XW4VK PowerPoint 2019 […]

Finding and killing stuck or mistyped postgresql queries

I’ve found these useful during development: Listing running queries: SELECT pid, now() – pg_stat_activity.query_start AS duration, query FROM pg_stat_activity WHERE state = ‘active’ AND pid <> pg_backend_pid(); Listing queries that have run for more than a full minute: SELECT pid, now() – pg_stat_activity.query_start AS duration, query FROM pg_stat_activity WHERE state = ‘active’ AND pid <> […]