Skip to content

Instantly share code, notes, and snippets.

@louishot
louishot / proxycache.py
Created June 3, 2017 08:40 — forked from jkjuopperi/proxycache.py
nginx proxy cache listing and purging tool in python
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
from collections import namedtuple
CacheFile = namedtuple('CacheFile', ['path', 'key'])
def read_cache_file(path):
with open(path, 'r') as f:
f.seek(0x28) # skip header
key_magic = f.read(6)