Skip to content

Instantly share code, notes, and snippets.

@sean-
sean- / claude_code_recovery.py
Created September 26, 2025 19:47
Emergency recovery tool for Claude Code session files
#!/usr/bin/env python3
"""claude_code_recovery.py - Emergency recovery tool for Claude Code session files
Copyright (c) 2025 Sean Chittenden
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
mask offset: 11
mask size: 13
hex nibbles: 4
Input Decimal Hex Binary
------- -------------------- ---------------- ----------------------------------------------------------------
orig 0 0000000000000000 0000000000000000000000000000000000000000000000000000000000000000
encoded 0 0000000000000000 0000000000000000000000000000000000000000000000000000000000000000
prefix 0 0000 0000000000000
------- -------------------- ---------------- ----------------------------------------------------------------
orig 1 0000000000000001 0000000000000000000000000000000000000000000000000000000000000001
mask offset: 11
mask size: 13
hex nibbles: 4
orig(dec) orig(hex) orig(bin) enc(hex) enc(bin) prefix(hex) prefix(bin)
0 00000000 00000000000000000000000000000000 00000000 00000000000000000000000000000000 0000 0000000000000
1 00000001 00000000000000000000000000000001 00000001 00000000000000000000000000000001 0000 0000000000000
2 00000002 00000000000000000000000000000010 00000002 00000000000000000000000000000010 0000 0000000000000
3 00000003 00000000000000000000000000000011 00000003 00000000000000000000000000000011 0000 0000000000000
4 00000004 00000000000000000000000000000100 00000004 00000000000000000000000000000100 0000 0000000000000
127 0000007f 00000000000000000000000001111111 0000007f 00000000000000000000000001111111 0000 0000000000000
@sean-
sean- / gce-freebsd-11.tf
Last active September 1, 2016 11:12
FreeBSD 11.0-RC1 on GCE
// Quick Terraform file to spin up FreeBSD 11.0-RC1 on GCE
//
// Steps:
// 0) Install Terraform >= 0.6.16 <https://www.terraform.io/downloads.html>
// 0.1) Install Google SDK if not already done (hint: `which gcloud` must succeed): https://cloud.google.com/sdk/
// 0.2) If already installed, make sure GCE settings are correct by re-running: `gcloud init`
// 0.3) Load the correct SSH key into your ssh-agent: `ssh-add ~/.ssh/google_compute_engine`
// 1) Drop this file into a dedicated directory
// 2) Populate account.json from https://console.cloud.google.com/apis/credentials/serviceaccountkey?authuser=1
// 3) Plan the change by running: `terraform plan -out foo.plan`
# Data from: http://www.theguardian.com/sport/ng-interactive/2016/aug/05/rio-olympics-2016-medal-table-and-results-in-full
# $ cat us_medals_rio2016.txt | grep Men | wc -l
# 51
# $ cat us_medals_rio2016.txt | grep Women | wc -l
# 60
3 hours ago Gold Athletics, Men's 4 x 400m Relay Men's team
3 hours ago Gold Athletics, Women's 4 x 400m Relay Women's team
4 hours ago Bronze Taekwondo, Women +67kg Jackie Galloway
4 hours ago Silver Athletics, Men's 5000m Paul Kipkemoi Chelimo
4 hours ago Gold Athletics, Men's 1500m Matthew Centrowitz
@sean-
sean- / keybase.md
Created February 3, 2016 23:23
keybase.md

Keybase proof

I hereby claim:

  • I am sean- on github.
  • I am seanc (https://keybase.io/seanc) on keybase.
  • I have a public key whose fingerprint is D122 3D5C A7B9 3427 5A04 C7D4 4EBC 9DC1 6C2E 5E16

To claim this, I am signing this object:

@sean-
sean- / gist:8f99c312bc798b65c4fe
Last active November 25, 2015 16:21
This is your your data on a RAID card, any questions?
pool: data
state: DEGRADED
status: One or more devices are faulted in response to IO failures.
action: Make sure the affected devices are connected, then run 'zpool clear'.
see: http://illumos.org/msg/ZFS-8000-HC
scan: none requested
config:
NAME STATE READ WRITE CKSUM
data DEGRADED 4 17.6K 0