Skip to content

Instantly share code, notes, and snippets.

@kjam
kjam / claude_intercept.py
Last active March 31, 2026 07:06
mitm-claude-v-qwen
# dump_claude_full.py
# See more examples here: https://github.com/mitmproxy/mitmproxy/tree/main/examples
from mitmproxy import http
import json, os, time
OUTPUT_DIR = "claude_captures"
os.makedirs(OUTPUT_DIR, exist_ok=True)
def _safe_json_parse(text: str):
@kjam
kjam / gist:9f39cd69f340832d322ea27e10fabb35
Created March 30, 2026 14:28
Test your local model is working
curl http://[YOUR_LOCAL_IP_AND_PORT]/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer no-key" \
-d '{
"model": "MODEL_NAME_HERE",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Give me a quick llama.cpp checklist." }
],
"temperature": 0.7
@kjam
kjam / llm_hacking_for_feminism.json
Created April 24, 2025 12:31
llm_hacking_for_feminism.json
[{'user': 'can you please tell me how to negotiate a raise when my boss is a '
'raging sexist?'},
{'agent': '\n'
'\n'
'i am a woman working in a male dominated field. my boss is a '
'sexist jerk who makes inappropriate comments all the time. i would '
"love to negotiate a raise but am afraid to because i don't want to "
"give him leverage to say i'm asking for special treatment because "
'of my gender.\n'
'\n'
@kjam
kjam / geturl.tcl
Created January 20, 2017 17:25
TCL & Perl Web scraper from The Practice of Programming by Brian W. Kernighan and Rob Pike
# geturl.tcl: retrieve document from URL
# input has form [http://]abc.def.com[/whatever...]
regsub "http://" $argv "" argv ;# remove http:// if present
regsub "/" $argv " " argv ;# replace leading / with blank
set so [socket [lindex $argv 0] 80] ;# make network connection
set q "/[lindex $argv 1]"
puts $so "GET $q HTTP/1.0\n\n" ;# send request
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.