RSSAmplifier

Blog

Simon Morgan

Recent content on Simon Morgan

/RSS feed ↗28 posts

Latest posts

MikroTik hEX S (2025) AAISP Configuration

In my never-ending quest to screw up my Internet connection, I bought a MikroTik hEX S (2025) , otherwise known by the slightly less catchy “E60iUGS”. I used to have a RB2011UiAS-2HnD-IN which generally served me well, except the WiFi on it was well past its prime, so I bought some TP-Link Deco X55s. When they work, they’re alright; the trouble is they don’t work a lot more…

Goodbye Aquiss

By my reckoning I’ve been using Aquiss as my ISP for over 10 years. Needless to say, I’ve been pretty happy with them. I like small ISPs because I like to think they give a shit about their customers. At the other end of the spectrum, you have Big Tech™ companies like Google and Cloudflare whose only motivation seems to be to get as rich and powerful as possible by exploiting their…

Diagnosing DbContext disposed InvalidOperationException

While working on a large project that uses the unit of work pattern (and other things that generally make it harder to debug), I was getting an InvalidOperationException with an error about the DbContext being disposed. It wasn’t obvious where this was happening, so I came up with the following: using System.Diagnostics; namespace My.Cool.Project { internal class CustomDbContext :…

ELEGOO UNO R3 Notes

I’ve been farting around with an ELEGOO UNO R3 (that came as part of their Basic Starter Kit ), today. I think it’s a pretty old-hat device at this point, but I thought I’d put some notes here, mainly for my future self, but also in case anybody else might find them useful. Documentation The tutorials and documentation distributed by ELEGOO is quite old at this point, and not…

Google Play Notifications Bug

In Google Play, the bell icon next to the search box was saying I have 1 unread notification. However, when I tap the icon, there are no notifications listed, and nothing in the “Offers” tab either. I tried force stopping the app, clearing the cache and restarting, as well as restarting my phone, but neither made any difference. After speaking to Google support, the…

Useful SQL Scripts

I’ve had these SQL Server scripts kicking around on my hard drive for a while now, so thought I’d post them here for posterity. Find Duplicate Foreign-keys For some reason SQL Server allows duplicate foreign keys. This script finds them for you. WITH FKData AS ( SELECT fk.parent_object_id ,fkc.parent_column_id ,fk.referenced_object_id ,fkc.referenced_column_id ,FKCount = COUNT ( * )…

.NET Console App User Secrets

When scaffolding an EF Core .NET 6 console app recently, I discovered the it doesn’t support sourcing connection strings from the user secrets store unless you’re scaffolding an ASP.NET project. A lot of the documentation on the web, both from Microsoft and third-parties, also seems to assume that you’re using ASP.NET. Here’s how I got it working with the minimum of fuss.…

DrayTek Vigor 130 and MikroTik RB2011UiAS-2HnD-IN

If you just want to get the damn thing working as a modem (referred to as “ bridge mode ” in the DrayTek documentation) with your router, but don’t want to read about the ballache I had to go through Select “Enable” on the “MPoA / Static or dynamic IP” page Select “1483 Bridged IP VC-Mux” from the “Encapsulation” drop-down on the…

Wayback Machine Bookmarklet

I’ve come up with the following bookmarklet for searching the Internet Archive’s fantastic Wayback Machine for the current URL and thought I’d share it. I found an existing bookmarklet that purported to do this, but it included the protocol scheme (the e.g. http:// part) in the lookup string, which meant it didn’t work. I’m not a fan of the regular expressions, but…

SDL2 on Windows with MSVC without Visual Studio

I’ve been interested in learning some low-level graphics programming and so figured a good way to do it would be via SDL and C. I already had Microsoft’s C compiler available as I had a minimal (as much as anything to do with Microsoft or Visual Studio can be called minimal) Visual Studio Build Tools installation for Rust development, but I didn’t want to have to install the…

ASP.NET Web Forms web site assembly definition errors

I have the unfortunate task of having to work with an ASP.NET Web Forms web site and have frequently had to deal with errors like the following: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT:…

sp_MSforeachtable Table Filtering

SQL Server provides the handy sp_MSforeachtable stored procedure for executing the specified T-SQL for each table in a database. But what if you only want to run it for certain tables? I found myself in this boat but a bunch of the recommendations I came across didn’t work. The whereand parameter was clearly what I wanted. However, say we wanted to filter out all tables whos names…

WiFi Calling and the Billion 8800NL R2

I have a Moto G7 Power (XT1955-4) and recently switched to EE because they support WiFi calling with that model. The trouble is, I could not for the life of me get it working. The WiFi calling setting was enabled but whenever I’d go to make a call, I’d get an error telling me to connect to a wireless network. Needless to say I was connected to my WiFi and had no connectivity issues.

Verifying RSA signatures using .NET and C#

I recently found myself wanting a system to cryptographically sign and verify files. I came up with the following method which uses a combination of the OpenSSL command-line utility and the .NET RSA class. I used the version that’s part of .NET Core 3.1. This post assumes some familiarity with encryption, specifically public/private key encryption. First we generate the public and private…

Windows Services, Named Pipes and UnauthorizedAccessException

I was working on some proof-of-concept code whereby an unpriviledged client would communicate with a Windows service using protocol buffer serialization over a named pipe . I was doing this using .NET Core 3.1 and the Microsoft.Windows.Compatibility package. The transmission of the data between the processes worked great when I was just using two unpriviledged console apps. I started running into…

Swashbuckle generates incorrect Swagger API URL

I recently encountered an issue while using Swashbuckle whereby everything would work fine when running it locally but the deployed version would use incorrect API URLs. https://server.example.net/app/foo/bar?a=123 would become https://server.example.net/foo/bar?a=123 The issue seems to be caused by the fact that server.example.net is an API gateway. This seems to prevent Swashbuckle from…

Compound primary keys and NHibernate event listeners

Recently I had to write some code to log CUD operations done via NHibernate. The requirement was to log the following: The type of operation (insert, update, delete) The primary key property name(s) and value(s) of the entity being operated on For updates, the property name(s) and the old and new values It was pretty straightforward apart from retrieving the primary key. If the key is a scalar…

HashSet, IEquatable and Contains

I recently came across some unintuitive and confusing (but understandable) behaviour when dealing with HashSet<T> where T : IEquatable . I&rsquo;d written a class that implemented IEquatable based purely on the ID of the object. The trouble was that HashSet.Contains was saying that it didn&rsquo;t contain the object I was passing it even though it contained an object with the same ID. Here&rsquo;s…

Windows Store Error Code 0x80070005

I recently starting an issue where none of the programs I&rsquo;ve installed via the Windows Store would update. Specifically they&rsquo;d fail during the installation with an error code of 0x80070005 with no actual description of what the problem is (Microsoft still erroring like it&rsquo;s 1989 ). I searched all over the place but either I wasn&rsquo;t willing to try the solutions because they…

ASUS RT-N66U IPv6 with Merlin

In a previous post I described how to get IPv6 working on the ASUS RT-N66U using the stock firmware. I&rsquo;ve since switched to using the unofficial Merlin firmware. While the settings in the previous article still apply, Merlin has more settings exposed and, at least in my case, failing to change the Prefix Length from the default 64 to 56 left IPv6 in a broken state. This led to various…

Amazon Fire HD 8 System Apps on Home Screen

I recently got an Amazon Fire HD 8 tablet and for the most part it&rsquo;s been running fine. However, I encountered a weird and annoying issue where, all of a sudden, I had what seem to be system/hidden apps showing up on my Home screen. The apps in question were, IIRC, Device Setup , Downloads , Music , Kindle Store and maybe one more that I can&rsquo;t find/remember. The solution was to go to…

The Forgotten Ideas in Computer Science Notes

I recently watched Joe Armstrong&rsquo;s Code BEAM keynote talk about forgotten ideas in computer science and thought it would be useful to make some notes. They&rsquo;re mostly in the form of links to things that he mentions in his talk. The Talk The Tweets I’m interested in the forgotten ideas of computer science. Needed for a talk. Can you post examples of great CS ideas that have been largely…

ASUS RT-N66U IPv6

I&rsquo;m using an ASUS RT-N66U and my ISP is Aquiss (an Entanet reseller). I wanted to get IPv6 working. After a little bit of fiddling, the following settings seem to have done the trick: Connection type: Native Interface: PPP DHCP-PD: Enable Auto Configuration Setting: Stateless Connect to DNS Server automatically: Enable Enable Router Advertisement: Enable Hope this helps anybody else in the…

WHMCS Smarty {include} Not Working

I&rsquo;ve been using Smarty templates a bit recently while working with WHMCS and ran into an issue. When trying to do {include 'some_template.tpl'} , I was getting no output. Smarty seemed to just stop all processing at that point. The fix was maddeningly simple, especially as I&rsquo;d tried a bunch of different variations of absolute and relative paths. If your template is in a file called…

WHMCS 500 Error

While working on an addon module for WHMCS I kept getting a generic 500 error code and a blank page. I was pretty sure it was a problem in my code but there was nothing in the XAMPP error.log or the WHMCS admin dashboards so I had no way of tracking down the cause. I managed to finally track down the cause by enabling the Display Errors option under Setup → General Settings → Other .

OAuth for the Confused

While working on some code recently I ended up learning far more about OAuth than I ever wanted to know and so I thought I&rsquo;d share my pain with the Internet. This guide will cover OAuth 1.0a as that&rsquo;s what I&rsquo;ve been working with. OAuth is an open standard for access delegation, commonly used as a way for Internet users to grant websites or applications access to their information…

JavaScript Prototypes for the Confused

Objects can have a prototype and a prototype is just another object. We can get an object&rsquo;s prototype using the Object.getPrototypeOf method. Object. getPrototypeOf ({}); // → {} Yes, JavaScript really loves objects. It&rsquo;s objects all the way down. Actually that&rsquo;s not completely true: Object. getPrototypeOf (Object. getPrototypeOf ({})); // → null The first call to…

JavaScript Properties for the Confused

Like a lot of things related to JavaScript, the syntax and semantics of properties can be a little tricky to wrap your head around. Hopefully this article will serve to simplify and clarify things. Our first step is to do away with the idea of arrays. But wait, arrays are important, surely? Yes, but they&rsquo;re just conceptual baggage when it comes to understanding properties because arrays are…