Tokio: receive variable-sized data from a UdpSocket

Imagine you're listening on a tokio::net::UdpSocket and you know you're going to receive a packet, but don't know the size. The first option was to find out what the other party might send, but that i…

· 1 minute reading time

Ubuntu 24.04: disable systemd-resolved's stub listener

I'm rebuilding my server and I need to make sure the server itself does not listen to port 53 as we'll be hosting a Docker container with AdGuard on port 53. To do that we need to disable systemd-reso…

· 1 minute reading time

You cannot disable rDNS (IPv6) nameservers with netplan

I am playing with IPv6 and wanted to statically configure /etc/resolv.conf's nameservers. I wanted to avoid getting any from the Router, even though I wanted an IPv6 address through SLAAC. First try S…

· 2 minutes reading time

How to use Wireguard without Masquarade

For a while now I've been running linuxserver.io's Docker container of Wireguard to be able to get access to my home network when I'm on the go. Initially, we had a network for the computers at home, …

· 2 minutes reading time

.NET: Disabling SSL Certificate validation

Yesterday I wanted to download some content off a website with F#, however unfortunately the certificate of the website was expired. let result = try let request = "https:…

· 2 minutes reading time

Be careful with npm shrinkwrap

Recently we had the issue that we used version x of an npm package. However in the course of time this package was updated by the author and contained a critical bug, which broke our AWS deployments. …

· 2 minutes reading time

DynamoDb & updating objects: it doesn't react like SQL!

Today I stumbled upon the following bug: We had an object with some properties that we wanted to update, but only if a certain property of that object is not set, i.e. it should be null. { "I…

· 2 minutes reading time

AWS & Encryption keys: Revert manually edited policy

Since we've been working with AWS we sometimes did stuff that, after looking back on it, wasn't the best approach. One of those things was manually applying Key Policies on Encryption Keys. It current…

· 3 minutes reading time

Topshelf install, PowerShell and Get-Credentials

In the project I'm currently working at we use PowerShell script for configuration and build execution. This means that if you get a new laptop, or a new member joins the team, or even when you need t…

· 2 minutes reading time

When frameworks try to be smart, AngularJS & Expressions

One of my colleagues just discovered this bug/feature in AngularJS. Using an ngIf on a string "no" will result in false. HTML: <div ng-app> <div ng-controller="yesNoController"&…

· 1 minute reading time

Enabling dynamic compression (gzip) for WebAPI and IIS

A lot of code on the internet refers to writing custom ActionFilters, or even HttpHandlers that will compress your return payload for you. For example, see this package (which with its name implies th…

· 1 minute reading time

Update on handedness (menu location)

A while back I wrote how to change the handedness (which seems to be the correct term, instead of the dreadful 'Menu on the wrong side with a touch screen'). I got a machine in my hands which exhibite…

· 1 minute reading time

The impact of SqlDataReader.GetOrdinal on performance

I recently had a discussion about the impact of SqlDataReader.GetOrdinal on execution of a SqlClient.SqlCommand. I then decided to run some code to measure the difference, because I think that's the o…

· 3 minutes reading time

Menu on the wrong side with a touch screen?

When you're reading this you probably have a touch screen. So, I never use my touch screen. Almost never. But I did notice that by default my menus in Windows (from a menu bar, not a ribbon) appear (w…

· 1 minute reading time

TransactionScope & SqlConnection not rolling back? Here's why...

A while back we ran into an issue with one of our projects where we executed a erroneous query (missing DELETE statement), and then left the database in an inconsistent state. Which is weird, consider…

· 2 minutes reading time

About a dictionary, removing and adding items, and their order.

I had a weird problem today using a Dictionary. The process involved removing and adding data, and then printing the data. I assumed that it was ordered. I was wrong! Let me show you: var dictionary =…

· 2 minutes reading time

Default values and overloads are not the same!

Consider the following class of the Awesome(r) library, using default parameters. public class Foo { public void DoCall(int timeout = 10) { /* awesome implementation goes here */ }…

· 1 minute reading time

Make sure unattended.xml is not encrypted!

I was playing around with Sysprep using unattended.xml when I hit a weird issue with VirtualBox and Encrypted folders on the host. Setup: unattended.xml on the host, encrypted (with Windows EFS). Vir…

· 2 minutes reading time

C# 5.0 spec is available online now!

A few posts ago I blogged about C# 5.0 and foreach. I mentioned a part of the docs, but those weren't online yet! They are now! http://www.microsoft.com/en-us/download/confirmation.aspx?id=7029 Enjoy …

· 1 minute reading time

When using an enum in PowerShell, use the member's name, not the member's value

Consider the following enum in C#: enum State { Started, Stopped, Unknown } Note that I have not added an explicit value for the enum members. They will be generated by the compiler. As st…

· 2 minutes reading time