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
<?php | |
// ip2asn.php?ip=IP_OR_HOSTNAME : Returns a comma-separated list of matching ASNs | |
// ip2asn.php?asn=AS_NUMBER : Returns the organization name | |
// ip2asn.php?update=1&token=SECRET_TOKEN : Updates the local database (setup cron to run once a day) | |
$SECRET_TOKEN = 'ChangeMe'; | |
$TMP_DIR = '/tmp/ip2asn'; | |
$DATA_DIR = '/var/lib/ip2asn'; |
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 sys | |
import os | |
import math | |
import urllib2 | |
import json | |
import time | |
import shutil | |
import uuid | |
from nbt import nbt # pip install nbt |
NewerOlder