Skip to content

Instantly share code, notes, and snippets.

#include <sys/param.h> /* MIN */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stddef.h>
#include <errno.h>
#include <assert.h>
@mischief
mischief / os.txt
Created June 16, 2025 08:15
megrez notes
sifive p550 ubuntu works on megrez mostly
https://github.com/sifiveinc/hifive-premier-p550-ubuntu/releases/tag/2025.04.00
- missing wifi fw
- audio driver seems broken, untested
@mischief
mischief / ffs2.lua
Created June 4, 2025 21:57
scan for ffs2 slices
local ffi = require("ffi")
local io = require("io")
local bit = require("bit")
ffi.cdef[[
typedef unsigned char u_char;
typedef unsigned char u_int8_t;
typedef uint32_t u_int32_t;
typedef uint64_t u_int64_t;
@mischief
mischief / imsg.lua
Last active May 3, 2025 22:36
luajit imsg
local ffi = require("ffi")
local unix = require("unix")
ffi.cdef [[
typedef uint32_t pid_t;
struct msgbuf;
struct imsgbuf {
struct msgbuf *w;
@mischief
mischief / npppd.conf
Created April 18, 2025 16:40
test npppd.conf
authentication LOCAL type local {
users-file "/etc/npppd/npppd-users"
}
tunnel PPPOE protocol pppoe {
mru 1400
listen on interface rge3
}
ipcp IPCP {
@mischief
mischief / hwmond.c
Created September 16, 2024 04:34
hwmon
#include <err.h>
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#include <stddef.h>
#include <string.h>
#include <sysexits.h>
#include <unistd.h>
#include <stdlib.h>
@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";