From: djk Date: Tue, 15 Jun 1999 09:19:17 +0000 (+0000) Subject: 1. added grepdbg program (so you can search your debug files and get times X-Git-Tag: R_1_30~16 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=9da1742219a27b1c02fd57794412088e4d7b3d1d;p=spider.git 1. added grepdbg program (so you can search your debug files and get times and dates of incidents). 2. Moved DXVars.pm to DXVars.pm.issue to force new users to cp it to their local directory. 3. added $allowzero to DXProt to allow thru PC19s with zero protocol versions. --- diff --git a/Changes b/Changes index 67be5403..17d937a7 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,9 @@ +15Jun99======================================================================= +1. added grepdbg program (so you can search your debug files and get times +and dates of incidents). +2. Moved DXVars.pm to DXVars.pm.issue to force new users to cp it to their +local directory. +3. added $allowzero to DXProt to allow thru PC19s with zero protocol versions. 14Jun99======================================================================= 1. changed IO::File in help and apropos to IO::File 2. added a check for isa('DXNode') for PC50s diff --git a/perl/DXLog.pm b/perl/DXLog.pm index 8281e154..17559b36 100644 --- a/perl/DXLog.pm +++ b/perl/DXLog.pm @@ -31,7 +31,7 @@ require Exporter; use IO::File; use DXVars; -use DXDebug (); +# use DXDebug (); use DXUtil; use Julian; use Carp; @@ -53,7 +53,7 @@ sub new $ref->{'sort'} = $sort; # make sure the directory exists - mkdir($ref->{prefix}, 0777) if ! -e $ref->{prefix}; + mkdir($ref->{prefix}, 0777) unless -e $ref->{prefix}; return bless $ref; } @@ -83,7 +83,7 @@ sub open $self->{year} = $year; $self->{thing} = $thing; - DXDebug::dbg("dxlog", "opening $self->{fn}\n"); +# DXDebug::dbg("dxlog", "opening $self->{fn}\n"); return $self->{fh}; } diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 17328bc2..16b67023 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -31,7 +31,7 @@ use strict; use vars qw($me $pc11_max_age $pc11_dup_age $pc23_dup_age %spotdup %wwvdup $last_hour %pings %rcmds %nodehops @baddx $baddxfn $pc12_dup_age - %anndup); + %anndup $allowzero); $me = undef; # the channel id for this cluster $pc11_max_age = 1*3600; # the maximum age for an incoming 'real-time' pc11 @@ -385,6 +385,8 @@ sub normal my $call = uc $field[$i+1]; my $confmode = $field[$i+2]; my $ver = $field[$i+3]; + + $ver = 5400 if !$ver && $allowzero; # now check the call over my $node = DXCluster->get_exact($call); diff --git a/perl/DXVars.pm b/perl/DXVars.pm deleted file mode 100644 index ab43ca64..00000000 --- a/perl/DXVars.pm +++ /dev/null @@ -1,90 +0,0 @@ -# -# The system variables - those indicated will need to be changed to suit your -# circumstances (and callsign) -# -# Copyright (c) 1998 - Dirk Koopman G1TLH -# -# $Id$ -# - -package main; - -require Exporter; -@ISA = qw(Exporter); - -@EXPORT_OK = qw($mycall $myname $myalias $mylatitude $mylongtitude $mylocator - $myqth $myemail $myprot_version - $clusterport $clusteraddr $debugfn - $def_hopcount $data $system $cmd - $userfn $motd $local_cmd $mybbsaddr - $lang - $pc50_interval $user_interval - ); - - -# this really does need to change for your system!!!! -$mycall = "GB7DJK"; - -# your name -$myname = "Dirk"; - -# Your 'normal' callsign -$myalias = "G1TLH"; - -# Your latitude (+)ve = North (-)ve = South in degrees and decimal degrees -$mylatitude = +52.68584579; - -# Your Longtitude (+)ve = East, (-)ve = West in degrees and decimal degrees -$mylongitude = +0.94518260; - -# Your locator (yes I know I can calculate it - eventually) -$mylocator = "JO02LQ"; - -# Your QTH (roughly) -$myqth = "East Dereham, Norfolk"; - -# Your e-mail address -$myemail = "djk\@tobit.co.uk"; - -# Your BBS addr -$mybbsaddr = "G1TLH\@GB7TLH.#35.GBR.EU"; - -# the default language (the key used must match the one in the Messages file) -$lang = 'en'; - -# the tcp address of the cluster this can be an address of an ethernet port -# but this is more secure. For normal use this will be fine. -$clusteraddr = "localhost"; - -# the port number of the cluster (just leave this, unless it REALLY matters to you) -$clusterport = 27754; - -# your favorite way to say 'Yes' -$yes = 'Yes'; - -# your favorite way to say 'No' -$no = 'No'; - -# the interval between unsolicited prompts if not traffic -$user_interval = 11*60; - -# data files live in -$data = "$root/data"; - -# system files live in -$system = "$root/sys"; - -# command files live in -$cmd = "$root/cmd"; - -# local command files live in (and overide $cmd) -$localcmd = "$root/local_cmd"; - -# where the user data lives -$userfn = "$data/users"; - -# the "message of the day" file -$motd = "$data/motd"; - -# are we debugging ? -@debug = ('chan', 'state', 'msg', 'cron'); diff --git a/perl/DXVars.pm.issue b/perl/DXVars.pm.issue new file mode 100644 index 00000000..ab43ca64 --- /dev/null +++ b/perl/DXVars.pm.issue @@ -0,0 +1,90 @@ +# +# The system variables - those indicated will need to be changed to suit your +# circumstances (and callsign) +# +# Copyright (c) 1998 - Dirk Koopman G1TLH +# +# $Id$ +# + +package main; + +require Exporter; +@ISA = qw(Exporter); + +@EXPORT_OK = qw($mycall $myname $myalias $mylatitude $mylongtitude $mylocator + $myqth $myemail $myprot_version + $clusterport $clusteraddr $debugfn + $def_hopcount $data $system $cmd + $userfn $motd $local_cmd $mybbsaddr + $lang + $pc50_interval $user_interval + ); + + +# this really does need to change for your system!!!! +$mycall = "GB7DJK"; + +# your name +$myname = "Dirk"; + +# Your 'normal' callsign +$myalias = "G1TLH"; + +# Your latitude (+)ve = North (-)ve = South in degrees and decimal degrees +$mylatitude = +52.68584579; + +# Your Longtitude (+)ve = East, (-)ve = West in degrees and decimal degrees +$mylongitude = +0.94518260; + +# Your locator (yes I know I can calculate it - eventually) +$mylocator = "JO02LQ"; + +# Your QTH (roughly) +$myqth = "East Dereham, Norfolk"; + +# Your e-mail address +$myemail = "djk\@tobit.co.uk"; + +# Your BBS addr +$mybbsaddr = "G1TLH\@GB7TLH.#35.GBR.EU"; + +# the default language (the key used must match the one in the Messages file) +$lang = 'en'; + +# the tcp address of the cluster this can be an address of an ethernet port +# but this is more secure. For normal use this will be fine. +$clusteraddr = "localhost"; + +# the port number of the cluster (just leave this, unless it REALLY matters to you) +$clusterport = 27754; + +# your favorite way to say 'Yes' +$yes = 'Yes'; + +# your favorite way to say 'No' +$no = 'No'; + +# the interval between unsolicited prompts if not traffic +$user_interval = 11*60; + +# data files live in +$data = "$root/data"; + +# system files live in +$system = "$root/sys"; + +# command files live in +$cmd = "$root/cmd"; + +# local command files live in (and overide $cmd) +$localcmd = "$root/local_cmd"; + +# where the user data lives +$userfn = "$data/users"; + +# the "message of the day" file +$motd = "$data/motd"; + +# are we debugging ? +@debug = ('chan', 'state', 'msg', 'cron'); diff --git a/perl/Julian.pm b/perl/Julian.pm index 1316fb42..8b3b74fd 100644 --- a/perl/Julian.pm +++ b/perl/Julian.pm @@ -8,7 +8,6 @@ package Julian; -use DXDebug; use Carp; use strict; diff --git a/perl/Spot.pm b/perl/Spot.pm index 7302193a..cdd7393d 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -105,7 +105,7 @@ sub search my $ref; my $i; my $count; - my @today = Julian::unixtoj(time); + my @today = Julian::unixtoj(time()); my @fromdate; my @todate; diff --git a/perl/grepdbg b/perl/grepdbg new file mode 100755 index 00000000..c44fc92b --- /dev/null +++ b/perl/grepdbg @@ -0,0 +1,66 @@ +#!/usr/bin/perl +# +# Program to do a grep with dates and times on the debug +# files +# +# dispdbg [-nnn ...] +# +# the -nnn is the day you what to look at -1 is yesterday -0 is today +# and is optional if there is only one argument +# is the string, a caseless search is done +# +# + +require 5.004; + +# search local then perl directories +BEGIN { + # root of directory tree for this system + $root = "/spider"; + $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'}; + + unshift @INC, "$root/perl"; # this IS the right way round! + unshift @INC, "$root/local"; +} + +use DXVars; +use DXUtil; +use DXLog; + +use strict; + +use vars qw(@list $fp @today $string); + +$fp = DXLog::new('debug', 'dat', 'd'); +@today = Julian::unixtoj(time()); + +for my $arg (@ARGV) { + if ($arg =~ /^-/) { + $arg =~ s/^-//o; + push @list, $arg; + } else { + $string = $arg; + last; + } +} +die "usage: dispdbg [[-nnn] ..] \n" unless $string; + +push @list, "0" unless @list; +for my $entry (@list) { + my @now = Julian::sub(@today, $entry); + my $fh = $fp->open(@now); + my $line; + if ($fh) { + while (<$fh>) { + my $line = $_; + chomp $line; + if ($line =~ m{\Q$string}io) { + my @line = split '\^', $line; + my $t = shift @line; + print atime($t), ' ', join('^', @line), "\n"; + } + } + $fp->close(); + } +} +exit(0);