Category Archives: Solved Problems

Problems and solutions. Good stuff.

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”})) […]

DNS names for Hyper-V client machines

So, running a couple of Hyper-V machines, and needing to determine their local IP addresses to connect to them. As long as the Hyper-V Integration Services are installed (apt-get install hyperv-daemons on Debian-based distributions), PowerShell on the host machine will have access to the IP addresses of the client machine. Without the Integration Services, PowerShell […]

Web Echo Service for developers

I recently had need of a service that would return your exact query to you for web client (or proxy) development purposes, in a case where using Fiddler, Wireshark, tcpdump et.al. was proving difficult for various reasons. The solution became the C-Net Echo Service, available at https://echo.c-net.org/ (and over plain HTTP if you need it). […]

curl SSL fails even with ca-certificates installed

curl: (60) SSL certificate problem: unable to get local issuer certificateMore details here: https://curl.haxx.se/docs/sslcerts.html So curl fails to access sites over https, even if ca-certificates is installed in your Docker container? You need to force a certificate rehash. Why this is not done by default escapes me. /usr/bin/c_rehash curl should be happy now. Enjoy!

GLaDOS Voice Generator (weekend project)

I wanted some GLaDOS-like sounds for my home automation system. I found this project, which doesn’t work anymore as of writing, as the synthesis server is offline. Thus, my weekend project turned into a week-long evening project. But that’s fine, as the result is cool: The new GLaDOS Voice Generator is here! Enjoy.

“Invalid provider type specified” CryptographicException when accessing the PrivateKey property of a certificate in C#/.Net

We recently encountered this in a production environment: A customer had installed a new certificate, and this exception began showing up in the logs. Luckily, the application was smart enough to at least fall back on using the previous (not yet expired) certificate, so no downtime occurred. Turns out the customer had been provided with […]

Docker starts slowly on Raspberry Pi / Raspbian

After installing the latest stable version of docker-ce (5:18.09.0~3-0~raspbian-stretch as of the time of writing), Docker would take ages to start after a reboot. Commands would even time out waiting for it. /var/log/daemon.log shows a gap of almost 4 minutes between the attempt to start the Docker Application Container Engine and the first log line […]