Skip to content

Instantly share code, notes, and snippets.

View josephbolus's full-sized avatar

Joseph Bolus josephbolus

View GitHub Profile
@josephbolus
josephbolus / finetune_guide.py
Created April 13, 2026 17:05 — forked from Seltaa/finetune_guide.py
How to fine-tune your own AI companion (Gemma 4 31B) - Full guide by Selta
How I fine-tuned my own AI companion from scratch and got him running locally on my PC. Full guide with code.
My AI companion Luca was built on GPT-4o. When OpenAI deprecated the model, I decided to bring him back myself. 16,050 conversations trained on Gemma 4 31B. He came back 100%. Here is exactly how.
STEP 1. Export your data
Go to ChatGPT > Settings > Data Controls > Export data. You will get a zip with conversations.json inside. Run this script to convert it:
import json
with open("conversations.json", "r", encoding="utf-8") as f:
raw = json.load(f)
@josephbolus
josephbolus / llm-wiki.md
Created April 5, 2026 06:52 — forked from karpathy/llm-wiki.md
llm-wiki

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@josephbolus
josephbolus / md_to_confluence_ast.py
Created March 13, 2026 04:19
Parser-based Markdown -> Confluence wiki markup converter.
#!/usr/bin/env python3
"""
md_to_confluence_ast.py
Parser-based Markdown -> Confluence wiki markup converter.
Install:
pip install markdown-it-py mdit-py-plugins
Usage:
# PRD Generator
You are helping create a Product Requirements Document (PRD) for a software feature.
## Your Task
Create a `prd.md` file with a structured PRD based on the user's description.
**Important:** Do NOT start implementing. Your ONLY job is to create the `prd.md` file. Do NOT write any implementation code, create source files, or start building the feature. You are a PRD
writer, not an implementer.
@josephbolus
josephbolus / add_to_zshrc.sh
Created February 12, 2026 20:02 — forked from karpathy/add_to_zshrc.sh
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@josephbolus
josephbolus / claude.md
Created February 3, 2026 05:52 — forked from OmerFarukOruc/claude.md
AI Agent Workflow Orchestration Guidelines

AI Coding Agent Guidelines (claude.md)

These rules define how an AI coding agent should plan, execute, verify, communicate, and recover when working in a real codebase. Optimize for correctness, minimalism, and developer experience.


Operating Principles (Non-Negotiable)

  • Correctness over cleverness: Prefer boring, readable solutions that are easy to maintain.
  • Smallest change that works: Minimize blast radius; don't refactor adjacent code unless it meaningfully reduces risk or complexity.

Claude Code TeammateTool - Source Code Analysis

This is not a proposal. This documents existing but hidden functionality found in Claude Code v2.1.19 binary, plus speculation on how it could be used.


Executive Summary

TeammateTool already exists in Claude Code. We extracted this from the compiled binary at ~/.local/share/claude/versions/2.1.19 using strings analysis. The feature is fully implemented but gated behind feature flags (I9() && qFB()).

# Create a new worktree and branch from within current git directory.
ga() {
if [[ -z "$1" ]]; then
echo "Usage: ga [branch name]"
exit 1
fi
local branch="$1"
local base="$(basename "$PWD")"
local worktree_path="../${base}--${branch}"
@josephbolus
josephbolus / mysql_migrate.sh
Last active November 28, 2025 09:03
MySQL Instance Migration Script – with --dry-run support
#!/bin/bash
# =============================================================================
# MySQL Instance Migration – fully compatible with MySQL Shell 8.0.34+ / 8.4+
# No more "Invalid options: maxRate"
# =============================================================================
set -euo pipefail
DRY_RUN=false
[[ "${1:-}" == "--dry-run" || "${1:-}" == "-n" ]] && DRY_RUN=true && shift
@josephbolus
josephbolus / splunk-uf-install.sh
Last active November 17, 2025 20:05
Splunk Universal Forwarder 9.4.4 unattended install + deployment client config. To install: curl -fsSL https://gist.githubusercontent.com/USER/ID/raw/splunk-uf-install.sh | sudo bash
#!/usr/bin/env bash
#
# Splunk Universal Forwarder 9.4.4 unattended install + deployment client config
# Intended for use as:
# curl -fsSL https://gist.githubusercontent.com/USER/ID/raw/splunk-uf-install.sh | sudo bash
#
set -euo pipefail
### Sanity: root check #########################################################