mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 02:44:21 +02:00
Merge branch 'master' of github.com:research/chocolate
This commit is contained in:
+3
-5
@@ -1,10 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import pygeoip
|
import pygeoip, random
|
||||||
geoip = pygeoip.GeoIP('GeoIP.dat', pygeoip.MEMORY_CACHE)
|
geoip = pygeoip.GeoIP('GeoIP.dat', pygeoip.MEMORY_CACHE)
|
||||||
|
|
||||||
allrouters = []
|
allrouters = []
|
||||||
exits = []
|
exits = []
|
||||||
|
by_country = {}
|
||||||
|
|
||||||
for L in open("/var/lib/tor/cached-consensus"):
|
for L in open("/var/lib/tor/cached-consensus"):
|
||||||
if L.startswith("s "):
|
if L.startswith("s "):
|
||||||
@@ -17,10 +18,7 @@ for L in open("/var/lib/tor/cached-consensus"):
|
|||||||
|
|
||||||
duplicates = set(e[0] for e in exits if allrouters.count(e[0]) != 1)
|
duplicates = set(e[0] for e in exits if allrouters.count(e[0]) != 1)
|
||||||
|
|
||||||
print "All the good stable exits with unique names:"
|
|
||||||
print
|
|
||||||
|
|
||||||
for exit in exits:
|
for exit in exits:
|
||||||
name, ip, flags = exit
|
name, ip, flags = exit
|
||||||
if name not in duplicates:
|
if name not in duplicates:
|
||||||
print name, ip, geoip.country_code_by_addr(ip)
|
by_country.setdefault(geoip.country_code_by_addr(ip), []).append(name)
|
||||||
Reference in New Issue
Block a user