Skip to content

Instantly share code, notes, and snippets.

"""
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
@ncdulo
ncdulo / turbo-boost.sh
Created February 11, 2020 21:37
Enable or disable Intel Turbo-Boost via MSR
#!/usr/bin/env bash
# Enable or disable Intel Turbo-Boost
# Requires msr kernel module to be built and loaded
# Will ask for root privileges when the time comes
# Copied, with love, from:
# https://notepad2.blogspot.com/2014/11/a-script-to-turn-off-intel-cpu-turbo.html
if [[ -z $(which rdmsr) ]]; then
echo "msr-tools is not installed. Run 'sudo apt-get install msr-tools' to install it." >&2
@natelandau
natelandau / .bash_profile
Last active March 5, 2026 04:09
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management