Skip to content

Instantly share code, notes, and snippets.

View mwsealey's full-sized avatar
😺

Matt Sealey mwsealey

😺
View GitHub Profile
@gdamjan
gdamjan / README.md
Last active October 6, 2025 04:50
Replace grub2 with systemd-boot on Ubuntu 22.04
  1. remove grub
apt purge --allow-remove-essential grub2-common grub-pc-bin grub-pc grub-gfxpayload-lists grub-efi-amd64-bin grub-efi-amd64-signed grub-common os-prober shim-signed libfreetype6 
apt-get autoremove --purge
rm -rf /boot/grub/
rm -rf /boot/efi/EFI/ubuntu
  1. make sure it's not installed back
    • apt-mark hold "grub*"
  2. install systemd-boot
@mizhi
mizhi / single-method-dispatch-on-__init__.md
Last active January 31, 2025 04:04
singledispatchmethod on __init__

I've been doing a bit of refresher on Python, learning about the new capabilities added in Python 3.

Tonight, I learned about @singledispatchmethod alongside typehinting.

You can use it wth __init__ on classes. Honestly, there's no reason why that shouldn't be the case since object allocation and initialization are separated in Python. But it's still nice to confirm.

from functools import *

class Foo:

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Manual Configuration

Set Interface Metrics

anonymous
anonymous / patch.pmuirq
Created December 18, 2012 05:44
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index ab243b8..cb1d8e8 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -20,7 +20,7 @@
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
-
+#include <linux/irq.h>