diff --git a/asndb/GeoLite2-ASN-CSV.zip b/asndb/GeoLite2-ASN-CSV.zip new file mode 100644 index 0000000..448923f Binary files /dev/null and b/asndb/GeoLite2-ASN-CSV.zip differ diff --git a/asndb/GeoLite2-ASN-CSV_20181204/COPYRIGHT.txt b/asndb/GeoLite2-ASN-CSV_20181204/COPYRIGHT.txt new file mode 100644 index 0000000..4683417 --- /dev/null +++ b/asndb/GeoLite2-ASN-CSV_20181204/COPYRIGHT.txt @@ -0,0 +1 @@ +Database and Contents Copyright (c) 2018 MaxMind, Inc. diff --git a/asndb/GeoLite2-ASN-CSV_20181204/LICENSE.txt b/asndb/GeoLite2-ASN-CSV_20181204/LICENSE.txt new file mode 100644 index 0000000..8216b8f --- /dev/null +++ b/asndb/GeoLite2-ASN-CSV_20181204/LICENSE.txt @@ -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/. diff --git a/asndb/get.sh b/asndb/get.sh new file mode 100644 index 0000000..b9c6b2c --- /dev/null +++ b/asndb/get.sh @@ -0,0 +1 @@ +wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip diff --git a/asndb/mkasn.pl b/asndb/mkasn.pl index 4da440f..14abe69 100755 --- a/asndb/mkasn.pl +++ b/asndb/mkasn.pl @@ -4,13 +4,16 @@ use strict; use warnings; use autodie; use DBI; +use Net::CIDR; +use Data::Dumper; sub fmtip($) { my $ip = shift; 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}); @@ -31,7 +34,11 @@ my $insert_sth = $dbh->prepare("INSERT INTO asn (start, end, asn, country, desc) while (my $line = <$tsv>) { 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; printf "%s - %s\n", fmtip($start), fmtip($end); $insert_sth->execute(fmtip $start, fmtip $end, $asn, $country, $desc); diff --git a/etc/bb3.conf b/etc/bb3.conf index 820b95e..1651d4e 100644 --- a/etc/bb3.conf +++ b/etc/bb3.conf @@ -74,7 +74,7 @@ http_plugin_port 1092 ignore EvanCarol ignore EC - server localhost + server 192.168.32.1 username perlbot password sindarin port 65432 @@ -88,7 +88,7 @@ http_plugin_port 1092 ignore purl ignore perlbot - server localhost + server 192.168.32.1 username perlbot-magnet password sindarin port 65432 @@ -101,9 +101,21 @@ http_plugin_port 1092 ignore purl ignore perlbot - server localhost + server 192.168.32.1 username perlbot-oftc password sindarin port 65432 root_mask ~simcop238@simcop2387.info + + channel \#perl + + ignore purl + ignore perlbot + + server 192.168.32.1 + username perlbot-efnet + password sindarin + port 65432 + root_mask ~simcop238@simcop2387.info + diff --git a/etc/plugins.conf b/etc/plugins.conf index 8810e6e..e2f8f88 100644 --- a/etc/plugins.conf +++ b/etc/plugins.conf @@ -16,6 +16,8 @@ server "*" { channel "#perl" { plugin "eval" {addressed: false; } plugin "deparse" {addressed: false; } + plugin "perldoc" {addressed: false; } + plugin "corelist" {addressed: false; } } channel "#perl6" { plugin "eval" {addressed: false; } @@ -23,6 +25,7 @@ server "*" { channel "#perl-help" { plugin "eval" {addressed: false; } plugin "deparse" {addressed: false; } + plugin "perldoc" {addressed: false; } } channel "#perl-cats" { plugin "eval" {addressed: false; } @@ -32,10 +35,17 @@ server "*" { plugin "eval" {addressed: false; } plugin "deparse" {addressed: false; } plugin "badfacts" {addressed: false; } + plugin "perldoc" {addressed: false; } } channel "#buubot" { plugin "eval" {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" { @@ -72,4 +82,12 @@ server "*.freenode.net" { } plugin "default" {plugin: "factoids"; } } + channel "#lpmc" { + plugin "eval" {addressed: false; } + plugin "deparse" {addressed: false; } + } + channel "#learnprogramming" { + plugin "eval" {addressed: false; } + plugin "deparse" {addressed: false; } + } }