Skip to content

Instantly share code, notes, and snippets.

View evkuzin's full-sized avatar
🫠
Fixing bugs

Evgeny evkuzin

🫠
Fixing bugs
View GitHub Profile
@evkuzin
evkuzin / microgpt.py
Created February 17, 2026 10:00 — 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
@evkuzin
evkuzin / howto.md
Last active August 6, 2021 12:43 — forked from NikolayS/howto.md
log_min_duration_statement = 0 and I/O impact

How to get an estimate of the impact of writing Postgres logs with log_min_duration_statement = 0:

  1. Do select pg_stat_statements_reset(); and wait N seconds (where N >> 60 – say 1-24 hours, covering typical busy hours). Remember when it was, and write down somewhere – this timestamp will be needed!

  2. Check if select count(*) from pg_stat_statements is lower than pg_stat_statements.max. If it's equal to it, then raise pg_stat_statements.max and restart with the step 1.

  3. Get the estimate:

\set TS_PGSS_RESET 'XXXX-XX-XX XX:XX:XX';