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 / README.md
Created March 17, 2026 05:07
Requisite headers for claude oAuth API requests

Claude Code OAuth & API Proxy Specification

Unofficial complete specification for implementing a proxy that handles Claude Code's OAuth authentication flow and API requests. Captured from Claude Code CLI v2.1.77 on 2026-03-17.


Table of Contents

  1. Architecture Overview
  2. Hosts & Endpoints
@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 / README.md
Last active March 13, 2026 22:36
Multi Screen Video Playback using ffplay

Stream.sh

stream.sh is a Bash script designed to stream multiple video sources to multiple screens using ffplay. This script ensures that each video stream is displayed on a specified monitor and restarts the stream if it fails. The script is optimized for real-time playback by using various ffplay options to reduce latency and handle frame drops effectively.

Features

  • Streams multiple video sources to multiple screens.
  • Ensures each stream is displayed on the specified monitor.
  • Restarts streams automatically if they fail.
  • Optimized for real-time playback with minimal latency.
@troykelly
troykelly / README.md
Last active March 12, 2026 10:17
Rebuild and Refresh Collation Version for PostgreSQL

PostgreSQL Collation and Reindexing Utility

Overview

The reindex_and_refresh_collation.sh script is created to automate the process of reindexing tables and refreshing the collation version for all user databases in a PostgreSQL server. This utility is particularly useful when you've updated the locale or collation libraries on the system where PostgreSQL is installed, as these updates could cause mismatches between the databases' expected collation version and the operating system's provided version.

What It Does

  • Retrieves a list of all user databases (excluding system templates) on the PostgreSQL server.
@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 December 6, 2025 19:47
Odoo Backup and Restore Scripts

Odoo Backup and Restore Scripts

These scripts provide a simple way to backup and restore Odoo databases and their associated filestores.

Overview

  • backup.sh: Creates a compressed backup of the Odoo database and filestore.
  • restore.sh: Restores an Odoo database and filestore from the created backup.

Prerequisites

@troykelly
troykelly / 99-ipv6.conf
Last active November 28, 2025 18:29
Docker IPv6 Support with DHCP-PD
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.default.forwarding=1
net.ipv6.route.max_size=16384
net.ipv6.conf.eth0.accept_ra=2