Skip to content

Instantly share code, notes, and snippets.

View twilligon's full-sized avatar

twilligon

View GitHub Profile
@twilligon
twilligon / procps-nongnu.patch
Created April 8, 2018 05:29
Patch for gentoo clang/musl sys-process/procps
diff --git a/proc/numa.h b/proc/numa.h
index c198d9d..1b2b4eb 100644
--- a/proc/numa.h
+++ b/proc/numa.h
@@ -22,7 +22,9 @@
#include <features.h>
-__BEGIN_DECLS
+#ifdef __cplusplus
@twilligon
twilligon / 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>
@twilligon
twilligon / 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:
$ ./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
@twilligon
twilligon / 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
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
@twilligon
twilligon / 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 */
@twilligon
twilligon / README.md
Last active October 14, 2017 22:52
back up a full image of a libvirt-based VM while it's running
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":
@twilligon
twilligon / 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,