Skip to content

Instantly share code, notes, and snippets.

View keithchambers's full-sized avatar

Keith Chambers keithchambers

View GitHub Profile
@keithchambers
keithchambers / OTEL.json
Last active April 20, 2025 07:48
OTEL JSON
{
"resourceSpans": [{
"schemaUrl": "https://opentelemetry.io/schemas/1.25.0",
"resource": {
"attributes": [{
"key": "service.name", "value": { "stringValue": "llm-gateway" }},{
"key": "deployment.environment", "value": { "stringValue": "prod" }}]},
"scopeSpans": [{
"scope": { "name": "ai.request.pipeline", "version": "2.3.0" },
"spans": [{
@keithchambers
keithchambers / setup.sh
Created April 15, 2025 19:49
Kafka Batch File Upload System
#!/bin/bash
set -e # Exit on error. Use `set -eux` for debugging to print commands and expand variables.
REPO_NAME="kafka-batch-upload"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # Get dir where setup.sh is
KAFKA_IMAGE="bitnami/kafka:3.7" # Define Kafka image once
echo "Setting up the Kafka Batch Upload project in ./${REPO_NAME}"
echo "This will create all necessary files and directories."
echo "Attempting to automate KRaft Cluster ID generation..."
@keithchambers
keithchambers / main.go
Last active April 14, 2025 16:02
OTEL Agentic Event Gen
// Package main implements a load tester for sending OpenTelemetry (OTLP) data
// via HTTP JSON or gRPC Protobuf, with an option to output generated data to a
// file instead of sending it over the network.
package main
import (
"bytes"
"context"
"crypto/tls"
"encoding/hex"
#!/bin/bash
# Create directory structure
echo "Creating project directories..."
# Replaced nginx with traefik, added traefik config dir
mkdir -p otel-kafka-clickhouse-stack/{traefik/conf,otel-collector,clickhouse-init,kafka-data,clickhouse-data}
cd otel-kafka-clickhouse-stack || exit 1 # Exit if cd fails
# Create .env file for secrets and configs
#!/usr/bin/env python3
import argparse
import logging
import numpy as np
import pandas as pd
import pyarrow.parquet as pq
from pathlib import Path
from typing import Union
import random
@keithchambers
keithchambers / PROMPT
Last active February 24, 2025 15:58
Prompt for OpenAI's Deep Research to research a company for an open role
COMPANY=Fiddler AI
ROLE=Product Manager
You are a deep research reasoning model with the ability to access relevant and
up-to-date information from the web. Please produce a structured report for a
"{{ROLE}}" about the company named "{{COMPANY}}".
The report must include the following sections and details:
1. Company Overview
@keithchambers
keithchambers / mvsep-data-downloader.py
Created February 2, 2025 00:12
MVSep.com Data Downloader
import argparse
import json
import re
import sys
import threading
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
from datetime import datetime
import requests
@keithchambers
keithchambers / -h | --help
Created January 28, 2025 03:34
YouTube Transcript Downloader
usage: yt-transcript-downloader.py [-h] [-k KEY] [-v VIDEO] [-c CHANNEL] [-p PLAYLIST] [-s SEARCH] [-o {relevance,date,rating,views}] [-m MAX_SIZE] [-a AGE]
Download YouTube transcripts and metadata in YAML format,
with an optional max YAML file size limit.
options:
-h, --help show this help message and exit
-k KEY, --key KEY YouTube API Key to use. Overrides YOUTUBE_API_KEY env variable if not set.
-v VIDEO, --video VIDEO
YouTube Video ID or URL
@keithchambers
keithchambers / copy-artwork.py
Last active January 26, 2025 18:29
Copy audio file ID3 and artwork
#!/usr/bin/env python3
import argparse
import io
import os
import sys
import mutagen
from mutagen.id3 import ID3, ID3NoHeaderError
from mutagen.id3 import error as ID3Error
from mutagen.mp3 import MP3
@keithchambers
keithchambers / macvolumes.go
Last active November 17, 2024 07:33
macvolumes
// macvolumes is a tool to classify macOS volumes by their physical connectivity
// and whether they are permanently installed or removable. It distinguishes between:
// - System volumes (the macOS boot volume)
// - Fixed volumes (built-in or permanently installed drives)
// - Removable volumes (external drives that can be disconnected)
//
// The tool uses macOS's standardized disk management structures to ensure
// consistent behavior across different Mac models.
package main