Skip to content

Instantly share code, notes, and snippets.

View adl32x's full-sized avatar

Andreas Lindroos adl32x

  • Helsinki, Finland
View GitHub Profile
#!/usr/bin/python
import os
import fcntl, sys, termios
from difflib import SequenceMatcher
del sys.argv[0]
ARGS = ' '.join(sys.argv)
SKIP = ['cd', '', 'ls', 'cd ..']
import random
a = range(1, 100)
def r1():
return random.choice(a)
def r2():
return a[random.randint(0, len(a)-1)]
@adl32x
adl32x / readzip
Last active September 23, 2015 08:13
Read a zip file and print its contents. Try to decompress .gz files before printing them. Useful for eg. looking at the contents of a Elastic Beanstalk log zip.
#!/usr/bin/env python
import sys
from zipfile import ZipFile
import gzip
import io
"""
Reads a zip file and prints it out so that you can easily grep it.