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 / 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", };
@qguv
qguv / BashNP-Guide.txt
Created December 2, 2019 13:30
shudder's guide to network programming in bash (Mirror of broken http://shudder.daemonette.org/source/BashNP-Guide.txt)
shudder's guide to network programming in bash
==============================================
1. What's this?
I'm kind of a maniac when it's about doing nifty things with
tools not originally designed for that.that's why I wrote the "guide".
maybe there are some other resources that document this (not
counting the bash manual page) but I wanted to express my own
impressions on the possibilities of bash.
@qguv
qguv / zucchini_bread.md
Last active December 14, 2019 08:14
Zucchini bread recipe

Zucchini Bread

Prep: 20 minutes. Bake: around 1 hour.

Ingredients

  • 380g sugar (2 cups ~ 470mL)
  • 300g flour (3 cups ~ 710mL)
  • 5g salt (teaspoon)
  • 3-8g cinnamon (1-3 teaspoons)
@qguv
qguv / higher_order.js
Created October 7, 2019 13:41
higher_order.js: create wrapped versions of promise generator functions
// produce a wrapped promise generator whose promises regenerate instead of rejecting
export function retrying(func, n=Infinity) {
return n == 1
? func
: () => func().catch(retrying(func, n - 1));
}
// produce a wrapped promise generator whose promises ignore rejections
export function noreject(func) {
return () => func().catch(() => {});
@qguv
qguv / bloemenbad.ino
Last active February 13, 2019 13:32
bloemenbad
/*
* _ _
* | |__ | | ___ ___ _ __ ___ ___ _ __
* | '_ \| |/ _ \ / _ \ '_ ` _ \ / _ \ '_ \
* | |_) | | (_) | __/ | | | | | __/ | | |
* |_.__/|_|\___/ \___|_| |_| |_|\___|_| |_|
* ____ _ ____
* | __ ) / \ | _ \
* | _ \ / _ \ | | | |
* | |_) / ___ \| |_| |
@qguv
qguv / gist:1229fc9ddb801114a3cdc47861f46833
Last active January 31, 2019 00:06
sonoff-tasmota periodic short relay
poweronstate 0
rule1
on system#boot do
ruletimer1 4
endon
on rules#timer=1 do backlog
ruletimer2 1;
power1 1;
endon
@qguv
qguv / serverless-domain-manager-iam-policy.json
Created December 19, 2018 05:42
Minimum credential set for serverless-domain-manager plugin for the Serverless framework
{
"Statement": [
{
"Action": [
"acm:ListCertificates",
"cloudfront:UpdateDistribution",
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListHostedZones",
"route53:ListResourceRecordSets"