1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 10:25:42 -04:00

Update dbs

This commit is contained in:
Ryan Voots 2019-01-23 23:57:26 -05:00
parent b2c0569ddb
commit 32c00d1c9b
7 changed files with 47 additions and 5 deletions

BIN
asndb/GeoLite2-ASN-CSV.zip Normal file

Binary file not shown.

View file

@ -0,0 +1 @@
Database and Contents Copyright (c) 2018 MaxMind, Inc.

View file

@ -0,0 +1,3 @@
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
This database incorporates GeoNames [http://www.geonames.org] geographical data, which is made available under the Creative Commons Attribution 3.0 License. To view a copy of this license, visit http://www.creativecommons.org/licenses/by/3.0/us/.

1
asndb/get.sh Normal file
View file

@ -0,0 +1 @@
wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip

View file

@ -4,13 +4,16 @@ use strict;
use warnings; use warnings;
use autodie; use autodie;
use DBI; use DBI;
use Net::CIDR;
use Data::Dumper;
sub fmtip($) { sub fmtip($) {
my $ip = shift; my $ip = shift;
sprintf "%03d.%03d.%03d.%03d", split(/\./, $ip); sprintf "%03d.%03d.%03d.%03d", split(/\./, $ip);
} }
open(my $tsv, "<", "ip2asn-v4.tsv"); open(my $tsv, "<", "GeoLite2-ASN-Blocks-IPv4.csv");
my $dbh = DBI->connect("dbi:SQLite:dbname=../var/asn.db", "", "", {RaiseError => 1}); my $dbh = DBI->connect("dbi:SQLite:dbname=../var/asn.db", "", "", {RaiseError => 1});
@ -31,7 +34,11 @@ my $insert_sth = $dbh->prepare("INSERT INTO asn (start, end, asn, country, desc)
while (my $line = <$tsv>) { while (my $line = <$tsv>) {
chomp $line; chomp $line;
my ($start, $end, $asn, $country, $desc) = split /\t/, $line; my ($cidr, $asn, $desc) = split /,/, $line, 3;
my ($range) = Net::CIDR::cidr2range($cidr);
my ($start, $end) = split('-', $range);
my $country = "UNK";
# print Dumper({cidr => $cidr, asn => $asn, range => $range, start => $start, end => $end});
next if $asn eq 0; next if $asn eq 0;
printf "%s - %s\n", fmtip($start), fmtip($end); printf "%s - %s\n", fmtip($start), fmtip($end);
$insert_sth->execute(fmtip $start, fmtip $end, $asn, $country, $desc); $insert_sth->execute(fmtip $start, fmtip $end, $asn, $country, $desc);

View file

@ -74,7 +74,7 @@ http_plugin_port 1092
ignore EvanCarol ignore EvanCarol
ignore EC ignore EC
server localhost server 192.168.32.1
username perlbot username perlbot
password sindarin password sindarin
port 65432 port 65432
@ -88,7 +88,7 @@ http_plugin_port 1092
ignore purl ignore purl
ignore perlbot ignore perlbot
server localhost server 192.168.32.1
username perlbot-magnet username perlbot-magnet
password sindarin password sindarin
port 65432 port 65432
@ -101,9 +101,21 @@ http_plugin_port 1092
ignore purl ignore purl
ignore perlbot ignore perlbot
server localhost server 192.168.32.1
username perlbot-oftc username perlbot-oftc
password sindarin password sindarin
port 65432 port 65432
root_mask ~simcop238@simcop2387.info root_mask ~simcop238@simcop2387.info
</bot> </bot>
<bot perlbot-efnet>
channel \#perl
ignore purl
ignore perlbot
server 192.168.32.1
username perlbot-efnet
password sindarin
port 65432
root_mask ~simcop238@simcop2387.info
</bot>

View file

@ -16,6 +16,8 @@ server "*" {
channel "#perl" { channel "#perl" {
plugin "eval" {addressed: false; } plugin "eval" {addressed: false; }
plugin "deparse" {addressed: false; } plugin "deparse" {addressed: false; }
plugin "perldoc" {addressed: false; }
plugin "corelist" {addressed: false; }
} }
channel "#perl6" { channel "#perl6" {
plugin "eval" {addressed: false; } plugin "eval" {addressed: false; }
@ -23,6 +25,7 @@ server "*" {
channel "#perl-help" { channel "#perl-help" {
plugin "eval" {addressed: false; } plugin "eval" {addressed: false; }
plugin "deparse" {addressed: false; } plugin "deparse" {addressed: false; }
plugin "perldoc" {addressed: false; }
} }
channel "#perl-cats" { channel "#perl-cats" {
plugin "eval" {addressed: false; } plugin "eval" {addressed: false; }
@ -32,10 +35,17 @@ server "*" {
plugin "eval" {addressed: false; } plugin "eval" {addressed: false; }
plugin "deparse" {addressed: false; } plugin "deparse" {addressed: false; }
plugin "badfacts" {addressed: false; } plugin "badfacts" {addressed: false; }
plugin "perldoc" {addressed: false; }
} }
channel "#buubot" { channel "#buubot" {
plugin "eval" {addressed: false; } plugin "eval" {addressed: false; }
plugin "deparse" {addressed: false; } plugin "deparse" {addressed: false; }
plugin "perldoc" {addressed: false; }
}
channel "#perlcafe" {
plugin "perldoc" {addressed: false; }
plugin "eval" {addressed: false; }
plugin "deparse" {addressed: false; }
} }
} }
server "*.freenode.net" { server "*.freenode.net" {
@ -72,4 +82,12 @@ server "*.freenode.net" {
} }
plugin "default" {plugin: "factoids"; } plugin "default" {plugin: "factoids"; }
} }
channel "#lpmc" {
plugin "eval" {addressed: false; }
plugin "deparse" {addressed: false; }
}
channel "#learnprogramming" {
plugin "eval" {addressed: false; }
plugin "deparse" {addressed: false; }
}
} }