moved to: https://github.com/pengelana/blocklist/wiki/DNSCrypt
This file contains 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
$ python3 -m timeit -n 1000000 -r 5 -v 'dict()' | |
raw times: 1.25 1.2 1.2 1.2 1.2 | |
1000000 loops, best of 5: 1.2 usec per loop | |
$ python3 -m timeit -n 1000000 -r 5 -v '{}' | |
raw times: 0.375 0.368 0.375 0.375 0.372 | |
1000000 loops, best of 5: 0.368 usec per loop | |
This file contains 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
In [132]: def test1(): | |
...: with open('domain.txt') as f: | |
...: data = {} | |
...: for x in f: | |
...: length = len(x.strip().split('.')) | |
...: data[length] = 1 if not length in data else data[length] + 1 | |
...: return data | |
...: | |
In [133]: def test(): |
This file contains 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
curl -si 'https://ip-ranges.amazonaws.com/ip-ranges.json' | grep 'ip_prefix' | awk '{print $NF}' | sed 's/[",]//g' | xargs -n1 /sbin/ipset add blacklist | |
curl -si 'https://ip-ranges.amazonaws.com/ip-ranges.json' | grep 'ipv6_prefix' | awk '{print $NF}' | sed 's/[",]//g' | xargs -n1 /sbin/ipset add blacklist |
This file contains 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
b = 'yv4BAAABAAAAAAABAAACAAEAACkQAAAAAAAAFAAMABB9QMeJo7kUaHV_uiVmzgYb' | |
DNSRecord.parse(binascii.unhexlify(base64.urlsafe_b64decode('{}{}'.format(b, '=' * (len(b)%4))).encode('hex'))) | |
from dns import message | |
from base64 import urlsafe_b64decode | |
print(message.from_wire(urlsafe_b64decode(b.encode()))) |
This file contains 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 requests | |
try: | |
from hyper.contrib import HTTP20Adapater as HTTPAdapater | |
except ImportError: | |
from requests.adapters import HTTPAdapter | |
session = requests.Session() | |
session.mount('https://', HTTP20Adapter(max_retries=3)) | |
r = session.get('https://www.instagram.com/') |
This file contains 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
/* cacheall */ | |
async function handleRequest(event) { | |
let request = event.request | |
let cacheKey = request | |
let url = new URL(request.url) | |
if (request.method.toUpperCase() === 'POST') { | |
let string = ''; | |
(new Uint8Array(await request.arrayBuffer())).forEach( |
This file contains 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
# https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml | |
# Type 129 - Echo Reply | |
tcpdump -ni eth0 'ip6[40:2] == 0x8000' | |
# Type 128 - Echo Request | |
tcpdump -ni eth0 'ip6[40:2] == 0x8100' | |
# Type 135 - Neighbor Solicitation | |
tcpdump -ni eth0 'ip6[40:2] == 0x8700' |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am pengelana on github. | |
* I am tiarap (https://keybase.io/tiarap) on keybase. | |
* I have a public key ASAnYmoLaAs-PV3xnkd-RskcwJ1Tkhbxj3vABqHUEg6qMAo | |
To claim this, I am signing this object: |
OlderNewer