Skip to content

Instantly share code, notes, and snippets.

@will-h
Created June 25, 2015 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save will-h/7637c340b28614cced8a to your computer and use it in GitHub Desktop.
Save will-h/7637c340b28614cced8a to your computer and use it in GitHub Desktop.
pdb_check.py - verify list of ASNs in peeringdb
#!/usr/bin/env python
import json,urllib2
live_asn = set()
f = open('asn-20150625', 'r')
for line in f:
live_asn.add(int(line.strip()))
file_url = urllib2.urlopen("https://beta.peeringdb.com/api/asn")
netlist=json.loads(file_url.read())
pdb_asn = set()
for c in netlist["data"]:
pdb_asn.add(c['asn'])
print "Live ASN count %i" % ( len(live_asn) )
print "PDB ASN count %i" % ( len(pdb_asn) )
dead_asn = pdb_asn - live_asn
print "Dead ASNs %i" % ( len(dead_asn) )
dead_asn_list=list(dead_asn)
dead_asn_list.sort()
print dead_asn_list
@will-h
Copy link
Author

will-h commented Jun 25, 2015

Live ASN count 50852
PDB ASN count 4965
Dead ASNs 362
[1304, 1424, 1784, 2470, 2499, 2915, 3064, 3248, 3669, 3937, 4280, 4355, 4558, 4691, 4716, 4874, 5407, 5462, 5512, 5533, 5557, 5560, 6086, 6320, 6435, 6447, 6656, 6760, 6770, 6777, 6779, 6850, 6851, 7606, 7615, 8195, 8289, 8330, 8404, 8481, 8514, 8527, 8582, 8833, 8912, 8939, 9033, 9132, 9191, 9563, 9592, 10075, 10133, 10565, 10654, 11456, 11622, 11682, 11726, 11739, 12284, 12293, 12295, 12359, 12452, 12528, 12634, 12932, 13049, 13571, 13646, 13680, 13681, 13770, 13890, 14026, 14558, 14939, 14970, 15101, 15266, 15331, 15837, 16090, 16237, 16318, 16810, 17106, 17170, 17346, 17409, 17579, 17824, 18104, 18599, 18740, 18804, 19148, 19297, 19475, 19607, 19835, 19996, 20121, 20225, 20388, 20639, 20679, 20680, 20721, 20825, 20834, 20920, 20923, 21055, 21501, 21640, 21788, 22212, 22222, 22546, 22730, 23452, 23958, 24025, 24115, 24518, 24736, 25041, 25108, 25137, 25295, 25388, 25976, 26067, 26162, 26193, 26299, 26473, 26627, 26888, 27194, 28056, 28168, 28182, 28373, 28632, 28753, 28796, 29158, 29260, 29279, 29444, 29590, 29737, 29752, 29881, 29958, 29965, 30092, 30751, 30913, 31157, 31196, 31210, 31265, 31339, 31458, 31523, 31625, 31898, 32272, 32299, 32522, 32586, 33108, 33258, 33472, 33713, 34109, 34159, 34242, 34313, 34486, 34567, 34692, 34763, 34806, 34899, 34932, 35002, 35070, 35090, 35112, 35217, 35381, 35406, 35591, 35616, 35655, 35746, 35751, 36217, 36561, 36824, 37986, 38181, 38190, 38281, 38550, 38670, 38828, 39117, 39196, 39469, 39520, 39556, 39615, 39626, 39721, 39757, 40253, 40426, 41029, 41039, 41045, 41197, 41255, 41529, 41666, 42476, 42492, 42615, 42737, 42784, 42856, 42884, 42937, 43252, 43388, 43395, 43457, 43500, 44146, 44259, 44706, 44916, 44935, 45180, 45435, 45482, 45483, 45646, 45831, 46064, 46281, 46337, 46584, 46907, 47228, 47358, 47670, 47856, 47880, 48335, 48920, 48925, 49202, 49249, 49432, 49625, 49629, 49695, 50152, 50189, 50206, 50370, 51025, 51344, 51446, 51706, 52549, 52863, 52919, 54049, 54299, 55452, 55518, 55800, 55822, 56049, 56662, 56723, 56824, 56943, 57048, 57151, 57433, 57511, 58119, 58389, 58531, 59344, 59384, 59899, 60079, 60666, 60700, 60897, 60983, 61126, 61374, 61721, 62131, 62288, 62805, 62972, 63028, 63034, 63212, 63516, 64597, 64952, 65537, 99993, 99995, 99996, 99997, 99998, 99999, 131299, 131997, 132087, 132111, 132536, 132869, 133073, 133637, 133678, 133702, 133748, 162109, 193324, 196650, 197413, 198026, 199036, 199344, 200983, 201061, 262193, 262405, 265304, 327698, 327788, 393218, 393269, 393565, 393752, 393853, 393945, 666666]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment