mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 10:25:42 -04:00
Update dbs
This commit is contained in:
parent
b2c0569ddb
commit
32c00d1c9b
7 changed files with 47 additions and 5 deletions
BIN
asndb/GeoLite2-ASN-CSV.zip
Normal file
BIN
asndb/GeoLite2-ASN-CSV.zip
Normal file
Binary file not shown.
1
asndb/GeoLite2-ASN-CSV_20181204/COPYRIGHT.txt
Normal file
1
asndb/GeoLite2-ASN-CSV_20181204/COPYRIGHT.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Database and Contents Copyright (c) 2018 MaxMind, Inc.
|
3
asndb/GeoLite2-ASN-CSV_20181204/LICENSE.txt
Normal file
3
asndb/GeoLite2-ASN-CSV_20181204/LICENSE.txt
Normal 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
1
asndb/get.sh
Normal file
|
@ -0,0 +1 @@
|
|||
wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip
|
|
@ -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);
|
||||
|
|
18
etc/bb3.conf
18
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
|
||||
</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>
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue