Skip to content

Instantly share code, notes, and snippets.

@avian2
avian2 / check-firefox-passwords.py
Last active February 26, 2017 18:31
Check saved Firefox passwords against the list of domains that use Cloudflare
#!/usr/bin/python3
import glob
import json
import sys
import os
from urllib.parse import urlparse
# download from https://github.com/pirate/sites-using-cloudflare/
cloudflare_tlds = frozenset(map(lambda x:x.strip(),
open("sites-using-cloudflare-master/sorted_unique_cf.txt")))
/* Why do this ... */
load: function(url) {
setTimeout(function () { doload(url) }, 1);
}
doload: function (url) {
/* synchronous XHR */
xhr.open("GET", url, false);
xhr.send(null);
import sys
from_string = sys.argv[1]
to_string = sys.argv[2]
with open("input.txt") as f:
text = f.read()
text = text.replace(from_string, to_string)