Skip to content

Instantly share code, notes, and snippets.

View Grissess's full-sized avatar
🐲
busy doing derg things

Graham Northup Grissess

🐲
busy doing derg things
  • On your call stack
  • 00:57 (UTC -04:00)
View GitHub Profile
@Grissess
Grissess / index.md
Created July 30, 2026 20:28
Pass and Syncthing: the Unix Way

I'd been hesitant to adopt a password manager for a number of years, due to a few reasons:

  1. I kept moving between computers. I still do. I have two or three laptops and a desktop in the active rotation; the desktop's been through about three generations of hard disks. People know me as someone to whom they can give their "outdated" hardware to get some more use out of it. So keeping a password database up to date between all of them is not really trivial.

  2. I have an inherent distrust of "cloud" solutions. These are my passwords;

@Grissess
Grissess / when2meet.js
Created May 27, 2025 19:47
Become any user in the When2meet meeting without logging in
// Usage: Define this in your console:
function BecomeUser(idx) {
UserID = PeopleIDs[idx];
document.getElementById("SignIn").style.display='none';
document.getElementById("YouGrid").style.display='';
document.getElementById("UserName").innerHTML=PeopleNames[idx];
ReColorIndividual();
}
// then pass an index into PeopleIDs, between 0 and PeopleIDs.length, as such:
// BecomeUser(0)
@Grissess
Grissess / thetime.c
Created August 24, 2024 01:37
A little program that shows the time, ticking on the second, as exactly as the OS allows
/* cc -o thetime thetime.c -lrt */
#include <signal.h>
#include <time.h>
#include <stdio.h>
#define BUFSZ 128
int main() {
timer_t timer;
@Grissess
Grissess / iterators_iterables.ipynb
Created April 5, 2024 04:52
Iterators and Iterables
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import sys
hosts = {}
for line in sys.stdin:
line = line.strip()
if not line:
continue
host, pkg = line.split()
hosts.setdefault(pkg, set())
@Grissess
Grissess / tri_puzzle.py
Created August 16, 2023 22:12
Solve those silly triangle tessellation puzzles with the colored pips
from enum import Enum
from dataclasses import dataclass
import time
Color = Enum('Color', ['K', 'W', 'R', 'Y', 'G', 'B'])
# Open them to this scope
for col in Color:
globals()[col.name] = col
RESET = '\x1b[m'
import argparse
MAP = {
'A': [' * ', ' * * ', '*****', '* *', '* *'],
'B': ['*** ', '* *', '*** ', '* *', '*** '],
'C': ['****', '* ', '* ', '* ', '****'],
'D': ['** ', '* * ', '* *', '* * ', '** '],
'E': ['****', '* ', '****', '* ', '****'],
'F': ['****', '* ', '*** ', '* ', '* '],
'G': ['*****', '* ', '* ***', '* *', '*****'],
@Grissess
Grissess / README.md
Created January 4, 2023 02:52
Streaming the screen [as a camera] under Wayland

Preparation

Before beginning, you will need:

  • v4l2loopback, a Linux kernel module that, like aloop, creates a loopback device that can be seen as a camera;
  • gstreamer, which can integrate with pipewire but doesn't seem to use v4l2loopback devices well;
  • ffmpeg, which does perfectly well with v4l2loopback but (for now) lacks pipewire support.

I'm presuming you're using pipewire and any of the xdg-desktop-portal implementations appropriate to your compositor, and that it is configured to be running as part of your session (and reachable via the DBus session bus).

@Grissess
Grissess / cpu.py
Last active July 3, 2022 21:47
WIP of an inane processor
import random
import os
import traceback
import sys
import ast
from random import randrange
from myhdl import block, always_comb, always_seq, always, \
Signal, ResetSignal, intbv, modbv, delay, instance, \
now, enum, bin
@Grissess
Grissess / check_disk.sh
Last active June 23, 2022 16:52
A little dialog wrapper for smartctl
#!/bin/bash
smartctl="${SMARTCTL:-smartctl}"
dialog="${DIALOG:-dialog}"
jq="${JQ:-jq}"
# Debian workaround
blockdev="${BLOCKDEV:-$(PATH="$PATH:/sbin:/usr/sbin" which blockdev)}"
sce_parse_bit=1
sce_open_bit=2