Skip to content

Instantly share code, notes, and snippets.

@kmaglione
Created April 30, 2017 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmaglione/6aca9edfc4c3351734d91c0964827dfb to your computer and use it in GitHub Desktop.
Save kmaglione/6aca9edfc4c3351734d91c0964827dfb to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import io
import sys
import lz4
MAGIC = b'mozLz40\0'
for path in sys.argv[1:]:
with io.open(path, 'rb') as f:
magic = f.read(len(MAGIC))
if magic != MAGIC:
raise Exception('Bad magic number')
print(lz4.decompress(f.read()).decode("utf-8"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment