Skip to content

Instantly share code, notes, and snippets.

View Byteflux's full-sized avatar
☂️

Matthew Harris Byteflux

☂️
View GitHub Profile
@Byteflux
Byteflux / ip2asn.php
Last active September 24, 2021 03:40
<?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';
@Byteflux
Byteflux / uuidconvert.py
Last active August 29, 2015 13:59
python uuidconvert.py <worldpath>
import sys
import os
import math
import urllib2
import json
import time
import shutil
import uuid
from nbt import nbt # pip install nbt