Skip to content

Instantly share code, notes, and snippets.

View mohamedawnallah's full-sized avatar

Mohamed Awnallah mohamedawnallah

View GitHub Profile
get_coauthor() {
local github_user="$1"
if [[ -z "$github_user" ]]; then
echo "Usage: get_coauthor <github_username>"
echo "Example: get_coauthor mohamedawnallah"
return 1
fi
# Normalize the input username.
local normalized_input=$(echo "$github_user" | tr -d ' ' | tr '[:upper:]' '[:lower:]')
@mohamedawnallah
mohamedawnallah / benchmark_lnd_namespace.sh
Last active November 8, 2025 16:17
Reproducing LND blocks rescan issue when wallet created during headers sync
#!/bin/bash
# LND Benchmark Script with Linux Namespaces and Temporary Storage
# Runs LND in isolated network, PID, and mount namespaces with ephemeral tmpfs storage
# Configuration
VERSION="${1:-$(git describe --tags --always --dirty 2>/dev/null || echo 'unknown')}"
ALIAS="${2:-default}"
LND_BIN="$(pwd)/lnd-debug-${VERSION}"
LNCLI_BIN="$(pwd)/lncli-debug-${VERSION}"
{"instruction":"What is the next step in making this?","response":"1. Prepare all ingredients\n2. Heat pan on medium-high heat\n3. Add oil\n4. Cook protein first until done\n5. Remove protein and set aside\n6. Add vegetables in order of cook time\n7. Return protein to pan\n8. Add sauce\n9. Toss until sauce thickens\n10. Serve immediately over rice","reasoning":"All prep must be done before heating pan. Pan must be very hot before adding oil. Protein cooked separately to avoid steaming. Vegetables added by cook time ensures even cooking.","rule_id":"RULE_PRECONDITIONS","task_domain":"cooking","reasoning_source":"EleutherAI\/gpt-neox-20b"}
{"instruction":"How do I make fruit salad?","response":"1. Wash and cut fruit\n2. Combine all ingredients in a bowl\n3. Toss until fruit is evenly coated\n4. Serve immediately","reasoning":"All prep must be done before combining. Fruit must be washed and cut before adding to bowl. Tossing ensures even coating.","rule_id":"RULE_PRECONDITIONS","task_domain":"cooking","reasoning
@mohamedawnallah
mohamedawnallah / microgpt.py
Created February 21, 2026 02:26 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp