Skip to content

Instantly share code, notes, and snippets.

View mwsealey's full-sized avatar
😺

Matt Sealey mwsealey

😺
View GitHub Profile
@bahamas10
bahamas10 / termcap.bash
Last active June 18, 2026 16:20
Colorize Manpages on the Terminal
# annotated by dave eddy (@yousuckatprogramming)
# explained - https://youtu.be/D0sG2fj0G4Y
# borrowed heavily from https://grml.org
# Begin blinking text mode
# I just use bold red here since my terminal has blinking disabled
export LESS_TERMCAP_mb=$'\e[1;31m'
# Begin bold text mode
export LESS_TERMCAP_md=$'\e[1;31m'
@DamianPala
DamianPala / wsl_as_a_service.md
Last active February 8, 2026 17:05
WSL as a service with SSH access

WSL as a service with SSH access

In this tutorial, we will configure a Windows Linux subsystem that will automatically start when the system boots without requiring a user to log in. WSL is started like a daemon, without opening a terminal. It will be easily accessible via SSH.

Features

  1. WSL started as a service
  2. No user login needed
  3. No WSL terminal visible after login
@gdamjan
gdamjan / README.md
Last active May 18, 2026 08:26
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

@vsajip
vsajip / pyvenvex.py
Last active April 3, 2026 16:35
A script which demonstrates how to extend Python 3.3's EnvBuilder, by installing setuptools and pip in created venvs. This functionality is not provided as an integral part of Python 3.3 because, while setuptools and pip are very popular, they are third-party packages.The script needs Python 3.3 or later; invoke it using"python pyvenvex.py -h"fo…
#
# Copyright (C) 2013-2020 Vinay Sajip. New BSD License.
#
import os
import os.path
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve
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>