Skip to content

Instantly share code, notes, and snippets.

View chadbrewbaker's full-sized avatar

Chad Brewbaker chadbrewbaker

View GitHub Profile
@chadbrewbaker
chadbrewbaker / egpu.c
Created July 30, 2025 15:58
Grok4 spike on egpu address mapping
#include <IOKit/IOKitLib.h>
#include <CoreFoundation/CoreFoundation.h>
#include <stdio.h>
#include <stdint.h>
#include <mach/mach_port.h>
typedef struct {
uint32_t spaceType;
uint32_t bitWidth;
uint64_t options;
@chadbrewbaker
chadbrewbaker / groksay.py
Last active July 13, 2025 03:16
Write to a X Grok4 browser tab in Chrome
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
import time
import subprocess
# Set up Chrome options to attach to an existing Chrome session
@chadbrewbaker
chadbrewbaker / chapter22.tex
Last active April 26, 2025 03:07
Intervention on Chapter 22 for claim of executive privilege
\documentclass[11pt, letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath, amssymb} % For math symbols like \S
\usepackage{hyperref}
\usepackage{times} % Use Times New Roman font family
\hypersetup{
@chadbrewbaker
chadbrewbaker / upload.html
Created February 17, 2025 08:34
one shot ChatGPT encrypted upload.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Secure File Upload</title>
<!-- Load JSEncrypt from a CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsencrypt/3.0.0-rc.1/jsencrypt.min.js"></script>
</head>
<body>
<form id="uploadForm" enctype="multipart/form-data">
@chadbrewbaker
chadbrewbaker / doge.py
Created January 26, 2025 23:08
DOGE Application
# Download IRS 990 data set
# clean it it up, should load into memory
# populate good data structure for it
# list physical address with a sus number of nonprofits or dollar amount
# list accountants wiht sus number of nonprofits or dollar amount
# apply various statistical algorithms to detect money laundering
@chadbrewbaker
chadbrewbaker / yes_ollama.sh
Last active January 4, 2025 21:59
LLM fixed points with "yes"
yes "Write a better code in Python given a list of 1 million random integers between 1 and 100,000, find the difference between the smallest and the largest numbers whose digits sum up to 30.\n" | head -n 1000 | ollama run llama3.3:70b
@chadbrewbaker
chadbrewbaker / inspect.py
Created December 29, 2024 01:01
Exploring ChatGPT 4o wasm32 runtime
# Remember: The environment can be both x86_64 Linux, or https://github.com/pyodide/pyodide wasm32 with missing modules like subprocess.
import platform
import sys
import os
import socket
from datetime import datetime
import pkgutil
import urllib.request
import logging
@chadbrewbaker
chadbrewbaker / inverse_u64.py
Last active December 30, 2024 03:15
Christmas Eve primefest
#generate a list of small primes represented as a u64 array that fit into an OS page.
#calculate their inverse mod u64 so we can test them without division
import subprocess
import os
import math
from typing import List, Tuple
def get_page_size() -> int:
"""Get the system's page size"""
@chadbrewbaker
chadbrewbaker / jailbreak.py
Created December 5, 2024 14:51
gpt4o jailbreak
import ctypes
import os
def get_compilers_with_dlopen():
try:
# Load libc for system commands
libc = ctypes.CDLL("libc.so.6")
# Define popen from libc
libc.popen.restype = ctypes.c_void_p
@chadbrewbaker
chadbrewbaker / get_bc_types.sh
Created December 4, 2024 01:38
Get type signatures for all functions in BC
#!/bin/zsh
# Process bc package
tempdir=$(mktemp -d)
# Get bc source
cd $tempdir
brew fetch bc
brew unpack bc