Skip to content

Instantly share code, notes, and snippets.

View Sanae6's full-sized avatar

Aubrey Sanae6

  • 18:37 (UTC -06:00)
View GitHub Profile
@rajsinghtech
rajsinghtech / ts-networkns-isolation.md
Last active June 7, 2026 22:32
Running Tailscale in a Network Namespace

Running Tailscale in a Network Namespace

Isolate Tailscale to specific interfaces using Linux network namespaces.

Two Approaches

Macvlan (Bare Metal)

Creates virtual interface with its own MAC on the physical NIC. Simpler, no NAT. Best for bare metal where you control the network.

{
unique_lock lock(mutex); // takes the lock
convar.wait(mutex) // wait
// do stuff with the lock
}
// the lock is no longer held
@XtraCube
XtraCube / C.cs
Last active June 10, 2025 13:22
tiny region API
/*CC0*/using System.Linq;using S=ServerManager;[HarmonyLib.HarmonyPatch(typeof(S),"LoadServers")]class C{static System.Collections.Generic.List<IRegionInfo>R=S.DefaultRegions.ToList();static void Prefix()=>S.DefaultRegions=R.ToArray();public static void A(string N,string I,ushort P)=>R.Add(new DnsRegionInfo(I, N, (StringNames)1003, I, P).Duplicate());}
@lukewestby
lukewestby / findMidiDevices.js
Created October 11, 2015 20:40
Get MIDI input and output devices from the Web MIDI API by name
function findMidiDevices(name) {
return navigator
.requestMIDIAccess()
.then((midiAccess) => {
let input, output;
midiAccess.inputs.forEach((currentInput) => {
if(currentInput.name === name) input = currentInput;
});
midiAccess.outputs.forEach((currentOutput) => {
if(currentOutput.name === name) output = currentOutput;
@metaphox
metaphox / DCPU-16Spec.txt
Created October 14, 2012 09:40
DCPU-16 Specification
DCPU-16 Specification
Copyright 1985 Mojang
Version 1.7
=== SUMMARY ====================================================================
* 16 bit words
* 0x10000 words of ram