Skip to content

Instantly share code, notes, and snippets.

@ZeppLu
ZeppLu / serve_http.py
Last active May 16, 2024 21:25
Simple Python HTTP Server with multi-threading, partial-content, basic authentication and IPv6 support
#!/usr/bin/env python3
# Standard library imports.
from socketserver import ThreadingMixIn
from http.server import HTTPServer, SimpleHTTPRequestHandler
import sys
import json
import os
from os.path import (join, exists, dirname, abspath, isabs, sep, splitext,
isdir, basename, expanduser, split, splitdrive)
@venuatu
venuatu / metadata_to_perm.py
Last active December 17, 2020 03:03
A script to transform set_metadata into set_perm (for recoveries that don't support the former)
#!/usr/bin/env python
## Transform set_metadata into set_perm (for recoveries that don't support the former)
# Usage: metadata_to_perm.py file
import sys, re
try:
file = open(sys.argv[1])
except:
print('unable to open file')
exit(1)