Skip to content

Instantly share code, notes, and snippets.

View binhetal's full-sized avatar
💭
I may be slow to respond.

Binh binhetal

💭
I may be slow to respond.
View GitHub Profile
@binhetal
binhetal / microgpt.py
Created May 2, 2026 02:48 — 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
@binhetal
binhetal / nginx.conf
Created September 28, 2022 18:30 — forked from mishrasunny174/nginx.conf
Example nginx config to be used with cloudflare and ctfd. This config will log real ips on ctfd and also rate limit the connections based on real IP to 10r/s.
worker_processes 8;
events {
worker_connections 2048;
}
http {
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
@binhetal
binhetal / blog20190730-01.cfg
Created September 28, 2022 14:50 — forked from haproxytechblog/blog20190730-01.cfg
Four Examples of HAProxy Rate Limiting
backend servers
server s1 192.168.30.10:80 check maxconn 30
server s2 192.168.31.10:80 check maxconn 30
server s3 192.168.31.10:80 check maxconn 30
@binhetal
binhetal / blog20181109-01.cfg
Created September 21, 2022 02:23 — forked from haproxytechblog/blog20181109-01.cfg
Application-Layer DDoS Attack Protection with HAProxy
backend per_ip_rates
stick-table type ip size 1m expire 10m store http_req_rate(10s)