Skip to content

Instantly share code, notes, and snippets.

@matthen
matthen / hello_world.py
Last active April 23, 2024 22:13
Hello world in python, using genetic algorithm
"""Hello world, with a genetic algorithm.
https://twitter.com/matthen2/status/1769368467067621791
"""
import random
import time
from dataclasses import dataclass
from itertools import chain
from typing import Iterable, List
#!/bin/sh
# Download youtube-dl from github
dirname="youtube-dl"
git clone --depth=1 https://github.com/github/dmca "$dirname"
cd "$dirname"
git fetch origin pull/8142/head
git branch youtube-dl 416da574e
git checkout youtube-dl
@BusterNeece
BusterNeece / 00-setup.md
Last active August 12, 2022 04:32
My WSL2 Ubuntu 20.04 Environment

My local Ubuntu 20.04 WSL2 setup.

Enable and Install WSL2

From Windows, as admin:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
@plembo
plembo / win10-corrupt-reg-audio-drivers.md
Last active July 14, 2023 00:26
Corrupted registry borks audio on Windows 10

Corrupted registry borks audio on Windows 10

WARNING: Proceed with caution, or at least in the presence of a former desktop engineer having 25 years or so of experience with Windows systems (like a Windows NT 3.51 era MCSE).

My son the game developer tried using a (very) old Logitech eyeball webcam on Windows 10 yesterday. After plugging it in he obediently rebooted when prompted by the O/S.

This, it turns out, was a mistake.

For the next couple of hours we struggled mightily with the system to get audio working again. Initially, Device Manager barked "Code 39" when we examined each audio device (Realtek HD, a USB mic and NVIDIA card audio). After several attempted re-installs and upgrades of drivers for each device (my erroneously diagnosing the problem as having to do with outdated Realtek audio drivers), he found a couple of links that provided a way out that didn't involve re-imaging the machine.

Windows Core Isolation

@matthewzring
matthewzring / markdown-text-101.md
Last active April 24, 2024 18:43
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active April 19, 2024 12:30
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@mondain
mondain / public-stun-list.txt
Last active April 22, 2024 08:55
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@willurd
willurd / web-servers.md
Last active April 25, 2024 09:21
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: