Skip to content

Instantly share code, notes, and snippets.

@mataha
mataha / mrs-tables.markdown
Last active August 16, 2016 00:08
A brief description of standard MRS tables. If you're looking at this, you probably know what this is for.

MRS tables

First swap

[0x03, 0x05, 0x0A, 0xD2]

First table

@mataha
mataha / 8level-wrt150a-default.conf
Last active August 16, 2016 02:49
Default configuration file for 8level's WRT-150A router (V1.2.19122).
# 8level-wrt150a-default.conf
# Firmware version: 1.2.19122
# Username: admin
# Password: admin
NETWORK_TOOL 1
IP_URL ""
COUNT 4
PKT_SIZE 64
TIME_OUT 1000
TTL 20

Touhou fonts

Open fonts

Web support

[Reimu Roman] [Marisa Regular] [Yuyuko Script]
@mataha
mataha / extract.diff
Last active May 9, 2021 04:19
Touhou Music Room 2.3.0 patch
diff --unified a/musicroom/extract.cpp b/musicroom/extract.cpp
--- a/musicroom/extract.cpp
+++ b/musicroom/extract.cpp
@@ -8,6 +8,14 @@
#include <math.h>
+#if __cplusplus > 201703L
+# include <numbers>
+ static constexpr double PI = std::numbers::pi_v<double>;
@mataha
mataha / players.py
Last active May 16, 2021 16:57
GunZ server population scraper
#!/usr/bin/env python3
# To the extent possible under law, mataha has waived all
# copyright and related or neighboring rights to this file,
# as it is written in the following disclaimers:
# - https://unlicense.org/
# - https://creativecommons.org/publicdomain/zero/1.0/
import argparse
import pathlib
@mataha
mataha / protocol.txt
Created May 16, 2021 09:06
GunZ locator protocol example
Example locator request and response (International GunZ).
Note that some servers would send slightly different responses, e.g. Freestyle
GunZ (response from FGunZ would include some additional fields, e.g. server
description - I don't know if it's 1.5 source specific).
Everything is in little-endian order unless specified.
@mataha
mataha / metrics.c
Last active June 8, 2021 22:16
Windows system metrics
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#define print_metric(metric) \
do \
{ \
printf("%s: %d\n", #metric, GetSystemMetrics(metric)); \
} while (0)
@mataha
mataha / d2rwlist.txt
Last active April 27, 2022 16:42
Diablo II Resurrected - wantlist
~*~ Mataha's Diablo II: Resurrected wantlist ~*~
~*~ All of the items here are nonladder only ~*~
Expansion
=========
Runes
-----
HRs. Lots of them. But mostly Bers.
/*
* conredir, a hack to get working console IO with Windows GUI applications
*
* Copyright (c) 2013, Martin Herkt
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
;(function () {
function getRandomWaifu() {
return "Ai Hayasaka";
}
const name = window.prompt("Type your character's name:", getRandomWaifu());
if (!name) {
alert("Invalid character name.");
return false;