Last active
September 14, 2022 13:48
-
-
Save rikonor/dd9c3faf685e952f1b0b575889dbd906 to your computer and use it in GitHub Desktop.
Generate empty mmdb files
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
# run 'mcpan MaxMind::DB::Writer::Tree' beforehand | |
use MaxMind::DB::Writer::Tree; | |
use Net::Works::Network; | |
my %types = (); | |
my $tree = MaxMind::DB::Writer::Tree->new( | |
ip_version => 4, | |
record_size => 24, | |
database_type => 'Empty', | |
description => { en => 'Empty database' }, | |
map_key_type_callback => sub { $types{ $_[0] } }, | |
); | |
open my $fh, '>:raw', 'GeoLite2-Empty.mmdb'; | |
$tree->write_tree($fh); |
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
mmdblookup \ | |
--file GeoLite2-Empty.mmdb \ | |
--ip 0.0.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment