Skip to content

Instantly share code, notes, and snippets.

insom / pi-dac.c
Created Mar 1, 2021
Quick and Dirty Pi 256x256 Raster Display using a TLC7528CN DAC
View pi-dac.c
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"
#include "test.h"
#define FIRST_GPIO 0
char frame[256][256] = {0};
int main() {
insom / scrolling.c
Created Jan 2, 2021
experiments with vt100 scrolling
View scrolling.c
/* vim:ts=2:sw=2:expandtab
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
insom / despair.cpp
Created Feb 6, 2020
MySQL Session Tracking for ALL_GTIDS
View despair.cpp
#include <cstdio>
#include <mysql.h>
void retrieve_session_track_data(MYSQL *m) {
const char *data;
size_t length;
for(int type=0; type <= 255; type++) {
if (mysql_session_track_get_first(m, (enum enum_session_state_type) type, &data, &length) == 0) {
do {
insom / keymap.c
Created Feb 27, 2018
Nyquist Keymap File
View keymap.c
#include "nyquist.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
insom / pthread_test.c
Created May 8, 2017
Let's make a lot of threads!
View pthread_test.c
// gcc -D_GNU_SOURCE=1 -std=c99 a.c
#include <sched.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int f(void *p) {
insom /
Created Apr 23, 2017
Teensy Tiny OStatus / Mastodon server
import json
from flask import Flask
app = Flask(__name__)
def hello():
return "Hello World!"
def hostmeta():
View wg-config.bash
modprobe ipv6
modprobe udp_tunnel
modprobe ip6_udp_tunnel
ip link add dev wg0 type wireguard
wg setconf wg0 /etc/wireguard/config
wg showconf wg0
brctl addbr internet
brctl stp internet on
ip link set up dev wg0
insom /
Created Feb 13, 2017
Carving "DYLAN" into a wooden block
G0 X0 Y0 Z0
G0 Y11 X10
insom /
Created Dec 31, 2016
Bode Plot-ish
import math
import matplotlib.pyplot as plt
x = ((10,1.03),(50,1.03),(100,1.01),(500,1.005),(1000,1.015),(2500,1.00),(5000,0.98),(10000,0.92),(15000,0.84),(20000,0.75),)
for hz, v in x:
insom /
Created Dec 20, 2016
Micropython Temperature Logger
import gc
import webrepl
from machine import Pin, I2C
from bme280 import BME280
from socket import socket, AF_INET, SOCK_DGRAM
from time import sleep