Skip to content

Instantly share code, notes, and snippets.

@Tilka
Tilka / extract_hvqm2_videos_from_z64.py
Created November 13, 2019 01:40
Python script to extract all HVQM2 videos from *.z64 files
#!/usr/bin/env python3
import struct
import sys
rom = open(sys.argv[1], 'rb').read()
pos = 0
while True:
i = rom.find(b'HVQM2 1.0', pos)
if i == -1:
@Tilka
Tilka / evdev_close_slow.c
Created October 6, 2018 17:03
for some reason closing evdev file descriptors takes ~30 ms on my laptop :/
#include <fcntl.h>
int main()
{
// leak 100 file descriptors, on exit the kernel will close them in one go
for (int i = 0; i < 100; ++i)
open("/dev/input/event0", O_RDONLY);
}
@Tilka
Tilka / pre-receive
Last active December 13, 2015 20:28
#!/usr/bin/env python
import sys
import os
import subprocess
import tempfile
def system(args, **kwargs):
environ = os.environ.copy()