How to use [InternalsVisibleTo] attribute in .NET SDK projects

Introduction Often you want to test internal methods of a class library you are using - this could be because you have internal helper methods that you would like to test in isolation, i.e. proper unit tests. Before .NET SDK project type was introduced the way to do this was to add a line to the AssemblyInfo.cs file: [assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("MyLibrary.Tests")] This would allow your MyLibrary.Tests project to see and access internal methods/properties etc.
Read More…

dnsmasq PXE Server setup on Rocky Linux 8.5

Introduction When installing many machines - that being bare-metal or virtual machines - automation comes to mind - and to that PXE booting and installing via the network is awesome. This requires that you have a PXE server configured and configuration files on that server that tells clients how to install. I am using dnsmasq, which is an awesome piece of software that also is running as a DHCP server on my network.
Read More…

.NET decimal serialization with protobuf

Introduction When working with .NET and financial data, then its very common that the decimal type is used, since it is precise and does not lose information when you do calculations. i.e. take the following code: var x = 3.999999999999999d; Console.WriteLine(x); var result = x+x; Console.WriteLine(result); You would assume the result would be 7.999999999999998 - but in fact it will print out 4 - which for all intends and purposes is okay for most usages - but if you require precision on all decimal places, double is not good enough because the datatype cannot represent the precision correctly.
Read More…

Script to migrate VMWare ESXi Virtual machine to Proxmox VE 7.1

Introduction Migrating virtual machines between platforms can be a pain in the ass to put it mildly. I have recently decided to migrate from ESXi to Proxmox VE, simply because it allows me downscale my lab from several “BIG” machines into a single machine. When converting a lot of VM’s from ESXi to Proxmox VE I basically had to write the same commands over and over in the same sequence.
Read More…

Backing up proxmox backup with rsync and rclone

Introduction I recently started using proxmox in my homelab instead of using VMWare ESXi - this lead me to Proxmox Backup Server since it allows delta backups like my previous backup solution for ESXi. With my old backup solution I backed up my “backup” to the cloud to my provider rsync which simplied is just a ssh connection where they have enabled certain programs to run and the underlying storage they use is ZFS.
Read More…

Configure static ip address on Debian/Ubuntu/Centos/Rocky Linux

Introduction When installing linux usually the installation defaults to DHCP for networking, which is perfectly fine if you are running a desktop machine. But if you install on a server you expect to have consistent addressing in place so it is possible to set up a name server and point a hostname towards your servers ip-address. This can be solved in several ways: Static IP DHCP with dynamic update of DNS Server DHCP assigned address that is fixed to the MAC Address of the network card This post will only be about setting up a static ip address, since that is the easiest solution and probably the solution that most people would want to use.
Read More…

Proxmox VE 7 replace zfs boot disk

Introduction Everything dies, even enterprise hardware. This is why having a failover is a good thing. I am running my Proxmox VE 7 servers with a mirrored ZFS root pool, so I can protect myself against a single drive dying and taking down a proxmox server. Today I received 8 SATADOM’s that I wanted to use for my boot drives intead of my SATA disks that were tiny and slow.
Read More…

Kubernetes simplified backup

Introduction Backup is important unless you like to spend a lot of time recreating what was lost - if possible. My kubernetes cluster is mostly stateless, with any state stored outside of the cluster on dedicated storage. So to facilitate backup of the cluster I initially started doing full machine backups of all nodes, but that seemed silly since I can recreate a node in 5-10 minutes with my PXE setup that boots and installs Rocky Linux plus all the required prequisites to allow the machine to work as a kubernetes node.
Read More…

Migrate VMWare ESXi Virtual machine to Proxmox VE 7.1

Introduction Migrating virtual machines between platforms can be a pain in the ass to put it mildly. I have recently decided to migrate from ESXi to Proxmox VE, simply because it allows me downscale my lab from several “BIG” machines into a single machine. I am well aware that this makes my lab more fragile and prone to failures, but that is a price I am willing to take - at least for now.
Read More…

Anacron email setup on CentOS 8/Rocky Linux 8

Introduction When you have a cron job that runs, then sometimes you want the cron process to send an email, in case something goes wrong or if you have set your cronjob to produce output. This happens automatically if your system is configured correctly, but if you like me just install a vanilla CentOS or Rocky and expect stuff like this to work, you have a couple of small extra tasks to perform.
Read More…