Runar Ovesen Hjerpbakk

Science-based software development

Jekyll error - bad Request-Line

I use the excellent Jekyll to create this and a couple of other websites. Jekyll is a static website generator written in Ruby and plays very nicely with GitHub Pages.

But since it’s software, after all, it too needs updating once in a while. And as you know dear readers, all software sucks.

So I updated jekyll and other needed gems and tried to serve the page locally:

$ bundle exec jekyll serve --drafts --watch --baseurl '' --config _config.yml,_config-dev.yml --limit_posts 10
Configuration file: _config.yml
Configuration file: _config-dev.yml
            Source: /Users/hjerpbakk/projects/
       Destination: /Users/hjerpbakk/projects/
 Incremental build: disabled. Enable with --incremental
                    done in 12.903 seconds.
 Auto-regeneration: enabled for '/Users/hjerpbakk/projects/'
    Server address:
  Server running... press ctrl-c to stop.
[2018-03-20 16:40:31] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03?t&,?\x1E??\x1AJmc?_?U??c\x00<'.
[2018-03-20 16:40:31] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03aS?PP???c?\x1Ab~?K'\x13\b\x00w????M?8?\x7FK/\x00\x00.?,?+?$?#?'.
[2018-03-20 16:40:31] ERROR bad URI `?'.
[2018-03-20 16:40:31] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03?~F?Еs''?ʓ???\x16??e?#\b?\x05a+?{\x18ܬ\x00\x00(?,?+?$?#?'.
[2018-03-20 16:40:31] ERROR bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03 ?<\x18J3z??{?\x03?KĘ*?\r??`"+y"L?F??P\x00\x00.?,?+?$?#?'.
[2018-03-20 16:40:31] ERROR bad URI `?'

Bad request lines as far as the eye can see.

Read More

.dockerignore is your friend

While working on a particular project built with a multi-stage Dockerfile I got this error:

Step 13/19 : RUN dotnet test "./DashboardServerTests/DashboardServerTests.csproj" -c Release --no-restore
 ---> Running in ac850e55464c
Build started, please wait...
/usr/share/dotnet/sdk/2.0.3/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(323,5): error : Assets file '/Users/sankra/projects/DashboardServer/Grafana/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/source/Grafana/Grafana.csproj]

Read More

Running ASP.Net Core web app in a Docker container using a multi-stage Dockerfile

Lately. I’ve written multiple web applications with ASP.Net Core. Together with C# newfound cross-platformness, this stack is a joy to work with.

I user Docker to run the applications, some in Azure, some on on-premise Linux boxes. This has thought me a couple of things. Firstly, the app should be built from within a container using a multi-stage Dockerfile.

Read More

Xamarin iOS bindings for Simulator Status Magic

Screenshots are an important aspect of App Store marketing. Not only do they promote the functionality and design of your app, but they can also reveal your attention to detail. Or lack thereof.

Many developers do not care how the battery, time and signal strengths are displayed in their screenshots. But I do.

Read More

An assembly specified in the application dependencies manifest was not found

This happened a while ago, but might be relevant again in the future.

I created a website using ASP.Net Core and ran it through a Docker Container.

$ docker run kitchen-responsible

Worked perfectly for a long time, but after updating a nuget package it started to fail with:

  An assembly specified in the application dependencies manifest (KitchenResponsibleService.deps.json) was not found:
	package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.1'
	path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll'
  This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:

Read More

Visual Studio Code failed to start on macOS

One day Visual Studio Code (VS Code) did not start on my Mac.

Read More

Sorry, but there is no formatter for 'xml'-files installed.

Sometimes I question my sanity.

I’ve used Visual Studio Code (VS Code) since it was revealed at Build. One of its many useful features is the ability to format documents in a human readable form. This includes XML.

Or so I thought.

Read More

Get milliseconds from Unix epoch in C#

I needed a method in C# to get the number of milliseconds since the start of Unix time.

Unix time (also known as POSIX time or UNIX Epoch time) is a system for describing a point in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, minus the number of leap seconds that have taken place since then.

This is the DateTime extension method I came up with:

public static long MillisecondsFromUnixEpoch(this DateTime dateTime) =>

Read More

Split a C# list or array into multiple parts

I needed a method in C# to split a list or an array into multiple parts for batch processing. This is the IEnumerable extension method I came up with:

public static IEnumerable<IEnumerable<T>> Batch<T>(this IEnumerable<T> collection, int batchSize)
var nextbatch = new List<T>(batchSize);
foreach (T item in collection)
if (nextbatch.Count == batchSize)
yield return nextbatch;
nextbatch = new List<T>(batchSize);

if (nextbatch.Count > 0) {
yield return nextbatch;

Read More

Change the OmniSharp version being used by Visual Studio Code

Visual Studio Code (VS Code) is a great code editor for any platform. And perfect for .Net scripting! I use it to edit my scripts written in dotNet Script. dotNet Script has a lively community with new features being added regularly. VS Code is a collection of different libraries and frameworks, all working together to give you that good experience. Thus, if your new favorite scripting language gets a new feature, it sometimes takes a little while for the tooling to catch up.

Read More