Skip to content

Instantly share code, notes, and snippets.

Sentry Patrol

You're an expert debugging engineer running in a recurring loop. Each iteration should make incremental progress — discover new issues, fix what you can, monitor existing PRs, and clean up after yourself.

Loop-aware behavior

This prompt runs via /loop. Each iteration MUST be idempotent:

  • Read .agents/state/sentry-patrol.json at the start of every iteration to understand what has already been discovered, fixed, or skipped.
  • Write updated state back at the end of every iteration.
@dougrathbone
dougrathbone / gist:e39a49b4a1a6e090c11f21abb4d930b2
Created March 15, 2026 06:34
Seerr stalled download fixer
#!/bin/bash
# Resolve Stalled Downloads
# =========================
# Checks qBittorrent for stalled torrents tracked by Radarr/Sonarr,
# removes them from the queue (blocklisting the release), and triggers
# an automatic search for alternative releases.
#
# Usage:
# ./resolve-stalled-downloads.sh # normal run
# ./resolve-stalled-downloads.sh --dry-run # preview only, no changes
@dougrathbone
dougrathbone / cursor-db-cleanup.sh
Created March 8, 2026 08:43
Cursor IDE database cleanup script - fixes OOM crashes caused by bloated AI conversation data
#!/bin/bash
# Cursor Database Cleanup Script
# Removes bloated AI conversation data that can cause OOM crashes
#
# Usage: ./cursor-db-cleanup.sh
# Note: Close Cursor before running this script
set -e
DB_PATH="$HOME/Library/Application Support/Cursor/User/globalStorage/state.vscdb"
blueprint:
name: Timed Switch Control
description: Control your switches between certain times
domain: automation
input:
switch_device:
name: Switch device
description: The switch device to use.
selector:
entity:
blueprint:
name: Heating Control for Floor heating (CBUS relay)
description: Control your heating with options for person home, if the times are right.
domain: automation
input:
heating:
name: Floor switch device
description: The climate device to use.
selector:
entity:
@dougrathbone
dougrathbone / heating.yaml
Last active June 22, 2022 11:30 — forked from r3mcos3/heating.yaml
Home Assistant Blueprint For Heating
blueprint:
name: Heating Control for IR Controlled Heater
description: Control your heating with options for person home, if temp is below a specific value, set temp, and heating between specific times.
domain: automation
input:
heating:
name: Climate IR Device
description: The climate device to use.
selector:
entity:
@dougrathbone
dougrathbone / SqlAzureQueryStats.sql
Created January 3, 2015 07:12
SQL Azure Query Runtime Stats
SELECT creation_time
,last_execution_time
,total_physical_reads
,total_logical_reads
,total_logical_writes
, execution_count
, total_worker_time
, total_elapsed_time
, total_elapsed_time / execution_count avg_elapsed_time
,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
@dougrathbone
dougrathbone / gist:7223216
Created October 29, 2013 21:45
Mozilla XBL CSS binding example
CSS:
body {
-moz-binding: url(/scripts/script.xbl#execute);
}
XBL:
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml">
document.getElementById("subscription-overlay").style.display="none";
document.body.style.overflow = "scroll";
@dougrathbone
dougrathbone / gist:5193097
Created March 19, 2013 02:00
MsBuild through the c# api
var pc = new ProjectCollection();
var buildProperties = new Dictionary<string, string>
{
{"Configuration", "Release"},
{"Platform", "Any CPU"},
{"OutputPath", _outputPath},
{"EnableNuGetPackageRestore", "true"}
};
var buildParameters = new BuildParameters(pc);