Skip to content

Instantly share code, notes, and snippets.

View milkey-mouse's full-sized avatar

Milkey Mouse milkey-mouse

View GitHub Profile
@milkey-mouse
milkey-mouse / shitty heat calculator.py
Last active March 10, 2017 00:52
it does what it says on the tin
form_consts = {
"ice": {
"temp": 0.0,
"c": 2.06,
"water": 334.0
},
"water": {
"temp": 100.0,
"c": 4.184,
"ice": -334.0,
from xml.dom.minidom import parse, parseString
fp = r"C:\Program Files (x86)\Steam\SteamApps\common\Besiege\Besiege_Data\SavedMachines\binch.bsg"
dom = parse(fp)
nummemes = 0
for block in dom.getElementsByTagName("Block"):
if block.attributes["id"].value == "59":

Keybase proof

I hereby claim:

  • I am milkey-mouse on github.
  • I am milkeymouse (https://keybase.io/milkeymouse) on keybase.
  • I have a public key ASDRUlPSIyzYAQEDtYBxrmBz2btOTYQfung2aGYFeVxdmAo

To claim this, I am signing this object:

@milkey-mouse
milkey-mouse / README.md
Last active October 14, 2017 22:52
back up a full image of a libvirt-based VM while it's running
@milkey-mouse
milkey-mouse / charset.patch
Last active August 16, 2017 05:03
Set the charset of all text MIME-typed requests to utf-8 (hacky)
Index: server_http.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/server_http.c,v
retrieving revision 1.117
diff -u -p -r1.117 server_http.c
--- server_http.c 15 May 2017 10:40:47 -0000 1.117
+++ server_http.c 18 Jul 2017 02:51:19 -0000
@@ -1388,7 +1388,8 @@ server_response_http(struct client *clt,
/* Set media type */
START 34.38152 39.70302
MOVE 34.38152 39.70302
MOVE 34.37993 39.70004
MOVE 34.37515 39.69118
MOVE 34.36719 39.67657
MOVE 34.35603 39.65633
MOVE 34.34169 39.63058
MOVE 34.32415 39.59944
MOVE 34.30342 39.56303
MOVE 34.27949 39.52149
@milkey-mouse
milkey-mouse / apt-examine.sh
Created August 5, 2017 18:54
Script to download an APT package and view its control file
#!/bin/bash
set -euo pipefail
TMPDIR=""
function cleanup {
[[ ! -z $TMPDIR ]] && rm -r "$TMPDIR"
}
trap cleanup EXIT
$ ./gradlew build --stacktrace
Incremental java compilation is an incubating feature.
Skipping debug jar:microg-ui-tools:preBuild UP-TO-DATE
:microg-ui-tools:preDebugBuild UP-TO-DATE
:microg-ui-tools:checkDebugManifest
:microg-ui-tools:preDebugAndroidTestBuild UP-TO-DATE
:microg-ui-tools:preDebugUnitTestBuild UP-TO-DATE
:microg-ui-tools:preReleaseBuild UP-TO-DATE
:microg-ui-tools:preReleaseUnitTestBuild UP-TO-DATE
:microg-ui-tools:prepareComAndroidSupportAnimatedVectorDrawable2531Library
@milkey-mouse
milkey-mouse / Makefile
Last active February 12, 2018 06:22
crtbegin.c and crtend.c for alpine2gentoo (BSD-licensed)
# Makefile for musl-clang crt's
all:
clang -fPIC -c crtbegin.c -o /usr/lib/crtbegin.o
ln -s /usr/lib/crtbegin.o /usr/lib/crtbeginS.o
ln -s /usr/lib/crtbegin.o /usr/lib/crtbeginT.o
clang -fPIC -c crtend.c -o /usr/lib/crtend.o
ln -s /usr/lib/crtend.o /usr/lib/crtendS.o
ln -s /usr/lib/crtend.o /usr/lib/crtendT.o
clean:
@milkey-mouse
milkey-mouse / clang-nongnu.patch
Last active April 8, 2018 05:28 — forked from jstraarup/nongnu.patch
Make clang sanitizers ( sys-libs/compiler-rt-sanitizers-6.0.0 ) compile with musl
diff -ruN compiler-rt-6.0.0.src/lib/asan/asan_linux.cc compiler-rt-6.0.0.src-musl/lib/asan/asan_linux.cc
--- compiler-rt-6.0.0.src/lib/asan/asan_linux.cc 2018-02-07 20:51:13.000000000 +0100
+++ compiler-rt-6.0.0.src-musl/lib/asan/asan_linux.cc 2018-03-20 11:57:12.381740075 +0100
@@ -46,7 +46,7 @@
#include <link.h>
#endif
-#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS
+#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU
#include <ucontext.h>