Skip to content

Instantly share code, notes, and snippets.

@brunogama
Created February 3, 2012 21:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunogama/1732682 to your computer and use it in GitHub Desktop.
Save brunogama/1732682 to your computer and use it in GitHub Desktop.
My random size image generator script (only for UNIX systems).
import random
import string
from os import system as s
for i in range(14):
new = '%s.jpg' % (''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(15)))
cmd = 'cp terra.jpg %s' % (new)
s(cmd)
s('dd if=/dev/urandom of=dummy_bytes bs=1m count=80')
cmd = 'cat dummy_bytes >> %s' % (new)
s(cmd)
s('rm dummy_bytes')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment