Skip to content

Instantly share code, notes, and snippets.

@aristus
Created November 16, 2015 21:55
Show Gist options
  • Save aristus/e9718a8ab459d07d3c8e to your computer and use it in GitHub Desktop.
Save aristus/e9718a8ab459d07d3c8e to your computer and use it in GitHub Desktop.
Useful constants for capacity planning.
import math,re
# binary "oodles of magnitude"
KB = 2 ** 10
MB = 2 ** 20
GB = 2 ** 30
TB = 2 ** 40
PB = 2 ** 50
# decimal "oodles of magnitude"
K = 10 ** 3
M = 10 ** 6
G = B = 10 ** 9
T = 10 ** 12
P = 10 ** 15
# date constants
SECONDS = 86400
MINUTES = SECONDS / 60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment