Skip to content

Instantly share code, notes, and snippets.

View SpareSimian's full-sized avatar

SpareSimian

  • San Pablo, CA, US
View GitHub Profile
@SpareSimian
SpareSimian / isc-leases-to-json.pl
Created March 7, 2022 03:57
Convert ISC dhcpd.leases file to JSON
#!/usr/bin/perl
use strict;
use warnings;
use JSON;
use experimental qw(switch);
my %leases;
my %current_lease;
my $current_lease_ip;
@SpareSimian
SpareSimian / BuildAllVC16.cmd
Created April 11, 2021 18:08
Build all variants of wxWidgets for Visual Studio 2019
@rem build all variations for VC16
@rem if running on 32 bit, we need to use the cross compiler for 64 bit
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set "OSWIDTH=32BIT" || set "OSWIDTH=64BIT"
if "%OSWIDTH%"=="32BIT" set VSAMD64=x86_amd64
if "%OSWIDTH%"=="64BIT" set VSAMD64=amd64
if "%OSWIDTH%"=="" exit /B 1
@echo using %VSAMD64% for 64 bit builds
@SpareSimian
SpareSimian / ipdeny-to-NonUS.py
Created August 2, 2019 20:25
Non-US ipset from whois database via ipdeny website
#!/usr/bin/env python
# See http://www.ipdeny.com/ipblocks/
# allow function-like print when using Python 2
from __future__ import print_function
import argparse
import requests
import io
@SpareSimian
SpareSimian / aws-ip-ranges-to-zones.py
Created June 6, 2019 17:32
Dump AWS netblocks into zone files for use as ipsets
#!/usr/bin/env python
# download the current Amazon AWS list of netblocks and dump it into
# two files, one each for IPv4 and IPv6. The result can be imported
# into firewalld ipsets using --add-entries-from-file
import requests
ipv4_filename = 'AmazonAWS_ipv4.zone'
ipv6_filename = 'AmazonAWS_ipv6.zone'
@SpareSimian
SpareSimian / BuildBoost.cmd
Created April 13, 2019 05:16
Build Boost binary libraries with several Visual Studio versions
@rem build all variants needed of Boost library
@rem debug/release, static/dynamic CRT linkage, 32/64 bit
@rem vc10/vc12/vc14/vc141/vc142
@rem run from %boost_root% directory
pushd %boost_root%
call .\bootstrap.bat --without-python
@rem Visual Studio 2019