sources-request@mirror.UUCP (11/06/86)
Submitted by: seismo!rick (Rick Adams) Mod.sources: Volume 7, Issue 49 Archive-name: 2.11news/Part09 [ Notice the difference between the Part# in the title, and in the official archive name. --r$ ] Path: seismo!rick From: rick@seismo.CSS.GOV (Rick Adams) Newsgroups: mod.sources Subject: news 2.11 miscellaneous files (1 of 2) Message-ID: <41897@beno.seismo.CSS.GOV> Date: 30 Oct 86 05:07:04 GMT Organization: Center for Seismic Studies, Arlington, VA Lines: 1269 # To extract, sh this file # # news 2.11 miscellaneous File 1 of 2 # if test ! -d misc then mkdir misc fi echo x - misc/L.cmds 1>&2 sed 's/.//' >misc/L.cmds <<'*-*-END-of-misc/L.cmds-*-*' -# -# If rnews lives in a peculiar directory on your system -# (e.g. /usr/new under 4.3 BSD) make sure that uucp can -# find it using the PATH in /usr/lib/uucp/L.cmds. -# -PATH=/bin:/usr/bin:/usr/ucb:/usr/new -# -rnews,Error *-*-END-of-misc/L.cmds-*-* echo x - misc/README 1>&2 sed 's/.//' >misc/README <<'*-*-END-of-misc/README-*-*' -These are programs that have been useful for some people. -They are provided for your potential use, but are not -considered part of the official news release. *-*-END-of-misc/README-*-* echo x - misc/arbitron 1>&2 sed 's/.//' >misc/arbitron <<'*-*-END-of-misc/arbitron-*-*' -#! /bin/sh -# @(#)arbitron 2.3 07/15/86 -# arbitron -- this program produces rating sweeps for USENET. -# -# Usage: arbitron -# -# To use this program, edit the "configuration" section below so that the -# information is correct for your site, and then run it. It will produce a -# readership survey for your machine and mail that survey to decwrl, with -# a cc to you. -# -# To participate in the international monthly ratings sweeps, -# run "arbitron" every month. I will run the statistics program on the last -# day of each month; it will include any report that has reached it by that -# time. To make sure your site's data is included, run the survey program no -# later than the 20th day of each month. -# -# Brian Reid, DEC Western Research Lab, reid@decwrl -# Updated and bugfixed by -# Spencer Thomas, U.of Utah -# Geoff Kuenning, SAH Consulting -# Updated to work with 2.10.1 and older news systems by -# Lindsay Cleveland, AT&T Technologies/Bell Labs -# Made to work with 16-bit address spaces by -# Andy Walker, Maths Dept., University of Nottingham, UK -# -# Note that the results of this program are dependent on the rate at which -# you expire news. If you are a small site that expires news rapidly, the -# results may indicate fewer active readers than you actually have. -# -# copied to a certain extent from the "subscribers" -# script posted by Blonder, McCreery, and Herron. -########################################################################### -# Configuration information. Edit this section to reflect your site data. # -TMPDIR=/tmp -NEWS=/usr/lib/news -SPOOL=/usr/spool/news - -# Make a crude stab at determining the system type -if [ -d /usr/ucb ] -then - STYPE="bsd" -else - STYPE="usg" -fi - -# Range of /etc/passwd UID's that represent actual people (rather than -# maintenance accounts or daemons or whatever) -lowUID=100 -highUID=9999 - -# If you aren't running a distributed news system (nntpd & rrn, usually), -# leave NEWSHOST blank. Else set it to the name of the host from which you -# can rcp a copy of the active file. -NEWSHOST= - -# uucp path: {ihnp4, decvax, ucbvax}!decwrl!netsurvey -# summarypath="netsurvey@decwrl.dec.com $USER" -summarypath="ihnp4!decwrl!netsurvey usenet" - -# We need to find the uucp name of your host. If this code doesn't work, -# then just put it in literally like this: -# hostname="ihnp4" - -case $STYPE in - bsd) hostname=`(uuname -l || hostname) 2>&-`;; - sysv)hostname=`(uname -n || uuname -l || hostname) 2>&-`;; - *) hostname=`(uuname -l) 2>&-`;; -esac; - -PATH=$NEWS:/usr/local/bin:/usr/ucb:/usr/bin:/bin -############################################################################ -export PATH -# --------------------------------------------------------------------------- -trap "rm -f $TMPDIR/arb.*.$$; exit" 0 1 2 3 15 -set `date` -dat="$2$6" -# destination="mailx -s arbitron-${dat} $summarypath" -destination="${MAILER-mail} $summarypath" - -################################ -# Here are several expressions, each of which figures out approximately how -# many people use this machine. Comment out all but 1 of them; pick the one -# you like best. Initially the most universal but least reliable of them is -# uncommented. -# # ###### Scheme #1: fast but usually returns too big a number -nusers=`awk -F: "BEGIN {N=0}\\$3>=$lowUID && \\$3<=$highUID{N=N+1}END{print N}" </etc/passwd` - -# # ###### Scheme #2 (works with BSD systems) -#nusers=`last | sort -u +0 -1 | wc -l` - -# # ###### Scheme #3 (works with USG systems) -#nusers=`who /etc/wtmp | sort -u +0 -1 | wc -l` - -# # ###### Scheme #4 (provided by Lindsay Cleveland) -# # ###### (Same idea as #1, but excludes various junk accounts) -#awk -F: "\$3 >= $lowUID && \$3 <= $highUID{printf \"if test -d %s ; then echo %s;egrep : %s/.newsrc; fi\n\",\$6,\$1,\$6}" \ -# </etc/passwd | sh 2>/dev/null | awk -f $tmpdir/arb.sel.$$ >$tmpdir/arb.tmp.$$ -#nusers=`awk "BEGIN {N=0} NF == 1{N=N+1}END{print N}" <$tmpdir/arb.tmp.$$` -################################ -# -# Set up awk scripts; these are too large to pass as arguments on most -# systems. -# -# This awk script generates the actual output report. -# We use 'sed' to substitute in the shell variables to save ourselves -# endless hassle trying to find quoting/backslashing problems. -# -# The input to this script consists of two types of lines (pre-sorted): -# -# (1) Active-file lines. These have four fields: newsgroup name, -# first existing article, last article number, 'y' or 'n' -# to allow/disallow posting. -# mod.mac 00001 00001 y -# -# (2) .newsrc-derived lines. These have three fields: the newsgroup -# name, the user name and the articles-read information. The latter -# can be arbitrarily complex. It can also be arbitrarily long; -# this can potentially break either awk or sed, in which -# case the script will not work. -# mod.map joe 1-199 -# -# The script uses the type 1 lines to define the newsgroups -# and their active article ranges. The .newsrc (type 2) lines are -# then used to deduce which users are reading that group (a group -# is being read if the last article seen is in that group's active -# article range). The user names are used to keep track of who reads -# each group, which isn't all that useful but is interesting. When -# all input has been read, a report is printed summarizing the results. -# -sed "/^#/d - s/NUSERS/$nusers/g - s/HOSTNAME/$hostname/g - s/DATE/$dat/g" > $TMPDIR/arb.fmt.$$ << 'DOG' -# makereport -- utility for "arbitron". Early versions were copied from a -# similar script distributed with "subscribers.sh" by Blonder, McCreery, and -# Herron. -# - BEGIN { rdrcount = 0 ; reader = "" ; grpcount = 0 ; realusers = 0} -# -# Active file line: dispose of previous group (if any), record group, and -# record first and last article numbers. Set group's reader count to none. - NF == 4 { if (grpcount > 0) { - printf("%d %s\n",grpcount, grpname) - } - grpname = $1 - grpfirst = $3 - grplast = $2 - grpcount = 0 - } -# -# .newsrc line. Break out the final number, which is the last article that -# has actually been read. This is a pretty good indicator of the person's -# true interest in the group. If 'lastread' for the group is a current -# (unexpired) article, record a reader for that group. Finally, record -# the user as a "real" user of the news system. -# - NF == 3 { n1 = split($3, n2, "-") - n3 = split(n2[n1], n4, ",") - lastread = n4[n3] - if ((grpfirst != grplast) && (lastread >= grpfirst) && (lastread <= grplast)) { - grpcount++ - if (realuser[$2] != 1) { - realuser[$2] = 1 - realusers++ - } - } - } -# -# End of file. Print the report in 2 columns. - END { printf("9999 Host\t\t%s\n","HOSTNAME") - printf("9998 Users\t\t%d\n",NUSERS) - printf("9997 NetReaders\t%d\n",realusers) - printf("9996 ReportDate\t%s\n","DATE") - printf("9995 SystemType\tnews-arbitron-2.3\n") - if (grpcount > 0) { - printf("%d %s\n",grpcount, grpname) - } - } -DOG - -cat >$TMPDIR/arb.pwd.$$ <<'MOUSE' -BEGIN { seen["/"]=1; seen[""] = 1; } - { if (seen[$6]!=1) { - printf("if [ -r %s/.newsrc ] ; then ", $6) - printf("sed -n '/: [0-9]/s/:/ %s/p' <%s/.newsrc; fi\n",$1,$6) - seen[$6]=1; - } -} -MOUSE - -# First, make sure we have an active file -if [ -z "$NEWSHOST" ] -then ACTIVE=$NEWS/active -else ACTIVE=/tmp/arb.active.$$ - rcp $NEWSHOST:$NEWS/active $ACTIVE -fi - -if [ ! -s $ACTIVE ] -then - echo arbitron: ACTIVE file missing or empty. Cannot continue. - exit 1 -fi - -# Next, get the list of .newsrc files with duplicates and unreadable files -# removed. -awk -F: -f $TMPDIR/arb.pwd.$$ </etc/passwd | sh >$TMPDIR/arb.tmp.$$ - -# Check to make sure that we found some -if [ -s $TMPDIR/arb.tmp.$$ ] -then # See if "active" file has 4 fields or only two (pre-2.10.2) - set `sed 1q $ACTIVE` - if [ $# -eq 2 ] - then egrep '^[a-z]*\.' $ACTIVE | - while read group last - do dir=`echo "$group" | sed 's;\.;/;g'` - first=`ls $SPOOL/$dir | grep '^[0-9]*' | sort -n | sed 1q` - case $STYPE in - usg) echo "$group $last ${first:-$last} X";; - *) echo "$group $last ${first-$last} X" - esac - done - else egrep '^[a-z]*\.' $ACTIVE - fi | - sort - $TMPDIR/arb.tmp.$$ | - awk -f $TMPDIR/arb.fmt.$$ | - sort -nr | - sed '/^$/d - s/^999[0-9] //' | - $destination -else echo Unable to find any readable .newsrc files 2>&1 - exit 1 -fi *-*-END-of-misc/arbitron-*-* echo x - misc/article.c 1>&2 sed 's/.//' >misc/article.c <<'*-*-END-of-misc/article.c-*-*' -/* down!honey 4/84 */ -/* article msg-id [ ... msg-id ] */ - * where message-id is usually of the form number@machine.domain, - * and the domain in the message-id is optional. - * - * BUGS: - * Cannot handle all domains, for instance, BERKELEY.EDU. - */ - -#define HISTORY "/usr/lib/news/history" -#define NEWSDIR "/usr/spool/news" - -char *formats[] = { /* add as appropriate */ - "<%s.uucp>", - "<%s>", - "<%s.arpa>", - "<%s.oz>", - 0 -}; - -#include <stdio.h> -#include <sysexits.h> -#include <ctype.h> - -typedef struct { - char *dptr; - int dsize; -} datum; - -#if defined(USG_INDEX) -/* S3 or S5 both call strchr() what 4.X BSD calls index */ -#define index strchr -#endif - -long lseek(); -char *index(); -datum fetch(), dofetch(); - -main(argc, argv) -char **argv; -{ - int fd; - char buf[BUFSIZ], *ptr1, *ptr2; - datum content; - - if ((fd = open(HISTORY, 0)) < 0) { - perror(HISTORY); - exit(EX_UNAVAILABLE); - } - if (dbminit(HISTORY) < 0) { - fprintf(stderr, "dbm error\n"); - exit(EX_UNAVAILABLE); - } - for (--argc, argv++; argc; --argc, argv++) { - long foff; /* file offset */ - content = dofetch(*argv); - if (content.dptr == 0) { - printf("%s: No such key\n", *argv); - continue; - } - - /* Correct a machine dependent bug here, caused */ - /* because the lseek offset pointed to by dptr might */ - /* not be long-aligned. */ - /* Guy Harris suggested bug fix to prevent core drop. */ - /* This bug was written up in net.bugs.4bsd and */ - /* cross-posted to net.news.b */ - bcopy(content.dptr, (char *)&foff, sizeof foff); - - if (lseek(fd, foff, 0) < 0) - continue; - if (read(fd, buf, sizeof buf) <= 0) - continue; - - /* - * To understand this piece of code, you must understand - * that the format of lines in the history file are either: - * <msg-id>TAB<date>SPACE<time>TABthenNL - * <msg-id>TAB<date>SPACE<time>TAB<spoolpathname>NL - * <msg-id>TAB<date>SPACE<time>TAB<spoolpathname>SPACE... - * The first format occurs when expired, - * the second form occurs when exactly one pathname, - * and the third occurs when cross-postings. - */ - * - - /* remove end of line */ - if ((ptr2 = index(buf, '\n')) == 0) - continue; - *ptr2 = '\0'; - - /* The 4th field contains the article file name */ - - if ((ptr1 = index(buf, '\t')) == 0) - continue; - ptr1++; - - /* ptr1 now at begin of field 2 - the date field */ - - if ((ptr1 = index(ptr1, '\t')) == 0) - continue; - ptr1++; - - /* ptr1 now at begin of field 4 - the article spool pathname */ - /* or the newline that has been converted to a NULL */ - - /* change net.unix/231 to net/unix/231 */ - for (ptr2 = ptr1; ptr2 = index(ptr2, '.'); *ptr2 = '/') - ; - - /* terminate after the first pathname, if any */ - if ((ptr2 = index(ptr1, ' ')) != NULL) - *ptr2 = '\0'; - - if (*ptr1 == '\0') - printf("expired\n"); - else - printf("%s/%s\n", NEWSDIR, ptr1); - } - exit(EX_OK); -} - -datum -dofetch(str) -char *str; -{ - datum key, content; - char buf[BUFSIZ], **fmt; - register char *rcp; - - for (fmt = formats; *fmt; fmt++) { - sprintf(buf, *fmt, str); - rcp = buf - 1; - while (*++rcp) - if (isupper(*rcp)) - *rcp = tolower(*rcp); - key.dptr = buf; - key.dsize = strlen(buf) + 1; - content = fetch(key); - if (content.dptr) - break; - } - return(content); -} *-*-END-of-misc/article.c-*-* echo x - misc/batcher 1>&2 sed 's/.//' >misc/batcher <<'*-*-END-of-misc/batcher-*-*' -From sdcsvax!ncr-sd!greg@s3sun.CSS.GOV Mon Feb 3 14:24:25 1986 -Received: by seismo.CSS.GOV; Mon, 3 Feb 86 12:48:57 EST -Return-Path: <sdcsvax!ncr-sd!greg> -Received: by s3sun.CSS.GOV (4.24/s3-5.0) - id AA01660; Sun, 2 Feb 86 00:14:55 pst hops=0 -From: sdcsvax!ncr-sd!greg.@s3sun.CSS.GOV -Received: by sdcsvax.ucsd.edu (5.31/4.41) - id AA16013; Sat, 1 Feb 86 23:56:26 PST hops=0 -Date: Sat, 1 Feb 86 23:56:26 PST -Message-Id: <8602020756.AA16013@sdcsvax.ucsd.edu> -To: noscvax!rick@siesmo.ARPA, sdcsvax!s3sun!seismo!rick@s3sun.CSS.GOV -Subject: Batcher script for news -Status: R - -: shar: Shell Archiver -# Run this text with /bin/sh to create: -# batcher - -# I sent this a few days ago, and haven't gotten a reply. This one is a -# revision that incorporates some fixes suggested by some other San Diego -# sites that have been running it. Again, lease let me know if it arrives, -# otherwise I'll try retransmitting it in a few days. -# -# This is a script that replaces sendbatch and csendbatch. I recommend it to -# you for inclusion in 2.10.3. It has some nice attributes, particularly for -# me, where I have a lot of news connections to maintain. The most useful to -# me is that the default if no arguments are given is to send to everybody, -# so that I don't have to run around modifying crontab all the time -- all -# of the maintenance is in news/sys. -# -# Here are some sample sites from news/sys to show how it works: -# -# sdcsvax:sd,sdnet,ca,to.sdcsvax::uux - -r -n sdcsvax!rnews -# sdcsvax:net,fa,mod,na,usa:F:/usr/spool/batch/c.sdcsvax -# ncrcae:net,fa,mod,na,usa,ncr,to.ncrcae:F:/usr/spool/batch/c.ncrcae -# local:net,fa,mod,na,usa,ca,sdnet,sd,to.local:F:/usr/spool/batch/b.local -# -# The name chosen determines the type of transmission; the "b." prefix -# causes news to be sent batched and the "c." prefix causes news to be -# sent compressed (and batched). -# -# The batcher works by looking for files in /usr/spool/batch with a prefix -# of "[abc]."; if it is invoked with no arguments, it will pick up all such -# files, otherwise it only picks up files with those prefixes and the names -# given as arguments. If the host status is OK, it will batch up at most -# ten batches and queue them to be delivered to the specified site. The "a." -# prefix is for packaging agents not covered by the standard batching and -# compression algorithms; if you need it, consult the code for details. -# -# It also handles the *.cmd files to specify the transmission method as did -# sendbatch and csendbatch. -# -# Here are the relevant entries from the System V crontab table; note that -# System V has a separate file for each user, so if you don't have this, -# you may have to modify them so the invocation UID is correct. Versions -# of cron also differ on the complexity of the expressions permitted; use -# this as a guide, not as gospel. -# -# 56 19-23,0-7 * * 1-5 . /usr/lib/news/batcher # daily -# 56 * * * 0,6 . /usr/lib/news/batcher # weekends -# -# These lines cause the batcher to be invoked hourly from 8pm (well, 19:56) -# to 8am on weekdays and all day on the weekends. This causes any queued -# news to be sent (assuming it thinks the site is alive and well). I view -# the traffic to my backbone sites as important, so I also deliver to them -# during the days on weekdays since they have the CPU horsepower to handle -# it. Here is the crontab entry to do that: -# -# 56 8-18 * * 1-5 sh /usr/lib/news/batcher ncrcae sdcsvax -# -# I hope this is useful to you. -# -# -- Greg Noel, NCR Rancho Bernardo Greg@ncr-sd.UUCP or Greg@nosc.ARPA - -sed 's/^X//' <<'SHAR_EOF' >batcher; chmod 644 batcher -XNEWS=/usr/lib/news BATCH=/usr/spool/batch -XUUCP=/usr/lib/uucp SPOOL=/usr/spool/uucp -XPATH=$NEWS:/bin:/usr/bin export PATH -Xeval `grep TZ= /etc/profile` -Xcase $# in -X0|1) Files="-name [abc].$1*" ;; -X*) y="(" Files="" -X for file do Files="$Files $y -name [abc].$file*"; y=-o; done -X Files="$Files )" -Xesac -Xfor rmt in `find $BATCH -type f $Files -print` -Xdo case $rmt in -X *.cmd) continue ;; -X *.tmp) continue ;; -X *.work) rmt=`expr $rmt : "\(.*\).work"` -X if test -f $rmt; then continue; fi ;; -X esac -X site=`expr $rmt : ".*/[abc].\(.*\)"` -X site=`expr $site : "\(......\)" \| $site` -X case $rmt in -X */b.*) if test -s $rmt.cmd -a -x $rmt.cmd -X then CMD="batch $rmt 60000 | $rmt.cmd \$flag" -X else CMD="batch $rmt 60000 | uux - -r -n $site!rnews" -X fi ;; -X */c.*) if test -s $rmt.cmd -a -x $rmt.cmd -X then CMD="batch $rmt 100000 | compress -q | $rmt.cmd \$flag" -X else CMD="batch $rmt 100000 | compress -q | uux - -r -n $site!cunbatch" -X fi ;; -X */a.*) CMD=`sed -n "s/^$site://p" $NEWS/cmds` -X case "$CMD" in "") echo "OOPS -- no command for $site" -X continue ;; -X esac ;; -X *) echo "OOPS -- matched illegal file type!"; continue ;; -X esac -X if test -f $SPOOL/STST.$site -X then if test ! -s $SPOOL/STST.$site -X then continue # Hmmmm.... Info file is null -X fi -X read <$SPOOL/STST.$site status garbage -X case $status in -X 3) flag=no ;; # already talking -X *) continue ;; -X esac -X else flag=yes # start conversation first time through -X fi -X # Send a maximum of ten batches to remote site -X loops=x -X while test -s $rmt -o -s $rmt.work -X do eval $CMD -X if test $? -ne 0 -o $loops = xxxxxxxxxx; then break; fi -X case $flag in yes) $UUCP/uucico -r1 & ;; esac -X flag=no loops=x$loops -X done -Xdone -SHAR_EOF -exit 0 - - *-*-END-of-misc/batcher-*-* echo x - misc/bncvt-2-unbatch 1>&2 sed 's/.//' >misc/bncvt-2-unbatch <<'*-*-END-of-misc/bncvt-2-unbatch-*-*' -From csg@pyramid.UUCP (Carl S. Gutekunst) Wed Oct 30 22:12:27 1985 -Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site seismo.UUCP -Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site pyramid.UUCP -Path: seismo!lll-crg!dual!pyramid!csg -From: csg@pyramid.UUCP (Carl S. Gutekunst) -Newsgroups: net.sources -Subject: bncvt -- filter bnproc batches to unbatch -Message-ID: <54@pyramid.UUCP> -Date: 31 Oct 85 03:12:27 GMT -Date-Received: 31 Oct 85 12:52:30 GMT -Reply-To: csg@pyramid.UUCP (Carl S. Gutekunst) -Followup-To: net.sources.bugs -Organization: Pyramid Technology, Mountain View, CA -Lines: 104 -Keywords: news bnproc unbatch bncvt - -/*===========================================================================** -** BBBBBBB NN NN CCCCC VV VV TTTTTTTT ** -** BB BB NNN NN CC CC VV VV TT ** -** BB BB NNNN NN CC VV VV TT ** -** BBBBBBB NN NN NN CC VV VV TT ** -** BB BB NN NNNN CC VV VV TT ** -** BB BB NN NNN CC CC VVVV TT ** -** BBBBBBB NN NN CCCCC VV TT ** -**===========================================================================** -** Copyright (C) 1985 by PYRAMID TECHNOLOGY CORPORATION, Mountain View, CA ** -**===========================================================================** -** Permission is granted to freely use and distribute this software, as long ** -** as no attempt is made to profit from it, and this notice is included. ** -**===========================================================================** -** -** ** bncvt.c -- utility to filter bnproc news batches to unbatch. -** -** Written in a fit of desperation by Carl S. Gutekunst -** -** ** Decsription: -** -** This filter accepts uncompressed news batches in "bnproc" format and -** writes them out in "unbatch" format. Using 2.10.3 news, its output can -** be piped directly into rnews. -** -** The filter also adjusts for the bnproc "article eater" bug, which threw -** off the article byte count and caused rnews to discard entire articles. -** -** ** Execution (for 2.10.3 netnews): -** -** uncompress | bncvt | rnews -** -** ** Generation: -** -** cc bncvt.c -o bncvt -s -O -** -** ** $Log: bncvt.c,v $ -** Revision 1.1 85/10/30 19:07:13 csg -** Initial version, written in a fit of desperation by Carl S. Gutekunst. -** -**===========================================================================*/ - -#include <stdio.h> - -#define LINESIZE 128 /* Size of the input line buffer */ - -static char RCSid[] = "$Header: bncvt.c,v 1.1 85/10/30 19:07:13 csg Rel $"; - -main () -{ - char linebuf[LINESIZE], *lp; /* Single line buffer, and pointer */ - int expected, nbytes; /* Bytes expected and read so far */ - - nbytes = expected = 0; - while (fgets (linebuf, LINESIZE, stdin) != NULL) - { - /* - * Check for an article eater. This is a DEL character, either 0x7F or - * 0xFF, in the first column preceeding a new article byte count. It - * usually throws off the byte count, so we have to add some padding - * to keep rnews from losing sync (and discarding the next article). - */ - - if ((linebuf[0] & 0x7F) == 0x7F) - { - if (expected > 0) - while (nbytes++ < expected) - putc ('\0', stdout); - } - - /* - * If we aren't expecting text, then we're expecting an article byte - * count. This is a left-justified integer, immediately followed by a - * newline. We ignore leading article-eater DEL characters. - */ - - if (nbytes >= expected) - { - nbytes = expected = 0; - lp = linebuf; - while ((*lp & 0x7F) == 0x7F) - ++lp; - while (*lp >= '0' && *lp <= '9') - expected = expected * 10 + (*lp++ - '0'); - - if (*lp == '\n' && expected > 0) - printf ("#! rnews %d\n", expected); - else - { fprintf (stderr, "Sync->%s", linebuf); - expected = 0; - } - } - - /* - * Another normal line of text: write it out. - */ - - else - { - fputs (linebuf, stdout); - nbytes += strlen (linebuf); - } - } -} - - *-*-END-of-misc/bncvt-2-unbatch-*-* echo x - misc/comp.recording 1>&2 sed 's/.//' >misc/comp.recording <<'*-*-END-of-misc/comp.recording-*-*' -Posting to this newsgroup will cause your article to be broadcast to -the entire USENET, including sites outside of Bell Labs. You should -not include any proprietary information in this article. *-*-END-of-misc/comp.recording-*-* echo x - misc/delay 1>&2 sed 's/.//' >misc/delay <<'*-*-END-of-misc/delay-*-*' -# -# Note, Date-Received knows abotu yout local timezone -# -./grabheaders | awk ' -BEGIN{ - t = "Jan 31 Feb 28 Mar 31 Apr 30 May 31 Jun 30 Jul 31 Aug 31 Sep 30 Oct 31 Nov 30 Dec 31" - split(t,x) - n = 0; - for(i=1;i<24;i+=2) { - month[x[i]] = month[(i+1)/2] = (i+1)/2 - days[(i+1)/2] = n - n += x[i+1] - } -} - -/^Date: /{ - if (NF == 7 ){ - t = $6 - x[1] = $3 - x[2] = $4 - x[3] = $5 - } else if (NF == 5 && split($3,x,"-") == 3) { - t = $4 - } else if (NF == 4 && split($2,x,"-") == 3) { - t = $3 - }else if (NF == 6) { - t = $5 - x[1] = $2 - x[2] = $3 - x[3] = $4 - }else{ - print "Bad date",messageid, $0 - next - } - sent = x[1] + days[month[x[2]]] + (x[3]-80)*365 - if (x[3]%4 == 0 && month[x[2]] > 2) - sent++ - split(t,x,":") - sent *= 60*24 - sent += x[1] * 60 + x[2] -} -/^Date-Received: /{ - if (NF < 3){ - print "Date-received", messageid ,$0 - rec = 0 - next - } - split($2,x,"/") - rec = x[2] + days[x[1]+0] +(x[3]-80)*365 - if (x[3]%4 == 0 && x[1] > 2) - rec++ - split($3,x,":") - rec *= 60*24 - rec += x[1] * 60 + x[2] + 1.44 - if ($4 != "GMT") - rec += 60*5 - if (rec > today) - today = rec -} -/^Message-ID: /{messageid = $2} -/^Path: /{ - n = split($2,x,"!") - if( n > 2) - feed = x[2] - else - feed = x[1] -} -/^$/{ - n = int((rec - sent)/(60*24)+0.999) - if( rec > 0 ) { - if ( n >= 0) { - adelay[n]++ - if( n > amaxdelay) - amaxdelay = n - } else { - adelay[-1]++ - print "Time Warp", messageid - } - totdelay++ - feedsite[feed]++ - } - rec = sent = 0 -} -END { - n = int((rec - sent)/(60*24)+0.999) - if( rec > 0 ) { - if ( n >= 0) { - adelay[n]++ - if( n > amaxdelay) - amaxdelay = n - } else { - adelay[-1]++ - print "Time Warp", messageid - } - totdelay++ - feedsite[feed]++ - } - i = 0 - count = 0 - printf("\n\tPropagation Delay\n") - printf("\n\t No. of Cumulative\n") - printf("\tDays Articles Percent\n") - if (adelay[-1] > 0) { - printf("\t <0%8d%7d%% (Time Warp)\n",adelay[-1],0) - count += adelay[-1] - } - while (i <= amaxdelay) { - count += adelay[i] - if( adelay[i] != 0 ) - printf("\t%3d%8d%7d%%\n",i,adelay[i],(count*100)/totdelay) - i++ - } - - n = 0 - for (i in feedsite) - ptr[++n] = i - - j = 1 - while (j < n){ - if (feedsite[ptr[j]] < feedsite[ptr[j+1]]){ - temp = ptr[j] - ptr[j] = ptr[j+1] - ptr[j+1] = temp - if( j > 1) { - j-- - continue - } - } - j++ - } - printf("\n\tDistribution of news feeds\n") - printf("\t Count Percent Site\n") - j = 0 - while (++j <= n){ - i =feedsite[ptr[j]] - printf("\t%8d%7d%% %s\n",i,(i*100)/totdelay,ptr[j]); - } -}' *-*-END-of-misc/delay-*-* echo x - misc/dirform 1>&2 sed 's/.//' >misc/dirform <<'*-*-END-of-misc/dirform-*-*' -#N -#S -#O -#C -#E -#T -#P -#L -#R -#W -#U -# -sitename connection(FREQUENCY), connection(FREQUENCY), - connection(FREQUENCY) -============================================================================ - -The entire map is intended to be processed by pathalias, a program that -generates UUCP routes from this data. All lines beginning in `#' are -comment lines to pathalias, however the UUCP Project has defined a set -of these comment lines to have specific format so that a complete -database could be built. - -The generic form of these lines is - -#<field id letter><tab><field data> - -Each host has an entry in the following format. The entry should begin -with the #N line, end with a blank line after the pathalias data, and -not contain any other blank lines, since there are ed, sed, and awk -scripts that use expressions like /^#N $1/,/^$/ for the purpose of -separating the map out into files, each containing one site entry. - -#N UUCP name of site -#S manufacturer machine model; operating system & version -#O organization name -#C contact person's name -#E contact person's electronic mail address -#T contact person's telephone number -#P organization's address -#L longitude / latitude -#R remarks -#U netnews neighbors -#W who last edited the entry ; date edited -# -sitename remote1(FREQUENCY), remote2(FREQUENCY), - remote3(FREQUENCY) - -Example of a completed entry: - -#N ucbvax -#S DEC VAX-11/750; 4.3 BSD UNIX -#O University of California at Berkeley -#C Robert W. Henry -#E ucbvax!postmaster -#T +1 415 642 1024 -#P 573 Evans Hall, Berkeley, CA 94720 -#L 37 52 29 N / 122 13 44 W -#R This is also UCB-VAX.BERKELEY.EDU [10.2.0.78] on the internet -#U decvax ibmpa ucsfcgl ucbtopaz ucbcad -#W ucbvax!fair (Erik E. Fair); Sat Jun 22 03:35:16 PDT 1985 -# -ucbvax = "UCB-VAX.BERKELEY.EDU" -# -ucbvax decvax(DAILY/4), ihnp4(DAILY/2), - sun(POLLED) - -Specific Field Descriptions - -#N system name - -Your system's UUCP name should go here. Either the uname(1) command -from System III or System V UNIX; or the uuname(1) command from Version -7 UNIX will tell you what UUCP is using for the local UUCP name. - -One of the goals of the UUCP Project is to keep duplicate UUCP host -names from appearing because there exist mailers in the world which -assume that the UUCP name space contains no duplicates (and attempts -UUCP path optimization on that basis), and it's just plain confusing to -have two different sites with the same name. - -At present, the most severe restriction on UUCP names is that the name -must be unique somewhere in the first six characters, because of a poor -software design decision made by AT&T for the System V release of UNIX. - -This does not mean that your site name has to be six characters or less -in length. Just unique within that length. - -With regard to choosing system names, HARRIS'S LAMENT: - - ``All the good ones are taken.'' - -#S machine type; operating system - -This is a quick description of your equipment. Machine type should -be manufacturer and model, and after a semi-colon(;), the operating -system name and version number (if you have it). Some examples: - - DEC PDP-11/70; 2.9 BSD UNIX - DEC PDP-11/45; ULTRIX-11 - DEC VAX-11/780; VMS 4.0 - SUN 2/150; 4.2 BSD UNIX - Pyramid 90x; OSx 2.1 - CoData 3300; Version 7 UniPlus+ - Callan Unistar 200; System V UniPlus+ - IBM PC/XT; Coherent - Intel 386; XENIX 3.0 - CRDS Universe 68; UNOS - -#O organization name - -This should be the full name of your organization, squeezed to fit -inside 80 columns as necessary. Don't be afraid to abbreviate where the -abbreviation would be clear to the entire world (say a famous -institution like MIT or CERN), but beware of duplication (In USC the C -could be either California or Carolina). - -#C contact person - -This should be the full name (or names, separated by commas) of the -person responsible for handling queries from the outside world about -your machine. - -#E contact person's electronic address - -This should be just a machine name, and a user name, like -`ucbvax!fair'. It should not be a full path, since we will be able to -generate a path to the given address from the data you're giving us. -There is no problem with the machine name not being the same as the #N -field (i.e. the contact `lives' on another machine at your site). - -Also, it's a good idea to give a generic address or alias (if your mail -system is capable of providing aliases) like `usenet' or `postmaster', -so that if the contact person leaves the institution or is re-assigned -to other duties, he doesn't keep getting mail about the system. In a -perfect world, people would send notice to the UUCP Project, but in -practice, they don't, so the data does get out of date. If you give a -generic address you can easily change it to point at the appropriate -person. - -Multiple electronic addresses should be separated by commas, and all of -them should be specified in the manner described above. - -#T contact person's telephone number - -Format: +<country code><space><area code><space><prefix><space><number> - -Example: - -#T +1 415 642 1024 - -This is the international format for the representation of phone -numbers. The country code for the United States of America is 1. Other -country codes should be listed in your telephone book. - -If you must list an extension (i.e. what to ask the receptionist for, -if not the name of the contact person), list it after the main phone -number with an `x' in front of it to distinguish it from the rest of -the phone number. - -Example: - -#T +1 415 549 3854 x37 - -Multiple phone numbers should be separated by commas, and all of them -should be completely specified as described above to prevent confusion. - -#P organization's address - -This field should be one line filled with whatever else anyone would -need after the contact person's name, and your organization's name -(given in other fields above), to mail you something in the physical -mails. Generally, if there's room, it's best to spell out things -like Road, Street, Avenue, and Boulevard, since this is an international -network, and the abbreviations will not necessarily be obvious to someone -from Finland, for example. - -#L longitude and latitude - -This should be in the following format: - -#L NN MM [SS] N|S / NNN MM [SS] E|W [city] - -Two fields, with optional third. - -First number is Latitude in degrees (NN), minutes (MM), and seconds (SS), -and a N or S to indicate North or South of the Equator. - -A Slash Separator. - -Second number is Longitude in degrees (NNN), minutes (MM), and seconds (SS), -and a E or W to indicate East or West of the Prime Meridian in Greenwich, -England. - -Seconds are optional, but it is worth noting that the more accurate you -are, the more accurate maps we can make of the network (including -blow-ups of various high density areas, like New Jersey, or the San -Francisco Bay Area). - -If you give the coordinates for your city (i.e. without fudging for -where you are relative to that), add the word `city' at the end of the -end of the specification, to indicate that. If you know where you are -relative to a given coordinate for which you have longitude and -latitude data, then the following fudge factors can be useful: - -1 degree = 69.2 miles = 111 kilometers -1 minute = 1.15 miles = 1.9 kilometers -1 second = 101.5 feet = 31 meters - -The Prime Meridian is through Greenwich, England, and longitudes go no -higher than 180 degrees West or East of Greenwich. Latitudes go no -higher than 90 degrees North or South of the Equator. - -Beware that the distance between two degrees of longitude decreases as -you get further away from the Equator. (Imagine all those longitudinal -lines converging on the north and south poles...) These numbers are -good for the Equator. If you're in Alaska or Norway, for example, they -are certainly too large for you to fudge longitude accurately. - -#R remarks - -This is for one line of comment. As noted before, all lines beginning -with a `#' character are comment lines, so if you need more than one -line to tell us something about your site, do so between the end of the -map data (the #?\t fields) and the pathalias data. - -#U netnews neighbors - -The USENET is the network that moves netnews around, specifically, -net.announce. If you send net.announce to any of your UUCP neighbors, -list their names here, delimited by spaces. Example: - -#U ihnp4 decvax mcvax seismo - -Since some places have lots of USENET neighbors, continuation lines -should be just another #U and more site names. - -#W who last edited the entry and when - -This field should contain an email address, a name in parentheses, -followed by a semi-colon, and the output of the date program. -Example: - -#W ucbvax!fair (Erik E. Fair); Sat Jun 22 03:35:16 PDT 1985 - -The same rules for email address that apply in the contact's email -address apply here also. (i.e. only one system name, and user name). -It is intended that this field be used for automatic ageing of the -map entries so that we can do more automated checking and updating -of the entire map. See getdate(3) from the netnews source for other -acceptable date formats. - -PATHALIAS DATA (or, documenting your UUCP connections & frequency of use) - -The DEMAND, DAILY, etc., entries represent imaginary connect costs (see -below) used by pathalias to calculate lowest cost paths. The cost -breakdown is: - - LOCAL 25 local area network - DEDICATED 95 high speed dedicated - DIRECT 200 local call - DEMAND 300 normal call (long distance, anytime) - HOURLY 500 hourly poll - EVENING 1800 time restricted call - DAILY 5000 daily poll - WEEKLY 30000 irregular poll - DEAD a very high number - not usable path - -Additionally, HIGH and LOW (used like DAILY+HIGH) are -5 and +5 -respectively, for baud-rate or quality bonuses/penalties. Arithmetic -expressions can be used, however, you should be aware that the results -are often counter-intuitive (e.g. (DAILY*4) means every 4 days, not 4 -times a day). - -The numbers are intended to represent frequency of connection, which -seems to be far more important than baud rates for this type of -traffic. There is an assumed high overhead for each hop; thus, -HOURLY is far more than DAILY/24. - -There are a few other cost names that sometimes appear in the map; -these are discouraged. Some are synonyms for the prefered -names above (e.g. POLLED means DAILY), some are obsolete (e.g. -the letters A through F, which are letter grades for connections.) -It is not acceptable to make up new names or spellings (pathalias -gets very upset when people do that...). - -LOCAL AREA NETWORKS - -For local area networks, (since they are usually completely connected), -there is a list notation for specifying them. Usually there is one -gateway machine to the outside world; it is best that the definition of -the network appear in that system's pathalias entry, and the other -systems just note that they connect to the LAN. An abbreviated map -entry for the sake of example: - -#N frobozz -#O Frobozz Skonk Works -#C Joe Palooka -#E frobozz!postmaster -#R gateway machine to Frobozz Company LAN -# -frobozz ucbvax(DEMAND), ihnp4(EVENING), seismo(DAILY), - mcvax(WEEKLY), akgua(EVENING) -# -# LAN addressed user@host -# -FROBOZZ-ETHER = @{frobozz, frob1, frob2, frob3}(LOCAL) -# -# LAN addressed BerkNet style host:user -# -FROBOZZ-BERKNET = {frobozz, frob4, frob5, frob6}:(LOCAL) - -For the other sites on the LAN, their map entries should reflect -who is in charge of the machine, and their pathalias data -would appear like this (again, this example is abbreviated): - -#N frob1 -#O Frobozz Skonk Works, Software Development System -#C Joe Palooka -#E frobozz!postmaster -# -frob1 FROBOZZ-ETHER - -WHAT TO DO WITH THIS STUFF - -Once you have finished constructing your pathalias entry, mail it off -to {ucbvax,ihnp4,akgua,seismo}!cbosgd!uucpmap, which is a mailing list -of the regional map coordinators. They maintain assigned geographic -sections of the map, and the entire map is posted on a rolling basis in -the USENET newsgroups mod.map.uucp over the course of a month (at the -end of the month they start over). - -Questions or comments about this specification should also be directed at -cbosgd!uucpmap. - *-*-END-of-misc/dirform-*-* echo x - misc/euuname.sh 1>&2 sed 's/.//' >misc/euuname.sh <<'*-*-END-of-misc/euuname.sh-*-*' -: From cbosg!mcnc!unc!smb Sat Feb 27 05:45:42 1982 -: Date: 27-Feb-82 05:45:41-EST - -: Heres a shell file that should be distributed with netnews. -: Its intended to be the program that replies to the mapping control -: message, it extracts info from the L.sys file, add extra names, and -: suppresses private ones. - -: To use this, change the senduuname control message to call -: LIBDIR/euuname instead of uuname, and install this script in that location. -: the lists secret and extras are names you want deleted from added to -: your uuname output. - -PATH=/usr/ucb:/bin:/usr/bin -export PATH -cd /usr/lib/news -trap "rm -f /tmp/nam$$; exit" 0 1 2 -sort secret >/tmp/nam$$ -echo Subject: edited uuname output enclosed -((cat extras; uuname) | sort | comm -23 - /tmp/nam$$) | uniq *-*-END-of-misc/euuname.sh-*-* echo x - misc/grabheaders.c 1>&2 sed 's/.//' >misc/grabheaders.c <<'*-*-END-of-misc/grabheaders.c-*-*' -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> - -#define HISTORY "/usr/new/lib/news/history" -#define SPOOL "/usr/spool/news" - -#include <sys/types.h> -#include <sys/timeb.h> -#include <ctype.h> -#include <sys/time.h> - -#define NULL 0 -#define daysec (24L*60L*60L) - -main() -{ - FILE *Hfile, *Afile; - char buffer[BUFSIZ], datestr[BUFSIZ]; - char *index(); - struct stat stbuf; - struct timeb now; - long t; - - Hfile = fopen(HISTORY, "r"); - if (Hfile == NULL) { - perror(HISTORY); - exit(1); - } - - if (chdir(SPOOL) < 0) { - perror(SPOOL); - exit(1); - } - - (void) ftime(&now); - - while (fgets(buffer, BUFSIZ, Hfile) != NULL) { - register char *p, *file; - - p = index(buffer, '\t'); - if (p == NULL) - continue; - file = index(p+1, '\t'); - if (file == NULL || file[1] == '\n') - continue; - *file = '\0'; - t = getdate(p, &now); - if ( (t+daysec*14L) < now.time) - continue; - strcpy(datestr, p); - p = file; - while (*++p != ' ' && *p != '\n') - if (*p == '.') - *p = '/'; - *p = '\0'; - file++; - if ( strncmp(file, "net", 3) && strncmp(file, "mod", 3) - && strncmp(file, "comp", 4) && strncmp(file, "sci", 3) - && strncmp(file, "news", 4) && strncmp(file, "rec", 3) - && strncmp(file, "talk", 4) && strncmp(file, "misc", 4) - && strncmp(file, "soc", 3) - ) - continue; - Afile = fopen(file, "r"); - if (Afile == NULL) - continue; - while (fgets(buffer, BUFSIZ, Afile) != NULL && - buffer[0] != '\n') { - if (strncmp(buffer, "From: ", 5) == 0) { - register char *cp = index(buffer, '@'); - if (cp) - while (*++cp && *cp != '.' && *cp != ' ') - if (isupper(*cp)) - *cp = tolower(*cp); - cp--; - while (*++cp && *cp != ' ') - if (islower(*cp)) - *cp = toupper(*cp); - } - fputs(buffer, stdout); - } - fstat(fileno(Afile), &stbuf); - printf("Date-Received: %s\n", datestr); - printf("Bytes: %ld\n\n", stbuf.st_size - ftell(Afile)); - fclose(Afile); - } - printf("\n"); -} *-*-END-of-misc/grabheaders.c-*-* exit