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
# -*- coding: utf-8 -*- | |
# @author: Peter Lamut | |
import argparse | |
import os | |
import shutil | |
N = 10 # the number of files in seach subfolder folder | |
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 zupo on github. | |
* I am zupo (https://keybase.io/zupo) on keybase. | |
* I have a public key whose fingerprint is E4CA E085 0676 59ED 9941 E22F E1C6 33AA 9CA8 64B9 | |
To claim this, I am signing this object: |
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
CIDRs = { | |
'1': '128.0.0.0', | |
'2': '192.0.0.0', | |
'3': '224.0.0.0', | |
'4': '240.0.0.0', | |
'5': '248.0.0.0', | |
'6': '252.0.0.0', | |
'7': '254.0.0.0', | |
'8': '255.0.0.0', | |
'9': '255.128.0.0', |
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
from lxml import html | |
import requests | |
COUNTRIES = [ | |
# 'United States', | |
'Austria', | |
'Germany', | |
'Hungary', | |
'Italy', | |
'Luxembourg', |
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 dns.resolver | |
from tomorrow import threads | |
@threads(100) | |
def mx(id_, domain): | |
try: | |
dns.resolver.query(domain, 'MX') | |
return False | |
except dns.resolver.NoAnswer: |
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
#!/usr/bin/python | |
"""How many Alexa top 1 million sites are using self-hosted nameservers? | |
top.csv is downloaded from Alexa: http://s3.amazonaws.com/alexa-static/top-1m.csv.zip | |
""" | |
import gevent.monkey | |
gevent.monkey.patch_all() | |
import gevent | |
from gevent import Greenlet |
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
#!/usr/bin/python | |
"""How many Alexa top 1 million sites have German (.de) nameservers? | |
top.csv is downloaded from Alexa: http://s3.amazonaws.com/alexa-static/top-1m.csv.zip | |
""" | |
import gevent.monkey | |
gevent.monkey.patch_all() | |
import gevent | |
from gevent import Greenlet |
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
#!/usr/bin/python | |
"""How many Alexa top 1 million sites have self.hosted nameservers? | |
top.csv is downloaded from Alexa: http://s3.amazonaws.com/alexa-static/top-1m.csv.zip | |
""" | |
import gevent.monkey | |
gevent.monkey.patch_all() | |
import gevent | |
from gevent import Greenlet |
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
""" | |
* Put this code into home.py | |
* Install Pyramid. | |
* Run ``$ python home.py``. | |
* Point your browser to http://localhost:8080/ | |
""" | |
from wsgiref.simple_server import make_server | |
from pyramid.config import Configurator | |
from pyramid.response import Response |
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
""" | |
* Put this code into home.py | |
* Install Pyramid. | |
* Run ``$ python home.py``. | |
* Point your browser to http://localhost:8080/ | |
* Make a POST request with curl: $ curl --data "" http://localhost:8080/ | |
""" | |
from wsgiref.simple_server import make_server | |
from pyramid.config import Configurator |
OlderNewer