Skip to content

Instantly share code, notes, and snippets.

View troykelly's full-sized avatar
💭
I may be slow to respond.

Troy Kelly troykelly

💭
I may be slow to respond.
View GitHub Profile
@troykelly
troykelly / oauth-better-ccflare.patch
Created March 14, 2026 07:07
better-ccflare oAuth Patch
diff --git a/packages/http-api/src/handlers/accounts.ts b/packages/http-api/src/handlers/accounts.ts
index d954345..8ef3284 100644
--- a/packages/http-api/src/handlers/accounts.ts
+++ b/packages/http-api/src/handlers/accounts.ts
@@ -163,22 +163,17 @@ export function createAccountsListHandler(dbOps: DatabaseOperations) {
// Use unified rate limit status if available
if (account.rate_limit_status) {
rateLimitStatus = account.rate_limit_status;
- if (account.rate_limit_reset && account.rate_limit_reset > now) {
- const minutesLeft = Math.ceil(
@troykelly
troykelly / post-create.sh
Created March 11, 2026 00:04
Troy's Container Post Create Script
#!/usr/bin/env bash
# Unified devcontainer post-create script
# Idempotent, atomic, architecture-aware
# Each step is independent — failures are logged but never abort the script.
set -uo pipefail
###############################################################################
# CRLF self-heal — Windows git checkout can inject \r into shell scripts
###############################################################################
if head -1 "$0" | grep -q $'\r'; then
@troykelly
troykelly / postgres-better-ccflare.patch
Last active March 10, 2026 07:20
Patch for better-ccflare 3.3.4
diff --git a/apps/server/src/server.ts b/apps/server/src/server.ts
index d502e19..f11b791 100644
--- a/apps/server/src/server.ts
+++ b/apps/server/src/server.ts
@@ -510,12 +510,14 @@ export default async function startServer(options?: {
runtime.port = port;
}
DatabaseFactory.initialize(undefined, runtime);
- const dbOps = DatabaseFactory.getInstance();
+ const dbOps = await DatabaseFactory.getInstanceAsync();
openapi: 3.1.0
info:
title: Pexels API
version: "2026-03-08"
summary: Unofficial OpenAPI 3.1 specification generated from the current Pexels documentation.
description: |-
This OpenAPI document was generated from the current public Pexels API documentation.
Notes:
- Authentication is via the `Authorization` header with a Pexels API key.
@troykelly
troykelly / devcontainer-tmux.sh
Last active February 15, 2026 06:25
devcontainer-tmux: Start or attach tmux sessions inside running devcontainers. Auto-detects user, container, shell. Supports multiple repo roots.
#!/usr/bin/env bash
# devcontainer-tmux — Start or attach a tmux session inside a running devcontainer
# Usage: devcontainer-tmux <org>/<repo> [session-suffix] [--repo-root PATH]
#
# Examples:
# devcontainer-tmux troykelly/openclaw-projects
# devcontainer-tmux troykelly/openclaw-projects 002
# devcontainer-tmux troykelly/openclaw-projects fix-tests --repo-root ~/github
#
# Behaviour:
@troykelly
troykelly / README.md
Last active August 25, 2025 00:22
FUSE filesystems to deadlock issues in Debian 13

Debian 13 FUSE Deadlock Fix

🚨 Critical Fix for Kernel 6.12 FUSE Regression

This script fixes a severe regression in Linux kernel 6.12 (shipped with Debian 13) that causes FUSE filesystems to deadlock and completely kill networking, rendering the entire system unusable.

The Problem

What's Happening

  • Kernel 6.12 introduced a regression in the FUSE (Filesystem in Userspace) subsystem
@troykelly
troykelly / README.md
Last active February 28, 2025 01:25
This Python script verifies that a load balancer (LB) cluster is functioning properly.

Load Balancer Checker

Author: Troy Kelly
Date: 27th February 2025

This Python script verifies that a load balancer (LB) cluster is functioning properly by:

  1. Resolving DNS for:
    • HTTP via A/AAAA records
  • HTTPS via SVCB/HTTPS records if present, else falling back to A/AAAA
--- /home/vscode/.local/lib/python3.11/site-packages/octodns_cloudflare/__init__.py 2025-01-28 23:37:03.687375946 +0000
+++ /workspaces/dns/temp-cloudflare-patch/__init__.py 2025-01-28 23:40:24.543880502 +0000
@@ -1072,33 +1072,87 @@
self._try_request('DELETE', path)
def _apply_Delete(self, change):
+ """
+ Delete an existing record (DNS record or Pagerule) in Cloudflare.
+
+ Raises CloudflareError if critical data (e.g., zone_id, record id) is missing,
@troykelly
troykelly / README.md
Last active January 17, 2025 04:36
This script is designed to validate and, if necessary, correct the system’s configured Fully Qualified Domain Name (FQDN) on Debian/Ubuntu (and similar) systems.

check_fqdn.sh

This script is designed to validate and, if necessary, correct the system’s configured Fully Qualified Domain Name (FQDN) on Debian/Ubuntu (and similar) systems. It:

  1. Checks if the current operating system is a Debian/Ubuntu (APT-based) distribution.
  2. Ensures required system commands are installed, attempting silent installation via apt-get if necessary.
  3. Identifies the default route’s interface for both IPv4 and IPv6.
  4. Retrieves the primary global (i.e., non-local) IPv4 and IPv6 addresses on those interfaces.
  5. Performs reverse DNS lookups on those local addresses to determine their FQDNs.
  6. Ensures that the forward DNS record for that FQDN matches both IP addresses.