Skip to content

Instantly share code, notes, and snippets.

View qguv's full-sized avatar
vibing

Quint Guvernator qguv

vibing
View GitHub Profile
@qguv
qguv / basics.scm
Last active December 29, 2020 23:18
; this can be evaluated at https://inst.eecs.berkeley.edu/~cs61a/fa14/assets/interpreter/scheme.html
(define
(square x)
(* x x)
)
(define
(range start length)
(if
@qguv
qguv / template.sh
Created December 17, 2020 13:35
Simple template renderer in POSIX sh
#!/bin/sh
# see https://serverfault.com/a/699377 and https://serverfault.com/a/925072
PROG=$(basename $0)
usage() {
echo "${PROG} <template-file> [config-file]"
}
expand() {
@qguv
qguv / GMSE01.ini
Created October 23, 2020 23:42
Dolphin Emulator settings for Super Mario Sunshine (GameCube, NTSC, USA)
# Dolphin game-specific settings for: Super Mario Sunshine (GameCube, NTSC, USA)
# https://wiki.dolphin-emu.org/index.php?title=Super_Mario_Sunshine
[Core]
# Avoids crashing after long periods of play
SyncGPU = True
[Video_Enhancements]
@qguv
qguv / example.com.conf
Created July 29, 2020 13:00
nginx host static files, add trailing slash when using implicit index.html, preserve anchors and queries
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com;
# ends in slash
location ~ /$ {
root /var/www/example.com;
try_files $uri/index.html =404;
}
@qguv
qguv / example.com.conf
Created July 29, 2020 12:43
nginx host static files, add trailing slash when using implicit index.html, preserve anchors and queries
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com;
# ends in slash
location ~ ^([^#?]*/)([#?].*)?$ {
root /var/www/example.com;
try_files $1/index.html =404;
}
@qguv
qguv / install_bubbleupnp.sh
Last active March 11, 2021 09:00
Install BubbleUPnP on CoreELEC/LibreELEC/OpenELEC
#!/bin/sh
set -e
jre_url='https://cdn.azul.com/zulu-embedded/bin/zulu8.46.0.225-ca-jdk8.0.252-linux_aarch32hf.tar.gz'
jre_sha1sum=ac884e478a58db9aa3c109d2d43b819504ba6969
jre_dest=/storage
bubbleupnp_url='https://bubblesoftapps.com/bubbleupnpserver/BubbleUPnPServer-distrib.zip'
bubbleupnp_sha1sum=ac87fe841b407413c35b1bfe06ee572fbe1c81d8
bubbleupnp_dest=/storage/bubbleupnp
@qguv
qguv / Makefile
Created June 26, 2020 18:15
Makefile for ras52/bootstrap (WIP)
.DEFAULT_GOAL := stage-3/ld
ELF_BIN := stage-1/elfify
BIN := stage-1/unhexl stage-2/as stage-3/ld stage-3/test1 stage-3/test2 stage-3/test3
stage-0/_unhex: stage-0/unhex.x
$(info #1)
printf $$(printf '\\x%s' $$(<$<)) >$@
chmod u+x $@
@qguv
qguv / onpremise-proxy-test.sh
Last active July 8, 2022 02:09
Prepare LXD container which can only access the internet through an http proxy (uses tinyproxy and firewalld). Written for Fedora 31, but will probably work elsewhere too.
#!/bin/bash
set -e
create_container="${create_container:-true}"
lxd_bridge="${lxd_bridge:-lxdbr0}"
container_image="${container_image:-images:debian/8/amd64}"
container_name="${container_name:-onpremise-proxy-test}"
tinyproxy_conf="${tinyproxy_conf:-/etc/tinyproxy/tinyproxy.conf}"
sudo_conf="${sudo_conf:-/etc/sudoers.d/client}"
apt_conf="${apt_conf:-/etc/apt/apt.conf.d/proxy.conf}"
@qguv
qguv / THIN
Last active December 13, 2020 16:44
hackerhotel clue
Tm8sIG5vLCBubywgdGhhdCB3b3VsZCBiZSB0b28gZWFzeSwgaGF2ZSB5b3UgcmVhZCB0aGUgbm90ZSBpbiByb29tIDIwMz8KCgoK TSTCTKCTL1KSOTBBJEzCRUCULzBEU0NDJFdQVKCJLjBBUiTVSWVgKF9UJVwkJEBWVSqZL1VgN0WSJTBMTEMhT05EXSTQTcVgN0iPAFNHWUpFIWiFLGAyUUMvIWGOJDBRU1UCSEdFLUCJAFFFJFFQIWeMIVQyXU9NJEFCTMVgNFhBVyTHQNJuAFkyRU0yT0VIWCTJT1FVQMeFUllGJFJJRKCNIWNMSVAhQ0zCTMKFMj4gOV9VAF5FJVQyWE8yWENNTUCSITBMTEMLTcGNJTBHSiTOWKCBJGZXVlFCUdlgIV5EAFhXJFvKTWxgK05QVqCXKFFMJFJQIWSPDhpBJEzCVcVgKFlWSENPIXSIJTBGRU1XJEdPIXSIJTBGU05PJ1KBLRoCWU5YU1JMWU5TWENNWKCSITBARVEhQcWFLjBNUkJGUaCBAGNISUpNIWGOJDBVRU4CUk9MJEzGTXBgNWMyWU5MTUohVWiFAGNISUpNIWmTAFJKU0tXUiTDWKCUN08hUcWBLFxRDkzQVUCTNV1NJWJLMiTUTqCXJTBGSUNFIWFgLFlMWEpGIW1QUcVgMFFMTUNPQ0MvCyqCNWQyV09PLj4uDjBLU09OAFkyW0lEUCTDRKCGMlVXMi4mJEXPRUCZL1VgNF9PAR=
@qguv
qguv / find_cert.patch
Created February 14, 2020 19:46
[Prosody] core/certmanager.lua: accept letsencrypt directories even if its name doesn't match the domain
diff --git a/core/certmanager.lua b/core/certmanager.lua
index 5282a6f507b4..6d58a9a61eb7 100644
--- a/core/certmanager.lua
+++ b/core/certmanager.lua
@@ -62,8 +62,8 @@ local global_ssl_config = configmanager.get("*", "ssl");
local global_certificates = configmanager.get("*", "certificates") or "certs";
-local crt_try = { "", "/%s.crt", "/%s/fullchain.pem", "/%s.pem", };
-local key_try = { "", "/%s.key", "/%s/privkey.pem", "/%s.pem", };