Skip to content

Instantly share code, notes, and snippets.

View Resonious's full-sized avatar
🕶️
💪 👔 🤳

Nigel Baillie Resonious

🕶️
💪 👔 🤳
View GitHub Profile
# First, on Windows:
# wsl --install ubuntu --name my-runner
echo "$USER ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/010_$USER-nopasswd && sudo chmod 0440 /etc/sudoers.d/010_$USER-nopasswd
# Update system
sudo apt update && sudo apt upgrade -y
# Install essential tools that GitHub Actions workflows commonly expect
sudo apt install -y \
@Resonious
Resonious / libsql-repro.rs
Created October 4, 2025 06:32
LibSQL 502 reproduction
use std::time::{Duration, SystemTime, UNIX_EPOCH};
#[tokio::main]
async fn main() {
let db = libsql::Builder::new_remote(
"libsql://tn-test-1757858861109-715822fe-main-resonious.aws-us-east-1.turso.io".into(),
"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJhIjoicm8iLCJleHAiOjE3NjY3MTk1ODIsImlhdCI6MTc1ODk0MzU4MiwiaWQiOiJmNWNiMmNjNy1iN2U2LTRlOTctYTU4YS0yOWJhYWFiNGE2MTAiLCJyaWQiOiI3MDJhMzhiYy1jM2VhLTQzNjQtOTVmMS0xZmU4OWE2MTFkNDQifQ.TnJU7f5jPzD9_gPjLK3FJqqKaPcwO9n_KGTfeRZGE5s1fbufRxEKGjFPEkBHI4hFd-A4T53Dusz71ohtn0XSAA".into()
)
.build()
.await
@Resonious
Resonious / config.kdl
Created May 28, 2024 02:05
My Niri config
// This config is in the KDL format: https://kdl.dev
// "/-" comments out the following node.
// Check the wiki for a full description of the configuration:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
// Input device configuration.
// Find the full list of options on the wiki:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
input {
keyboard {
@Resonious
Resonious / .tmux.conf
Created January 5, 2024 05:21
Good tmux
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@Resonious
Resonious / nix-on-droid.nix
Created January 5, 2024 02:52
Good nix-on-droid with newer nixpkgs than officially supported
{ config, lib, pkgs, ... }:
let
newpkgs = import (fetchGit {
url = https://github.com/NixOS/nixpkgs;
ref = "nixos-23.11";
shallow = true;
allRefs = false;
}) {};
in {
@Resonious
Resonious / configuration.nix
Created December 10, 2023 02:34
NixOS conf for desktop
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@Resonious
Resonious / startup.lua
Last active October 26, 2023 08:26
startup script
function say(msg)
print(msg)
peripheral.call("left", "sendMessage", msg)
http.post("https://hook.snd.one/nigel/mcturtle", msg)
end
local file, err = fs.open("state", "r")
if err then
say("Hello")
@Resonious
Resonious / ex.lua
Last active October 26, 2023 08:12
excavator
local tArgs = { ... }
if #tArgs ~= 1 then
print( "Usage: excavate <diameter>" )
return
end
-- Mine in a quarry pattern until we hit something we can't dig
local size = tonumber( tArgs[1] )
if size < 1 then
print( "Excavate diameter must be positive" )
@Resonious
Resonious / jmap-import-test.bash
Created February 17, 2023 14:26
JMAP email import script
#!/bin/bash
ACCOUNT_ID="c"
MAILBOX_ID="a"
AUTH="YOUR AUTH HEADER HERE"
UPLOAD="https://YOUR_SERVER/jmap/upload/$ACCOUNT_ID"
JMAP="https://YOUR_SERVER/jmap"
# Upload a new blob to JMAP
@Resonious
Resonious / komoju.bash
Last active April 8, 2021 06:25
EASY KOMOJU CLI
# TO USE:
# $ komoju GET /api/v1/payments
# $ komoju POST /api/v1/sessions -d amount=100 -d currency=JPY
# SO EASY!!!
komoju() {
local key=${KEY-degica-mart}
local hats=${HATS-"https://$(ruby -r yaml -e 'puts YAML.load(File.read "#{ENV[%[HOME]]}/.kaiser/.config.yml").dig :envnames, Dir.pwd').localhost.labs.degica.com"}
curl -L --cookie "waf_staging_token=$WAF_STAGING_TOKEN" -u $key: -X "$1" "$hats/$2" "${@:3}" | jq
}