Skip to content

Instantly share code, notes, and snippets.

@mischief
mischief / hello.txt
Created October 26, 2023 22:41
hello world
hello
@mischief
mischief / epaper.yaml
Created July 5, 2023 05:05
epaper esphome config
esphome:
name: epaper
friendly_name: epaper
esp8266:
board: d1_mini
# Enable logging
logger:
@mischief
mischief / main.cpp
Created July 5, 2023 05:02
epaper code GxEPD2
#include <Arduino.h>
#include <GxEPD2_3C.h>
#include <Fonts/FreeMonoBold9pt7b.h>
GxEPD2_3C<GxEPD2_290_Z13c, GxEPD2_290_Z13c::HEIGHT> pdisplay(GxEPD2_290_Z13c(/*CS=D8*/ D8, /*DC=D3*/ D0, /*RST=D4*/ D1, /*BUSY=D2*/ D2)); // GDEH029Z13 128x296, UC8151D
const char HelloWorld[] = "Hello World!";
void setup() {
Serial.begin(115200);
@mischief
mischief / uart1.dts
Created June 15, 2023 00:47
ALL-H3-CC H5 2GB (Tritium) UART1
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,sun50i-h5";
fragment@0 {
target = <&uart1>;
__overlay__ {
status = "okay";
@mischief
mischief / .init.lua
Last active September 17, 2022 05:01
site
host = unix.gethostname()
c1, c2, c3 = string.byte(GetRandomBytes(1)), string.byte(GetRandomBytes(1)), string.byte(GetRandomBytes(1))
function OnHttpRequest()
Write([[<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Hello World!</title>
</head>
@mischief
mischief / build.zig
Last active December 11, 2021 19:20
zig linkage failure 0.9.0-dev.1936+77836e08a
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
// Standard release options allow the person running `zig build` to select
@mischief
mischief / tis.bundle
Last active September 9, 2019 15:43
wip tis-100
# To unbundle, run this file
echo tis/as.y
sed 's/.//' >tis/as.y <<'//GO.SYSIN DD tis/as.y'
-%{
-#include <u.h>
-#include <libc.h>
-#include <bio.h>
-#include <ctype.h>
-
-#include "tis.h"
@mischief
mischief / unbound.conf
Created August 5, 2018 18:37
unbound forwarding to dnsmasq for lan zone
# local DNS fuckery
do-not-query-localhost: no
private-domain: "home.arpa"
local-zone: "0.0.10.in-addr.arpa." nodefault
domain-insecure: "home.arpa"
domain-insecure: "0.0.10.in-addr.arpa"
private-address: 10.0.0.0/8
stub-zone:
@mischief
mischief / baddns.go
Created July 13, 2018 14:00
quick and dirty test dns server with different negative rcodes
package main
import (
"fmt"
"github.com/miekg/dns"
)
func negrcode(w dns.ResponseWriter, r *dns.Msg) {
m := new(dns.Msg)
@mischief
mischief / node_exporter
Created May 28, 2018 22:11
prometheus on openbsd
#!/bin/ksh
daemon="/usr/local/bin/node_exporter"
rc_bg=YES
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1