Skip to content

Instantly share code, notes, and snippets.

View 0xcafed00d's full-sized avatar
👾
Pew. Pew. Pew.....

Lee Witek 0xcafed00d

👾
Pew. Pew. Pew.....
View GitHub Profile
@0xcafed00d
0xcafed00d / wsl2-usb-device-guide.md
Created April 22, 2026 23:21
How to Access a USB Device from WSL2

How to Access a USB Device from WSL2

If you use Windows Subsystem for Linux 2 (WSL2), you've probably noticed that USB devices do not automatically appear inside your Linux environment. That's by design: WSL2 runs in a lightweight VM, so direct hardware access works differently than it does on a native Linux machine.

The supported way to pass a USB device from Windows into WSL2 is with usbipd-win, a Windows tool that exposes USB devices to WSL over USB/IP.

This guide walks through the setup and shows how to attach, verify, and detach a USB device from WSL2.

When This Is Useful

@0xcafed00d
0xcafed00d / NETWORK_LATENCY_TESTING.md
Last active April 21, 2026 01:19
Linux Interface Latency Testing

Linux Interface Latency Testing

This is a general reference for introducing artificial network latency on Linux when testing how a protocol behaves as latency increases.

The standard tool is tc with the netem qdisc.

Overview

  • Egress delay on an interface is straightforward with tc netem.
  • Ingress delay is usually handled by redirecting ingress traffic to an ifb device and applying netem there.
@0xcafed00d
0xcafed00d / readme.md
Created April 17, 2026 11:05 — forked from scholtes/readme.md
Wordle dictionary

Deprecated!

⚠This gist will remain available for posterity, but be aware that Wordle no longer uses these dictionaries.⚠

Wordle dictionary

Wordle is a web browser game that you can play at this link. You get 6 chances to guess a single 5 letter word and there is only 1 word per day.

@0xcafed00d
0xcafed00d / git-multiple-hosts-and-ssh-keys.md
Last active April 20, 2026 19:49
Git With Multiple Hosts and Multiple SSH Keys

Git With Multiple Hosts and Multiple SSH Keys

This guide shows a clean way to use Git with:

  • multiple Git hosting services such as GitHub and GitLab
  • different SSH keys for each host
  • different Git email addresses per host or account

All examples use placeholder names only. Replace them with your own hostnames, paths, usernames, and email addresses.

@0xcafed00d
0xcafed00d / fun_with_variants.cpp
Created November 24, 2023 02:31
fun with variants
#include <variant>
#include <string>
#include <iostream>
#include <array>
struct A {
int a = 5;
char b[100];
};
MEMPTR, esoteric register of the ZiLOG Z80 CPU.
by Boo-boo (first and draft English translation by Vladimir Kladov)
As it is known, after the instruction BIT n,(HL) execution, bits 3 and 5 of the flag register become containing values that is not documented in the official documentation at all. Actually these bits are copied from the bits 11 and 13 of the internal register pair of Z80 CPU, which is used for 16-bit operations, and in most cases to handle addresses. This is usual practice for processors having 8-bits data bus working with 16-bits data.
It is not known why and how these bits of the internal buffer register are copied to the flags register though. At least Sean Young in the "Undocumented Z80 Documented" refers to that phenomenon (http://www.myquest.nl/z80undocumented/) and a bit more info can be found in the Z80 description of another "nocash" project (http://www.work.de/nocash/zxdocs.htm) where such register pair is called as MEMPTR. Unfortunately until now attemts to crack the algorithm se
Dust. Facing Worlds. E2M1. Blood Gulch. You know these places
@0xcafed00d
0xcafed00d / git-submodules.md
Created December 19, 2018 14:00 — forked from slavafomin/git-submodules.md
Git submodules best practices

Git submodules best practices

Useful commands

— Clone repository with submodules automatically:

git clone --recursive git@github.com:name/repo.git

— Initialize submodules after regular cloning:

@0xcafed00d
0xcafed00d / README
Created October 11, 2018 11:36 — forked from bert/README
Bresenham Algorithms in C
Some possible implementations of the Bresenham Algorithms in C.
The Bresenham line algorithm is an algorithm which determines which points in an
n-dimensional raster should be plotted in order to form a close approximation
to a straight line between two given points.
It is commonly used to draw lines on a computer screen, as it uses only integer
addition, subtraction and bit shifting, all of which are very cheap operations
in standard computer architectures.
It is one of the earliest algorithms developed in the field of computer graphics.
A minor extension to the original algorithm also deals with drawing circles.
@0xcafed00d
0xcafed00d / zx81 rom listing
Created December 12, 2017 20:30
zx81 rom listing
; ===========================================================
; An Assembly Listing of the Operating System of the ZX81 ROM
; ===========================================================
; -------------------------
; Last updated: 13-DEC-2004
; -------------------------
;
; Work in progress.
; This file will cross-assemble an original version of the "Improved"
; ZX81 ROM. The file can be modified to change the behaviour of the ROM