This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Modified Pi-hole script to generate a generic hosts file | |
| # for use with dnsmasq's addn-hosts configuration | |
| # original : https://github.com/jacobsalmela/pi-hole/blob/master/gravity-adv.sh | |
| # Address to send ads to. | |
| destinationIP="0.0.0.0" | |
| outlist='./final_blocklist' | |
| tempoutlist="$outlist.tmp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import bson | |
| import base64 | |
| """ | |
| Generate short id's from ObjectID's for use in url's or other applications. | |
| Id's are generated from the timestamp and counter of the ObjectId, with some slight variation. They should be reasonably unique. | |
| This is, unfortunately, a one-way function. It will reliably produce the same short id for the same ObjectId, but the operation can't be reversed (it is missing information about the machine id, process id, and most of the counter). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| bktree3.py, by phash | |
| Based on bktree.py by bearophile ( http://code.activestate.com/recipes/572156-bk-tree/ ) | |
| Fixed for python 3 | |
| Fast Levenshtein distance and BK-tree implementations in Python. | |
| """ | |
| def editDistance(s1, s2): | |
| """Computes the Levenshtein distance between two arrays (strings too). |