Runar Ovesen Hjerpbakk

Programmer. Software Architect. Technical Manager.

GitHub Pages 404

This morning I was greeted by this beautiful sight:

hjerpbakk.com 404

Obviously missing in action, but why?

Read More

You have an entitlement not supported by your current provisioning profile

My previously awesome Book Scanner app, written using Xamarin, currently has an embarrassing error on iOS 12: the app will not prompt the user for camera permissions, thus rendering the app useless.

Luckily, the fix is easy. Just add the following to the info.plist file and the user is prompted for permission when the app is run for the first time.

<key>NSCameraUsageDescription</key>
<string>Used to scan book barcodes</string>

So I made the change and thought it only reasonable to test it on my own device first. Unfortunately, the output from the Deploying to Device tab in Visual Studio crushed my dreams:

VerifyingApplication - PercentComplete: 40%

ApplicationVerificationFailed: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.TCrsU1/extracted/BookScanneriOS.app : 0xe8008016 (The executable was signed with invalid entitlements.)

error MT1006: Could not install the application ‘/Users/sankra/projects/BookScanner/BookScanner.iOS/bin/iPhone/Release/BookScanneriOS.app’ on the device ‘iPhone XS’: Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016).

Application could not be uploaded to the device.

The app could not be uploaded to the device because of invalid entitlements. Strange, as the app has only a few entitlements and none that should be affected by the aforementioned small change.

Read More

Use Caps Lock as Escape in macOS

On Touch Bar enabled Macs, the Escape key has been removed and replaced by a Touch Bar software button. As a developer, this sucks. I use Escape all the time and need a proper button.

Luckily, this is easy to fix.

Read More

Remove local branches not present on GitHub

I mostly use GitHub’s desktop client while working with GitHub repositories. This means that I get less exposure to the git CLI (command line interface) commands than perhaps is healthy.

But sometimes even I need to go old school.

Read More

Make your code more beautiful with the Fira Code typeface

Beautiful code: typography and visual programming by Peter Hilton was one of the best talks at NDC Oslo this summer.

Peter talked about how layout and typography can make code beautiful and improve code readability. After all, as Knuth pointed out:

Programs are meant to be read by humans, and only incidentally for computers to execute.

So how can one improve a monospaced programmer focused typeface?

By utilising ligatures of course!

Read More

Lookup IP from DNS name

As you can read from this blog, operations was never my main interest. But in these days of DevOps, I’m getting exposed to more hosting environments than I’ve ever been before.

Since I was a small child I knew about ping to check if a server was online and see its IP-address. Today I learned about nslookup.

Read More

Don’t commit launch.json

You’ll remember that I recently experienced a snag while working on the same dotnet script script(!?!) on two different machines. During the project, I updated dotnet script on one machine but forgot to do it on the other. I wrote in my post that the solution was just to remember to upgrade on all machines, but Bernhard recommended a better solution.

Read More

Converting a HTML table to Markdown using dotnet script

Working with software integrations can be both interesting, fun and mind-boggling frustrating. Today I needed to parse a table in a website (first mistake), clean the text using regular expressions (second mistake?) and generate a corresponding table in Markdown using dotnet script (definitely not a mistake).

Read More

Creating an ASP.Net Core app with a React frontend and Docker hosting

I started a new project this week, a SPA written in React with an ASP.Net Core 2.1.1 backend hosted in a Docker container. This is the tale of how I got all those pieces working together.

The running code from this article can be seen on GitHub.

Read More

Simplify your crontab entries with crontab.guru

As you’ve seen from my previous posts, I’ve used cron a lot lately to schedule periodic tasks on my RaspberryPi. cron is driven by crontab, cron table files, configuration files that specifies shell commands to run periodically on a given schedule.

# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday; 
# │ │ │ │ │              7 is also Sunday on Raspbian)
# │ │ │ │ │
# │ │ │ │ │
# * * * * *  command to execute

The timing syntax is understandable enough. In addition to numbers, we can use special operators:

*	any value
,	value list separator
-	range of values
/	step values

An expression to achieve At 22:00 on every day-of-week from Monday through Friday looks like this:

0 22 * * 1-5

My problem is that I get the elements confused. Without reading the explanation, is 22 in the expression above minute or hour? You have to read the spec to find out.

Read More