chiark / gitweb /
Move AFE-related programs into a separate directory.
authorColin Watson <cjwatson@chiark.greenend.org.uk>
Tue, 20 Aug 2002 14:11:35 +0000 (14:11 +0000)
committerColin Watson <cjwatson@chiark.greenend.org.uk>
Tue, 20 Aug 2002 14:11:35 +0000 (14:11 +0000)
14 files changed:
afe-stats [deleted file]
afec-faq [deleted file]
afeweb-backup [deleted file]
archive-news.pl [deleted file]
countafe [deleted file]
faq-pointer [deleted file]
faq2html.pl [deleted file]
horja [deleted file]
mordja [deleted file]
mordja-zip [deleted file]
prune-sessions [deleted file]
run-horja [deleted file]
silver-suggestions [deleted file]
tabulateafe [deleted file]

diff --git a/afe-stats b/afe-stats
deleted file mode 100755 (executable)
index 669ff97..0000000
--- a/afe-stats
+++ /dev/null
@@ -1,2 +0,0 @@
-#! /bin/sh
-statnews --from=`date -d '1 week ago' +%d/%m/%Y` --nocapitalize alt.fan.eddings
diff --git a/afec-faq b/afec-faq
deleted file mode 100755 (executable)
index a234904..0000000
--- a/afec-faq
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /bin/sh
-
-# Post the alt.fan.eddings.creative FAQ every fortnight
-cd $HOME/afe/daemons
-$HOME/bin/crondiv 2 afec-faq.log inews -hS afec-faq.txt
diff --git a/afeweb-backup b/afeweb-backup
deleted file mode 100755 (executable)
index d836c52..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh
-
-YEARTHISWEEK=`date +%Y-w%V`
-YEARLASTWEEK=`date -d '1 week ago' +%Y-w%V`
-DAY=`date +%w | sed 's/0/7/'`
-
-LABDIR=/tmp/afeweb.$YEARTHISWEEK-$DAY
-if [ $DAY -eq 1 ]; then
-       OLDTAR=$HOME/backups/afeweb-$YEARLASTWEEK.tar.gz
-       NEWTAR=$HOME/backups/afeweb-$YEARTHISWEEK.tar.gz
-else
-       OLDTAR=$HOME/backups/afeweb-$YEARTHISWEEK.tar.gz
-       unset NEWTAR
-fi
-DIFFGZ=$HOME/backups/afeweb-$YEARTHISWEEK-$DAY.diff.gz
-TOPDIR=tolhoneth
-SOURCEPARENT=/var/www
-SOURCEDIR=tolhoneth
-
-if [ -f $OLDTAR ]; then
-       # Extract old tarball and set up diffing environment
-       mkdir $LABDIR
-       cd $LABDIR
-       tar xzf $OLDTAR
-       mv $TOPDIR $TOPDIR.orig
-       ln -s $SOURCEPARENT/$SOURCEDIR $TOPDIR
-
-       # Do the diff and clean up
-       diff -Naru $TOPDIR.orig $TOPDIR | gzip > $DIFFGZ
-       cd -
-       rm -rf $LABDIR
-fi
-
-if [ "$NEWTAR" ]; then
-       # First day of the week, so build a new tarball
-       cd $SOURCEPARENT
-       tar czf $NEWTAR $SOURCEDIR
-       cd -
-fi
-
diff --git a/archive-news.pl b/archive-news.pl
deleted file mode 100755 (executable)
index 4f6f44b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#! /usr/bin/perl -w
-use diagnostics;
-use strict;
-
-use Net::NNTP;
-
-my $nntp;
-
-sub usage ()
-{
-    print STDERR <<"EOF";
-Usage: $0 hostname newsgroup-name archive-directory
-EOF
-    exit 1;
-}
-
-sub bail ($)
-{
-    my $msg = shift;
-    $nntp->quit;
-    print STDERR "$msg\n";
-    exit 1;
-}
-
-my $host = shift or usage;
-my $group = shift or usage;
-my $archive = shift or usage;
--d $archive or usage;
-
-opendir ARCHIVE, $archive or die "can't opendir $archive: $!";
-my @list = grep m/^\d+$/, readdir ARCHIVE;
-closedir ARCHIVE;
-
-@list = sort { $a <=> $b } @list;
-my $start = scalar @list ? $list[$#list] + 1 : 0;
-
-$nntp = Net::NNTP->new($host);
-# Bah, password in clear, oh well, it's only passworded to keep the
-# howling masses out anyway ...
-#$nntp->authinfo('afe', 'MyTest');
-
-my ($narticles, $first, $last, $name) = $nntp->group($group);
-(defined $first and defined $last) or bail "Couldn't set group to $group";
-
-exit if $last <= $start;
-$start = $first if $first > $start;
-
-for my $index ($start..$last)
-{
-    my $article = $nntp->article($index);
-    if (defined $article)
-    {
-       open ARTICLE, ">$archive/$index"
-           or die "can't open $archive/$index for writing: $!";
-       print ARTICLE join '', @$article;
-       close ARTICLE;
-    }
-    #print STDERR "$group $index\n";
-}
-
-$nntp->quit;
-
diff --git a/countafe b/countafe
deleted file mode 100755 (executable)
index b2ea8a9..0000000
--- a/countafe
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh -e
-echo -n "$*    "
-grep -c "$*" afe-posters
diff --git a/faq-pointer b/faq-pointer
deleted file mode 100755 (executable)
index cbd76f3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /bin/sh
-
-# Post the alt.fan.eddings FAQ pointer every six days
-cd $HOME/afe/daemons
-$HOME/bin/crondiv 6 faq-pointer.log inews -hS faq-pointer.txt
diff --git a/faq2html.pl b/faq2html.pl
deleted file mode 100755 (executable)
index 15305de..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-#! /usr/bin/perl -w
-use strict;
-require 5.000;
-use lib qw(.);
-use Style qw(html_header html_footer);
-
-# The AFE FAQ HTMLizer
-# Perl version written by Kamion; based on a sed script by Aquarius
-
-sub usage ()
-{
-    print STDERR <<"EOF";
-Usage: $0 index-filename [up-URL] < faq-document
-
-URLs may be absolute or relative.
-
-EOF
-    exit 1;
-}
-
-sub html_escape (\$)
-{
-    my $line = shift;
-    return unless defined $$line;
-    $$line =~ s/\&/&amp;/g;
-    $$line =~ s/</&lt;/g;
-    $$line =~ s/>/&gt;/g;
-    $$line =~ s/"/&quot;/g;
-    $$line =~ s/æ/&aelig;/g;
-    return $$line;
-}
-
-#my $sts_link = "http://riva.ucam.org/~kamion/archive-bin/" .
-#              "article.pl?msgid=5n0qq5\$d9p\@mercury.dur.ac.uk";
-my $sts_link = 'http://groups.google.com/groups?' .
-              'q=Easter+Egg&ic=1&selm=5n0qq5%24d9p%40mercury.dur.ac.uk';
-
-# Paragraph to format and undefine, followed optionally by open and close tags.
-sub print_paragraph (\$;$$)
-{
-    my $para = shift;
-    return unless defined $$para && $$para !~ /^\s*$/;
-    my $open_tags = shift;
-    my $close_tags = shift;
-
-    # Make URLs links
-    $$para =~ s#(http:(?:[^\ \&<]|\&(?!gt;))*)
-              #<A TARGET="_top" HREF="$1">$1</A>#gx;
-
-    # Make all text within pairs of underscores outside URLs emphasized
-    $$para =~ s[_((?:[^_.-])+\.?)_
-               (?![^"]*">|[^<]*</A>)][<EM>$1</EM>]gx;
-
-    # Similarly, strengthen bold text within asterisks
-    $$para =~ s[\*((?:[^*.])+\.?)\*
-               (?![^"]*">|[^<]*</A>)][<STRONG>$1</STRONG>]gx;
-
-    # Easter egg
-    $$para =~ s|(Sephrenia the Styric)|<A HREF="$sts_link">$1</A>|g;
-
-    $$para = "$open_tags$$para" if defined $open_tags;
-    $$para .= $close_tags if defined $close_tags;
-
-    print "$$para\n";
-    undef $$para;
-}
-
-my $index_file = shift or usage;
-my $up_url = shift;
-
-open CONTROL, ">control.html" or die "Can't write to control.html: $!";
-select CONTROL;
-
-html_header "Revision information", $index_file;
-print "\n";
-
-my $changes_done = 0;
-
-print "<PRE>\n";
-while (<>)
-{
-    $changes_done = 1 if (/^Archive-name:/);
-    next unless $changes_done;
-    chomp;
-    html_escape $_;
-    last if (/^\s*$/);
-    unless (/^([^:]+:)\s*(.+)$/)
-    {
-       warn "Non-header line found in control section: $_";
-       next;
-    }
-    print "$_\n";
-}
-print "</PRE>\n\n";
-
-html_footer $index_file;
-
-open INDEX, ">$index_file" or die "Can't write to $index_file: $!";
-select INDEX;
-
-html_header "Contents", $up_url;
-print "\n";
-
-print "<H1 ALIGN=\"center\">\n";
-while (<>)
-{
-    last if /^\s*$/;
-    html_escape $_;
-    print;
-}
-print "</H1>\n\n";
-
-print "<P><A HREF=\"control.html\">Revision information</A></P>\n";
-
-my $paragraph;
-my $listentry = 0;
-my $level = 0;
-my @lastvalues = ();
-
-while (<>)
-{
-    chomp;
-    s/^\s*//;
-    html_escape $_;
-    # Stop at TOC-body separator
-    if (/--------/)
-    {
-       print_paragraph $paragraph, "", $listentry ? "</A>" : "";
-       last;
-    }
-    # Convert headings to links
-    my $line = $_;
-    if ($line =~ /([0-9]+)((?:.[0-9]+)*)[\)\s]/)
-    {
-       my $firstcomp = $1;
-       my $heading = "$1$2";
-       my @components = split /\./, $heading;
-       if (@components > 0)
-       {
-           $line =~ /\s+(.*)$/g;
-           my $linetail = $1;
-           print_paragraph $paragraph, "", $listentry ? "</A>" : "";
-
-           # Change level of ordered list if necessary
-           if (@components > $level)
-           {
-               print "<OL>\n" x (@components - $level);
-           }
-           elsif (@components < $level)
-           {
-               print "</OL>\n" x ($level - @components);
-           }
-           #print "</P>\n\n" if @components == 1 && $level > 0;
-           print "\n<BR>\n\n" if @components == 1 && $level > 0;
-           $level = @components;
-           $#lastvalues = $level;
-           #print "<P>\n" if $level == 1;
-
-           # Reformat the current line
-           my $value = $components[$#components];
-           if (defined $lastvalues[$level] &&
-               $lastvalues[$level] + 1 != $value)
-           {
-               warn "Missing item in contents before $heading";
-               print "<LI VALUE=\"$value\">";
-           }
-           elsif ($value != 1)
-           {
-               print "<LI VALUE=\"$value\">";
-           }
-           else
-           {
-               print "<LI>";
-           }
-           $lastvalues[$level] = $value;
-           print "<A HREF=\"part$firstcomp.html#sec$heading\">\n";
-           $paragraph = $linetail;
-           $listentry = 1;
-           next;
-       }
-    }
-    elsif (/^[A-Z][^a-z]+$/)
-    {
-       print_paragraph $paragraph, "", $listentry ? "</A>" : "";
-       if ($level == 0)
-       {
-           print "\n<H2>$_</H2>\n\n";
-       }
-       else
-       {
-           #print "</P>\n\n";
-           print "</OL>\n\n" x ($level - 1);
-           print "\n" if $level == 1;
-           print "<H3>$_</H3>\n\n";
-           print "<OL>\n" x ($level - 1);
-           #print "<P>\n";
-           $#lastvalues = 0;
-       }
-       $listentry = 0;
-       next;
-    }
-    elsif (/^$/)
-    {
-       print_paragraph $paragraph, "", $listentry ? "</A>" : "";
-       $listentry = 0;
-       next;
-    }
-    print_paragraph $paragraph;
-    $paragraph = $_;
-}
-
-# Do all the necessary end tags
-#print "</P>\n" if $level > 0;
-print "\n<BR>\n" if $level > 0;
-print "\n";
-print "</OL>\n\n" x $level;
-
-html_footer $up_url;
-select STDOUT;
-close INDEX;
-
-$paragraph = <>;
-my $oldsection;
-my $section;
-my $section_open = 0;
-my $num_sections = $lastvalues[1];
-my $in_heading = 0;
-my $in_h2 = 0;
-$level = 0;
-$#lastvalues = -1;
-
-my $heading_pat = qr/^\s*([0-9]+(?:.[0-9]+)*)\)\s+/;
-
-while (<>)
-{
-    s/\s+\n/\n/;
-    html_escape $_;
-
-    if (/^\s*([0-9]+)\)\s/)
-    {
-       chomp $paragraph if defined $paragraph;
-       if ($section_open)
-       {
-           if ($in_heading)
-           {
-               print_paragraph $paragraph, "", "</STRONG></A>";
-           }
-           else
-           {
-               print_paragraph $paragraph, "<P>\n", "\n</P>";
-           }
-       }
-       $in_heading = $in_h2 = 0;
-       $oldsection = $section;
-       $section = $1;
-       print "\n" if $section_open;
-       print "</OL>\n\n" x $level if $section_open;
-       html_footer $index_file,
-                   ($oldsection > 1) ?
-                       ("part" . ($oldsection - 1) . ".html") :
-                       undef,
-                   "part" . ($oldsection + 1) . ".html"
-           if $section_open;
-       open SECTION, ">part$section.html" or
-           die "Couldn't write to part$section.html: $!";
-       select SECTION;
-       html_header "section $section",
-                   $index_file,
-                   "part" . ($section - 1) . ".html",
-                   ($section < $num_sections) ?
-                       ("part" . ($section + 1) . ".html") :
-                       undef;
-       $section_open = 1;
-       $level = 0;
-       $#lastvalues = -1;
-    }
-
-    # Convert headings to anchors in list items
-    if (/$heading_pat/)
-    {
-       my $heading = $1;
-       my @components = split /\./, $heading;
-       chomp $paragraph if defined $paragraph;
-       if ($in_heading)
-       {
-           print_paragraph $paragraph, "", "</STRONG></A>\n";
-       }
-       else
-       {
-           print_paragraph $paragraph, "<P>\n", "\n</P>\n";
-       }
-       $in_h2 = 0;
-
-       # Change level of ordered list if necessary
-       if (@components > $level)
-       {
-           print "<OL>\n\n" x (@components - $level);
-       }
-       elsif (@components < $level)
-       {
-           print "</OL>\n\n" x ($level - @components);
-       }
-       $level = @components;
-       $#lastvalues = $level;
-
-       my $value = $components[$#components];
-       if (@components == 1)
-       {
-           chomp;
-           s|$heading_pat|<LI><H2><A NAME="sec$1">|;
-           $in_h2 = 1;
-       }
-       elsif (defined $lastvalues[$level] &&
-              $lastvalues[$level] + 1 != $value)
-       {
-           warn "Missing item in main document before $heading";
-           s|$heading_pat|<LI VALUE="$value"><A NAME="sec$1"><STRONG>|;
-       }
-       elsif ($value != 1)
-       {
-           s|$heading_pat|<LI VALUE="$value"><A NAME="sec$1"><STRONG>|;
-       }
-       else
-       {
-           s|$heading_pat|<LI><A NAME="sec$1"><STRONG>|;
-       }
-       $lastvalues[$level] = $value;
-
-       warn "Heading $heading encountered outside a section"
-           unless defined $section;
-       warn "Heading $heading encountered in section $section"
-           if defined $section && $heading !~ /^$section(?:\.|$)/;
-
-       $in_heading = 1;
-    }
-
-    # Mark unnumbered headings
-    if (/^([A-Z][^a-z]*[A-Z])\n/)
-    {
-       chomp;
-       $paragraph = $_;
-
-       print "\n</OL>\n" x ($level - 1);
-       print "\n" if $level != 1;
-       print_paragraph $paragraph, "<H3>", "</H3>";
-       $in_heading = $in_h2 = 0;
-       print "\n<OL>\n" x ($level - 1);
-       $#lastvalues = 0;
-
-       $_ = "";
-    }
-
-    # If this is a paragraph delimiter of some kind (usually a blank line),
-    # print the preceding paragraph, handling things we recognize as tables.
-    if (defined $paragraph &&
-       (/^\n/ || ($in_heading && $paragraph =~ /<A NAME[^>]*>.{0,40}$/)))
-    {
-       if (($paragraph =~ /ISBN +[0-9]-/ &&
-            $paragraph =~ /\((?:hc|pb|trade pb)\)/)
-           || $paragraph =~ /c\/o Del Rey Books/
-           || $paragraph =~ /esper\.net$/m)
-       {
-           $paragraph =~ s/\n/<BR>\n/g;
-       }
-       else
-       {
-           # We have to split up the paragraph and work line-by-line here;
-           # multi-line regexps are really hard to get right.
-           my @parlines = split /\n/, $paragraph;
-           my $prevline;
-           foreach my $parline (@parlines)
-           {
-               unless (defined $prevline)
-               {
-                   $prevline = \$parline;
-                   next;
-               }
-               if ($parline =~ /^(\s*)((?:\w\)|
-                                \[\w\]|
-                                \w+(?:\s+\w+)?:\s*http).*|
-                                \&lt;http(?:[^&]|\&(?!gt;))*\&gt;)$/x)
-               {
-                   $parline = "$1$2<BR>";
-                   $$prevline .= "<BR>" if $$prevline !~ /<BR>$/;
-               }
-               $prevline = \$parline;
-           }
-           $paragraph = (join "\n", @parlines) . "\n";
-           $paragraph =~ s/:$/:<BR>/gm;
-       }
-       chomp $paragraph;
-       $paragraph =~ s/(\S)  +/$1 /g unless /<BR>/;
-       if ($in_h2)
-       {
-           print_paragraph $paragraph, "", "</A></H2>\n";
-           $in_h2 = 0;
-       }
-       else
-       {
-           if ($in_heading)
-           {
-               print_paragraph $paragraph, "", "</STRONG></A>";
-           }
-           else
-           {
-               print_paragraph $paragraph, "<P>\n", "\n</P>";
-           }
-       }
-       $in_heading = 0;
-       $paragraph = "$_" unless /^\n?$/;
-    }
-    elsif (defined $paragraph)
-    {
-       $paragraph .= "$_";
-    }
-    else
-    {
-       $paragraph = "$_" unless /^\n?$/;
-    }
-}
-
-if ($section_open)
-{
-    chomp $paragraph if defined $paragraph;
-    if ($in_heading)
-    {
-       print_paragraph $paragraph, "", "</STRONG></A>";
-    }
-    else
-    {
-       print_paragraph $paragraph, "<P>\n", "\n</P>";
-    }
-    print "\n";
-    print "</OL>\n\n" x $level;
-
-    html_footer $index_file,
-               ($section > 1) ? ("part" . ($section - 1) . ".html") : undef,
-               undef;
-    close SECTION if $section_open;
-}
-else
-{
-    warn "No sections encountered";
-}
-
diff --git a/horja b/horja
deleted file mode 100755 (executable)
index e56129d..0000000
--- a/horja
+++ /dev/null
@@ -1,4 +0,0 @@
-grep -v ^# birthdays.txt | grep '[^/]*'/$(date +%m/%d) | tr '\t' ' ' | sed \
-'s|/../.. *|\\|'|awk -F\\ '{A='$(date +%Y)'-$1; gsub("['\''\"( ]","\\\\&", \
-$2);srand();system("sed "($1=="XXXX"?"/AGE/,/^/d":"s/AGE/"A"/")" message." \
-"txt | sed s/NAME/"$2"/|cat - horja"(rand()>10?"":".sig")" | inews -hOS");}'
diff --git a/mordja b/mordja
deleted file mode 100755 (executable)
index 10a1755..0000000
--- a/mordja
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/sh -e
-
-# Usage: mordja to-address subject file
-
-export PATH=/usr/bin:/bin
-
-cd ~/afe/daemons/mordja
-{ cat "$3"; echo '-- '; cat .signature; } | mutt -F .muttrc -s "Re: $2" "$1"
-
diff --git a/mordja-zip b/mordja-zip
deleted file mode 100755 (executable)
index 4542b2b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/sh -e
-
-# Usage: mordja to-address subject file
-
-export PATH=/usr/bin:/bin
-
-cd ~/afe/daemons/mordja
-{ echo '-- '; cat .signature; } | mutt -F .muttrc -s "Re: $2" "$1" -a "$3"
-
diff --git a/prune-sessions b/prune-sessions
deleted file mode 100755 (executable)
index 215d96a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-cd $HOME/public_html/kamion/archive-bin
-exec ./prune-sessions.pl 96
diff --git a/run-horja b/run-horja
deleted file mode 100755 (executable)
index 069fea4..0000000
--- a/run-horja
+++ /dev/null
@@ -1,6 +0,0 @@
-#! /bin/bash
-
-# Run the alt.fan.eddings Birthday Daemon
-cd $HOME/afe/daemons
-export PATH=$HOME/bin:$PATH
-$HOME/bin/horja
diff --git a/silver-suggestions b/silver-suggestions
deleted file mode 100755 (executable)
index 2657001..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /bin/sh
-
-# Post the Silver Suggestions every fortnight
-cd $HOME/afe/daemons
-$HOME/bin/crondiv 2 silver-suggestions.log inews -hS silver-suggestions.txt
diff --git a/tabulateafe b/tabulateafe
deleted file mode 100755 (executable)
index 1178433..0000000
+++ /dev/null
@@ -1 +0,0 @@
-cut -d' ' -f2- afe-posters | sort | uniq | sed -e 's/"/\\"/g' | sed -e 's/ /\\ /g' | sed -e s/\'/\\\\\'/g | xargs -n 1 countafe