Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""
This is a quick and dirty script to find btrfs blocks that have certain properties.
It does this by parsing the output produced by "btrfs inspect-internal dump-tree"
and outputs virtual byte ranges as used by the vrange option of "btrfs balance start"
I needed this to re-balance blocks that were not on a specific device of my btrfs
raid1 after it became full and I added a new drive. If you need it for something
else your mileage may vary.
@fr3aker
fr3aker / electrum-backdoor.diff
Created November 24, 2017 20:23
diff for backdoored electrum available on electrum-wallet [dot] com
Only in electrum-backdoored-2.7.12: build
Only in electrum-2.7.12: contrib
Only in electrum-backdoored-2.7.12: dist
Only in electrum-backdoored-2.7.12: Electrum.egg-info
Only in electrum-2.7.12: electrum-env
Only in electrum-2.7.12: electrum.icns
Only in electrum-2.7.12: .gitignore
Only in electrum-backdoored-2.7.12/gui: __init__.pyc
Only in electrum-2.7.12/gui/kivy: data
Only in electrum-2.7.12/gui/kivy: main.kv
@fr3aker
fr3aker / fixnewsql.py
Created October 25, 2014 22:24
very quick and dirty script to fix the new.sql file for Life is Feudal: Your Own server
#!/usr/bin/env python3
f = open("new.sql", "r")
content = f.read()
lines = content.split("\n")
i = 0
# find all BEGIN statements for a CREATE
beginsInLines = list()
@fr3aker
fr3aker / MaintenanceHTTPServer.py
Last active August 29, 2015 14:07
very simple http maintenance server
#!/usr/bin/env python3
import http.server
def createHandler(message=None, content=None):
errnum = 503
class ErrorHandler(http.server.BaseHTTPRequestHandler):
error_message_format = """\
<!DOCTYPE html>
<html>