Skip to content

Instantly share code, notes, and snippets.

View marcan's full-sized avatar

Hector Martin marcan

View GitHub Profile
// Get the sample here: https://mrcn.st/t/a_duck.wav
// This is what it sounds like: https://soundcloud.com/marcan42/deep-duck
s = Server.local;
"SC_JACK_DEFAULT_OUTPUTS".setenv("system:playback_1,system:playback_2");
s.waitForBoot({
b = Buffer.read(s,"a_duck.wav");
@marcan
marcan / flipvideo.py
Created December 30, 2015 16:55
Video player for the 32c3 flip-dot display
#!/usr/bin/python2
import sys, ffms, time, socket
import numpy as np
source_file = sys.argv[1]
# Output one out of every N frames
framedrop = 18
# Input video FPS (hardcoded)
fps = 30
@marcan
marcan / decode_deresute.md
Last active April 22, 2016 01:55
Unity texture resource decoder/converter (for デレステ)
@marcan
marcan / decimate264.py
Created September 12, 2017 18:42
Two h.264 framerates for the price of one
#!/usr/bin/python3
import sys
KEYINT = 30
# Encode your input like this (example):
# x264 --crf 20 --keyint 30 --min-keyint 30 --bframes 1 --no-b-adapt <input> -o <output.h264>
# Produces display order IBPBPBP...BPBPP|IBPBPBP...BPBPP|...
# Decoding (file) order IPBPBPB...PBPBP|IPBPBPB...PBPBP|...
#!/usr/bin/python
import detect
# Original constants
primes = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101,
103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167]
prints = [6, 30, 126, 1026, 5658, 107286, 199410, 8388606, 536870910, 2147483646, 67109890, 2199023255550,
8796093022206, 140737488355326, 5310023542746834, 576460752303423486, 1455791217086302986,
147573952589676412926, 20052041432995567486, 6041388139249378920330, 207530445072488465666,
#!/usr/bin/python
import struct, sys
mfts = """
c00004f0
2067334f0
114e7d24f0
26496944f0
26f39174f0
@marcan
marcan / glibc-2.29-reiwa.patch
Created April 1, 2019 08:44
glibc-2.29 patch to add the Reiwa (令和) era
--- glibc-2.29/localedata/locales/ja_JP.old 2019-04-01 17:26:52.808154026 +0900
+++ glibc-2.29/localedata/locales/ja_JP 2019-04-01 17:38:48.872822551 +0900
@@ -14946,7 +14946,9 @@
t_fmt_ampm "%p%I<U6642>%M<U5206>%S<U79D2>"
-era "+:2:1990//01//01:+*:<U5E73><U6210>:%EC%Ey<U5E74>";/
+era "+:2:2020//01//01:+*:<U4EE4><U548C>:%EC%Ey<U5E74>";/
+ "+:1:2019//05//01:2019//12//31:<U4EE4><U548C>:%EC<U5143><U5E74>";/
+ "+:2:1990//01//01:2019//04//30:<U5E73><U6210>:%EC%Ey<U5E74>";/
#!/usr/bin/env python3
import time, math, threading, struct, sys, os.path, random
import obswebsocket, obswebsocket.requests
client = obswebsocket.obsws("localhost", 4444)
client.connect()
source_patterns = [
"RTMP", "JACK", "AUX"
]
#!/usr/bin/python
import sys
from construct import *
LoadCmdType = "LoadCmdType" / Enum(Int32ul,
UNIXTHREAD = 0x05,
SEGMENT_64 = 0x19,
UUID = 0x1b,
BUILD_VERSION = 0x32,
DYLD_CHAINED_FIXUPS = 0x80000034,
From 82f995d4e164795c69a3c67be44eacfa8f5c3c14 Mon Sep 17 00:00:00 2001
From: Hector Martin <marcan@marcan.st>
Date: Fri, 5 Feb 2021 05:34:10 +0900
Subject: [PATCH 00/18] Apple M1 SoC platform bring-up
To: Hector Martin <marcan@marcan.st>
To: soc@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Marc Zyngier <maz@kernel.org>
Cc: robh+dt@kernel.org
Cc: Arnd Bergmann <arnd@kernel.org>