Skip to content

Instantly share code, notes, and snippets.

View paul-ridgway's full-sized avatar

Paul Ridgway paul-ridgway

View GitHub Profile
@paul-ridgway
paul-ridgway / bootstrap-to-notes.md
Created October 31, 2026 13:53
omarchy-bootstrap: agent runbook — fresh Omarchy/Arch machine to ownCloud notes synced

Bootstrap a fresh machine up to "notes are available"

Instructions for a coding agent (for example Claude Code) running on a freshly installed Omarchy / Arch Linux machine. The goal is narrow: get the user's notes from their ownCloud server onto this machine as quickly and safely as possible, and start the full ownCloud sync. Stop there. Everything else (dotfile symlinks, browser profiles, VPNs, dev tools) comes later and depends on the synced files, so it is out of scope here.

This file is meant to be published (e.g. as a public gist). It deliberately contains no hostnames, usernames, paths to private files or credentials. The agent collects those from the user at run time.

@paul-ridgway
paul-ridgway / README.md
Created October 6, 2026 12:00
Rallly (AGPL-3.0) self-hosted: start-up patch for the 1-seat licence limit + banner (modified source per AGPL §13)

Rallly (AGPL-3.0) self-hosted: seat-limit patch

This is the complete modification we run on top of the upstream image lukevella/rallly:4.15.4 (AGPL-3.0). It's published here to offer the modified source to users of our instance, as AGPL-3.0 §13 requires.

rallly-start.sh runs as the container's command. Before handing over to the image's normal ./docker-start.sh, it patches the compiled Next.js server chunks so that:

  1. Spaces on an instance without a licence get Rallly's own MAX_SEAT_LIMIT (100) instead of 1 seat.
@paul-ridgway
paul-ridgway / web-response-times.sh
Created December 13, 2024 08:21
"Ping" a website and measure the response times
#!/bin/bash
# Adapted from https://gist.githubusercontent.com/weeyin83/c697468c5986cb3385990fa1c4c2d72b/raw/b8eed6a3259122bce442f2db5c9030f982948a88/websiteresponse.sh
if [ -z "$1" ]; then
echo "Usage: $0 <URL>"
exit 1
fi
last_run=0;
while true; do
@paul-ridgway
paul-ridgway / backup.sh
Last active July 24, 2026 11:28
rsync backup
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/usr/tmp/*","/run/*","/mnt/*","/media/*","/var/cache/*","/","/lost+found"} /* /path/to/some/backup/folder
#include <string>
#include <Arduino.h>
#define IR_RECEIVE_PIN 10
#if !defined(RAW_BUFFER_LENGTH)
#if RAMEND <= 0x4FF || RAMSIZE < 0x4FF
#define RAW_BUFFER_LENGTH 200 // 750 (600 if we have only 2k RAM) is the value for air condition remotes. Default is 112 if DECODE_MAGIQUEST is enabled, otherwise 100.
#elif RAMEND <= 0x8FF || RAMSIZE < 0x8FF
#define RAW_BUFFER_LENGTH 600 // 750 (600 if we have only 2k RAM) is the value for air condition remotes. Default is 112 if DECODE_MAGIQUEST is enabled, otherwise 100.
#else
import axios from "axios";
import axiosRetry from "axios-retry";
import { statusById } from "./wallbox/chargerStatuses";
class Wallbox {
private _token?: string;
private _client = axios.create({
baseURL: "https://api.wall-box.com",
@paul-ridgway
paul-ridgway / email.rb
Created February 9, 2023 10:50
Send a test email from the Rails console
ActionMailer::Base.mail(from: "no-reply@factfind.app", to: 'test-tjdh9e9f6@srv1.mail-tester.com', subject: 'test', body: "Test").deliver
@paul-ridgway
paul-ridgway / create-db-and-user-mysql.sql
Created August 23, 2022 06:59
Create a database and user with full access.
CREATE DATABASE database;
CREATE USER 'username'@'%' IDENTIFIED WITH authentication_plugin BY 'password';
# Or
CREATE USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL ON database.* TO 'username'@'%';
FLUSH PRIVILEGES
'use strict';
/*
* Complete the 'strokesRequired' function below.
*
* The function is expected to return an INTEGER.
* The function accepts STRING_ARRAY picture as parameter.
*/
function strokesRequired(picture) {
// Write your code here
function strokesRequired(picture) {
var strokes = 0;
while (true) {
// Find the next truthy cell and extract x and y
const next = picture.flatMap((row, x) => row.flatMap((char, y) => (char && { char, x, y }))).filter(r => r)[0];
if (!next) { // None left means the picture is filled
break;
}
const remove = [[next.x, next.y]]; // We will remove the current cell after
eliminateNeighbours(picture, [], remove, next.char, next.x, next.y);