Article View: news.software.nntp
Article #48241Re: Freenix trends 2000-07
From: Iain Lea
Date: Sat, 02 Sep 2000 11:56
Date: Sat, 02 Sep 2000 11:56
314 lines
9184 bytes
9184 bytes
Sven Paulus <sven@karlsruhe.org> wrote:
> This is an attempt to revive Iain Lea's idea of assembling Freenix
> trends. The numbers listed are Pierre Beyssac's Freenix Top 1000
> (see http://www.top1000.org) rankings of the last six months.
Just popped in and by sheer chance read this so here is the script
I wrote but never got round to posting for some strange reason...
probably something todo with having no private life anymore since
I changed jobs :)
Iain
PS. there is a harness script at the end of the message you will also need.
--snip trend1000.pl snip--
#!/usr/local/bin/perl5
#
# ABSOLUTELY NO WARRANTY WITH THIS PACKAGE. USE IT AT YOUR OWN RISK.
#
# Parse last N months of Freenix top1000 list and find emerging servers.
#
# trend1000.pl v1.03 19990306 Iain Lea iain@bricbrac.de
#
# Find trends on following:
# number of places up/down (default: 5)
# percent of places up/down (default: 5%)
# constantly placed ie. 10 10 10 10 10 10
#
# Format:
# Name Month1 Month2 Month3 Month4..MonthN
# newsfeed.internetmci.com 1 1 2 1 1
# howland.erols.net 2 3 3 3 4
# cpk-news-hub1.bbnplanet.com 3 2 1 2 2
# news.maxwell.syr.edu 4 4 5 5 3
# news-peer.gip.net 5 5 4 4 6
#
# Todo:
# - With -D option put top5 servers as well and then a line ...
# - traceroute of all TopN servers if at least 2 '.'s in pathname
#
# ChangeLog:
# 1.03
# - Fixed offset by 1 for headings
require 'getopts.pl';
# matched as /\.$Domain$/
@DomainList = (
"at",
"ch",
"de",
"csl-gmbh.net",
"dnsg.net",
"ecore.net",
"ecrc.net",
"easynews.net",
"esib.net",
"newsfeed.austria.eu.net",
"eurocyber.net",
"Austria.EU.net",
"frankfurt.de.uu.net",
"germany.net",
"gigabell.net",
"gtn.com",
"individual.net",
"ipf.net",
"is-europe.net",
"ivm.net",
"maz.net",
"mik.net",
"mediaways.net",
"ndh.net",
"noris.net",
"omnilink.net",
"profi.net",
"roka.net",
"seicom.net",
"space.net",
"sub.net",
"touch.net",
"unlisys",
"de.uu.net",
"xlink.net",
"zeitung-online.net",
"karlsruhe.org",
);
$Version = 'v1.03';
$ScriptName = 'trend1000.pl';
$FtpUrl = "ftp://ftp.bricbrac.de/pub/";
#
$Top1000Dir = "/news/top1000";
$DomainOnly = "";
$HostOnly = "";
$NumMonths = 0;
$MaxMonths = 7;
$MaxMovers = 25;
$JmpMovers = 25;
$TopNonly = 0;
$UseDomainList = 0;
$Verbose = 0;
#
$| = 1;
&ParseCmdLine ($0);
opendir (DIR, $Top1000Dir);
@Files = grep (/top[0-9]*.html/, readdir (DIR));
closedir (DIR);
foreach $File (reverse sort @Files) {
if ($NumMonths < $MaxMonths) {
print "Parsing $File\n" if $Verbose;
open (FILE, "$Top1000Dir/$File") || die "Error: $Top1000Dir/$File - $!\n";
if ($File =~ /^top(\d+)\./) {
$MonthList[$NumMonths] = $1;
}
while (<FILE>) {
chop;
if (/^\s+(\d+)\s+([0-9\.]*)\s+(.*)$/) {
($Rank, $Weight, $Host) = ($1, $2, $3);
$HostList[$Rank] = $Host if !$NumMonths;
$FreenixList{$Host}->{Rank}->[$NumMonths] = $Rank;
$FreenixList{$Host}->{Weight}->[$NumMonths] = $Weight;
}
}
close (FILE);
}
$NumMonths++;
}
#
# TopN movers
#
if ($TopNonly) {
printf "%-35s", "Pathname (Top $MaxMovers with jump of $JmpMovers)";
foreach $Num (0..($MaxMonths - 1)) {
printf " %5s", $MonthList[$Num];
}
print "\n-----------------------------------";
foreach $Num (0..($MaxMonths - 1)) {
print "------";
}
print "\n\n";
$Num = 0;
foreach $Host (@HostList) {
if ($Num < $MaxMovers && ($FreenixList{$Host}->{Rank}->[0] + $JmpMovers) < $FreenixList{$Host}->{Rank}->[1]) {
if ($DomainOnly eq "" || $Host =~ /\.$DomainOnly$/) {
if ($PathOnly eq "" || $Host =~ /$PathOnly/) {
if ($Host && (! $UseDomainList || &CheckDomainList ($Host))) {
printf "%-35s", $Host;
foreach $Num (0..($MaxMonths - 1)) {
printf " %5s", $FreenixList{$Host}->{Rank}->[$Num];
}
print "\n";
$Num++;
}
}
}
}
}
print "\n";
}
#
# Top1000 list
#
if (! $TopNonly) {
printf "%-35s", "Pathname";
foreach $Num (0..($MaxMonths - 1)) {
printf " %5s", $MonthList[$Num];
}
print "\n-----------------------------------";
foreach $Num (0..($MaxMonths - 1)) {
print "------";
}
print "\n\n";
foreach $Host (@HostList) {
if ($DomainOnly eq "" || $Host =~ /\.$DomainOnly$/) {
if ($PathOnly eq "" || $Host =~ /$PathOnly/) {
if ($Host && (! $UseDomainList || &CheckDomainList ($Host))) {
printf "%-35s", $Host;
foreach $Num (0..($MaxMonths - 1)) {
printf " %5s", $FreenixList{$Host}->{Rank}->[$Num];
}
print "\n";
}
}
}
}
}
exit 0;
#############################################################################
#
#
sub ParseCmdLine
{
my ($ProgName) = @_;
&Getopts('d:Dhi:m:n:p:P:tv');
if ($opt_h) {
print <<EOT
$ScriptName $Version URL: $FtpUrl
Parse Freenix Top1000 lists for last N months and show top N movers.
Copyright 1998 Iain Lea (iain\@bricbrac.de)
Usage: $ProgName [options]
-h help
-d text display only entries matching specified domain ie. de
-D display only entries matching user specified domain list
-i num increment number between last 2 months (default: $JmpMovers)
-m num display last N months of results (default: $MaxMonths)
-n num number of entries to show in Top N list (default: $MaxMovers)
-p text display only entries matching partial pathname ie. ecrc
-P dir directory containing Freenix results (default: $Top1000Dir)
-t only display Top N list (and not the full Top1000 list)
-v verbose
EOT
;
exit 1;
}
$DomainOnly = $opt_d if (defined($opt_d));
$UseDomainList++ if (defined($opt_D));
$PathOnly = $opt_p if (defined($opt_p));
$JmpMovers = $opt_i if (defined($opt_i));
$MaxMonths = $opt_m if (defined($opt_m));
$MaxMovers = $opt_n if (defined($opt_n));
$Top1000Dir = $opt_P if (defined($opt_P));
$TopNonly++ if (defined($opt_t));
$Verbose++ if (defined($opt_v));
}
sub CheckDomainList
{
my ($Pathname) = @_;
# print "TEST [$Pathname]\n";
foreach $Domain (@DomainList) {
# print "TEST [$Pathname] =~ [$Domain]\n";
return 1 if ($Pathname =~ /\.$Domain$/);
}
return 0;
}
--snip trend1000.sh snip--
#!/bin/sh
#
# Trends of Freenix 1000 list
# MM=`date +%m`
# YY=`date +%Y`
MM=`cat /news/top1000/.month`
YY=`cat /news/top1000/.yearlong`
DIR1=/ftp/pub/news/freenix
DIR2=/www
FILE1=trends-DE-$YY$MM.txt
FILE2=trends-ALL-$YY$MM.txt
FILE3=freenix-trends-$YY$MM.html
TREND=/usr/local/bin/trend1000.pl
cd $DIR1
$TREND -D > $FILE1
ln -sf $FILE1 trends-DE.txt
mail -s "FREENIX: *.at *.ch *.de listing" iain@bricbrac.de < $FILE1
$TREND > $FILE2
ln -sf $FILE2 trends.txt
ln -sf $FILE2 trends-ALL.txt
cd $DIR2
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">' > $FILE3
echo '<head>' >> $FILE3
echo '<title>BricBrac Consulting - Design . Build . Operate</title>' >> $FILE3
echo '</head>' >> $FILE3
echo '<body bgcolor="#FFFFFF" text="#000000">' >> $FILE3
echo '<p>' >> $FILE3
echo '<center><b>' >> $FILE3
echo '<a href="/">BricBrac Consulting</a> . +49-9131-990622 . Fax +49-9131-990624 . <a href="mailto:info@bricbrac.de">info@bricbrac.de</a>' >> $FILE3
echo '</b></center>' >> $FILE3
echo '<hr>' >> $FILE3
echo '<font size=-1>' >> $FILE3
echo '<pre>' >> $FILE3
cat $DIR1/$FILE2 >> $FILE3
echo '</pre>' >> $FILE3
echo '</font>' >> $FILE3
echo '<hr>' >> $FILE3
echo '<center><b>' >> $FILE3
echo '<a href="/">BricBrac Consulting</a> . +49-9131-990622 . Fax +49-9131-990624 . <a href="mailto:info@bricbrac.de">info@bricbrac.de</a>' >> $FILE3
echo '</b></center>' >> $FILE3
echo '</body>' >> $FILE3
echo '</html>' >> $FILE3
ln -sf $FILE3 freenix-trends.html
exit 0
Technical Details
Message-ID:
<GV5s5.1$MX2.205@news.ecrc.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!freenix!oleane.net!oleane!news-FFM2.ecrc.net!news.ecrc.de!not-for-mailReferences:
<Victor.Mockli@chins.pool52.oops.inka.de>Show Full Headers
Complete Article Headers
Message-ID: <GV5s5.1$MX2.205@news.ecrc.de> Subject: Re: Freenix trends 2000-07 Date: Sat, 02 Sep 2000 11:56:22 GMT From: Iain Lea <iain@netapp.com> References: <Victor.Mockli@chins.pool52.oops.inka.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!freenix!oleane.net!oleane!news-FFM2.ecrc.net!news.ecrc.de!not-for-mail Sender: Iain Lea <iain@mail.bricbrac.de> Newsgroups: news.software.nntp Followup-To: poster Organization: Network Appliance User-Agent: tin/pre-1.4-980226 (UNIX) (Linux/2.0.33 (sparc)) Lines: 313 NNTP-Posting-Host: 195.27.61.135 X-Complaints-To: news@ecrc.de X-Trace: news.ecrc.de 967895782 195.27.61.135 (Sat, 02 Sep 2000 13:56:22 MET DST) NNTP-Posting-Date: Sat, 02 Sep 2000 13:56:22 MET DST