🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
6 messages
6 total messages Started by New Light Industries LTD Wed, 08 Dec 1993 00:21
Different .sig for different group?
#6850
Author: New Light Industries LTD
Date: Wed, 08 Dec 1993 00:21
13 lines
1123 bytes
I know that you can use nn to have a different signature file for each group
that you post to.  That is a great idea to me, but I use Tin 1.2 PL0.  Is
there a way that I can do this with Tin?

Thanks in advance,

	Jesse McGrew

-- 
The opinions in the above text are strictly my own.
	--> How many MS-Windows (r) programs does it take to change a light
		bulb?
  >>--> Two: 1 to get the bulb, and 1 to put it in wrong.
Re: Different .sig for different group?
#6851
Author: Tom Christiansen
Date: Wed, 08 Dec 1993 02:14
150 lines
4769 bytes
:-> In news.software.readers, newlight@comtch.iea.com (New Light Industries LTD) writes:
:I know that you can use nn to have a different signature file for each group
:that you post to.  That is a great idea to me, but I use Tin 1.2 PL0.  Is
:there a way that I can do this with Tin?


I don't know about Tin -- I presume it just calls inews -- bu thits
might do it for you.  It's what I have used in the past.  It's, um,.
self-documenting. :-)

--tom
#!/usr/bin/perl
#
# sigrand -- supply random fortunes for .signature file

################################################################
# begin configuration section 

$MKNOD = "/etc/mknod";

&gethome;

# for rec/humor/funny instead of rec.humor.funny
$NG_IS_DIR 	= 1; 	

$FULLNAME 	= "$HOME/.fullname";
$FIFO 		= "$HOME/.signature";
$ART 		= "$HOME/.article";
$NEWS 		= "$HOME/News";
$SIGS 		= "$NEWS/SIGNATURES";
$SEMA		= "$HOME/.sigrandpid";
$GLOBRAND	= 1/4;	# chance to use global sigs anyway

# end configuration section -- HOME and FORTUNE get autoconf'd
################################################################

&setup;

&justme;

fork && exit; 	# be a daemon 

open (SEMA, ">$SEMA") || die "can't write $SEMA: $!";
print SEMA "$$\n";
close SEMA || die "can't close $SEMA: $!";

MAIN: while (1) {
    open (FIFO, "> $FIFO") || die "can't write $FIFO: $!";
    &load_sigs;
    $sig = $sig[rand @sig];
    print FIFO $name, "\n" x (3 - ($sig =~ tr/\n//)), $sig;
    close FIFO;
    sleep 2; # to avoid dup sigs
}

################################################################

sub setup {
    if (-e $FULLNAME) {
	$name = `cat $FULLNAME`;
	die "$FULLNAME should contain only 1 line, aborting" 
	    if $name =~ tr/\n// > 1;
    } else {
	chop($host = `hostname`);
	($host) = gethostbyname($host) unless $host =~ /\./;
	$user = $ENV{USER} || $ENV{LOGNAME} || $pw[0] || die "intruder alert";
	($name = $pw[6]) =~ s/,.*//;
	$name =~ s/&/\u\L$user/g; # can't believe some folks still do this
	$name = "\t$name\t$user\@$host\n";
    } 


    &check_fortunes if !-e $SIGS;

    unless (-p $FIFO) {
	if (!-e _) {
	    system("$MKNOD $FIFO p") && die "can't mknod $FIFO";
	    warn "created $FIFO as a named pipe\n";
	} else {
	    die "$0: won't overwrite file .signature\n";
	} 
    }


    srand(time|$$);
}

sub load_sigs {
    local($sigfile) = &ng;
    if (!-e $sigfile) {
	@sig = (&fortune);
	return;
    } 
    open (SIGS,$sigfile) || die "can't open $sigfile";
    local($/) = "%%\n";
    undef @sig;
    while (<SIGS>) {
	s!$/$!!o;
	push(@sig,$_);
    } 
    close SIGS;
} 

sub ng {
     (rand(1.0) > ($GLOBRAND) && open ART) || return $SIGS;   
     local($/) = '';
     $_ = <ART>;
     ($ng) = /Newsgroups:\s*([^,\s]*)/;
     $ng =~ s!\.!/!g if $NG_IS_DIR; 	# if rn -/,  or SAVEDIR=%p/%c
     $ng = "$NEWS/$ng/SIGNATURES";
     -f $ng ? $ng : $SIGS;
} 

sub fortune {
   local($_, $tries);
   do { 
       $_ = `$FORTUNE -s`; 
   } until tr/\n// < 4 || $tries++ > 20;
   local($*) = 1;
   s/^/ /g;
   $_ || " SIGRAND: deliver random signals to all processes.\n";
} 

sub check_fortunes {
    return if $FORTUNE;
    foreach $dir (split(/:/, $ENV{PATH}), '/usr/games') {
	return if -x ($FORTUNE = "$dir/fortune");
    } 
    die "Need either $SIGS or a fortune program, bailing out";
} 

sub gethome {
    @pw = getpwuid($<);
    $HOME = $ENV{HOME} || $ENV{LOGDIR} || $pw[7]
		       || die "no home directory for user $<";
}

# "There can be only one."  --the Highlander
sub justme {
    if (open SEMA) {
	chop($pid = <SEMA>);
	kill(0, $pid) && die "$0 already running (pid $pid)\n";
	#warn "COOL: no $pid: $!";
	close SEMA;
    } 
} 
-- 
    Tom Christiansen      tchrist@cs.colorado.edu       
      "Will Hack Perl for Fine Food and Fun"
	Boulder Colorado  303-444-3212
Re: Different .sig for different group?
#6857
Author: Iain Lea
Date: Wed, 08 Dec 1993 07:37
26 lines
2064 bytes
newlight@comtch.iea.com wrote:
:
: I know that you can use nn to have a different signature file for each group
: that you post to.  That is a great idea to me, but I use Tin 1.2 PL0.  Is
: there a way that I can do this with Tin?

From the manual page:

SIGNATURES
       [stuff deleted]
       Tin also has the capability to generate random  signatures  on  a
       per  newsgroup basis if so desired. The way to accomplish this is
       to specify the default signature or the group  attribute  sigfile
       as   a   directory.    If   for   example  the  sigfile  path  is
       /usr/iain/.sigs and .sigs is a directory then tin will  select  a
       random  signature  from  any  file that is in the directory .sigs
       (note: one signature per numbered file). A random  signature  can
       also  consist  of  a  fixed  part signature that can contain your
       name, address etc. followed by the random sig. The fixed part  of
       the random sig is read from the file $HOME/.sigfixed.

You could also set a per group signature via the group attributes file (RTM).

-- 
iain.lea@erlm.siemens.de  +49-9131-7-43402
 'Raus aus dem Alltag, rein in die Kiste'
Re: Different .sig for different group?
#6958
Author: My .plan is back!
Date: Wed, 15 Dec 1993 19:02
29 lines
2248 bytes
In article <1993Dec8.073711.28299@anl433.uucp> iain.lea@anl433.erlm.siemens.de (Iain Lea) writes:
>newlight@comtch.iea.com wrote:
>:
>: I know that you can use nn to have a different signature file for each group
>: that you post to.  That is a great idea to me, but I use Tin 1.2 PL0.  Is
>: there a way that I can do this with Tin?
>
>From the manual page:
>
>SIGNATURES
>       [stuff deleted]
>       Tin also has the capability to generate random  signatures  on  a
>       per  newsgroup basis if so desired. The way to accomplish this is
>       to specify the default signature or the group  attribute  sigfile
>       as   a   directory.    If   for   example  the  sigfile  path  is
>       /usr/iain/.sigs and .sigs is a directory then tin will  select  a
>       random  signature  from  any  file that is in the directory .sigs
>       (note: one signature per numbered file). A random  signature  can
>       also  consist  of  a  fixed  part signature that can contain your
>       name, address etc. followed by the random sig. The fixed part  of
>       the random sig is read from the file $HOME/.sigfixed.
>
>You could also set a per group signature via the group attributes file (RTM).
>

Can this be done with trn?
How?

Berg
Re: Different .sig for different group?
#6968
Author: Tom Christiansen
Date: Thu, 16 Dec 1993 01:34
175 lines
5946 bytes
:-> In news.software.readers, bergerde@dunx1.ocs.drexel.edu (My .plan is back!) writes:
:In article <1993Dec8.073711.28299@anl433.uucp> iain.lea@anl433.erlm.siemens.de (Iain Lea) writes:
:>newlight@comtch.iea.com wrote:
:>:
:>: I know that you can use nn to have a different signature file for each group
:>: that you post to.  That is a great idea to me, but I use Tin 1.2 PL0.  Is
:>: there a way that I can do this with Tin?
:>
:>From the manual page:
:>
:>SIGNATURES
:>       [stuff deleted]
:>       Tin also has the capability to generate random  signatures  on  a
:>       per  newsgroup basis if so desired. The way to accomplish this is
:>       to specify the default signature or the group  attribute  sigfile
:>       as   a   directory.    If   for   example  the  sigfile  path  is
:>       /usr/iain/.sigs and .sigs is a directory then tin will  select  a
:>       random  signature  from  any  file that is in the directory .sigs
:>       (note: one signature per numbered file). A random  signature  can
:>       also  consist  of  a  fixed  part signature that can contain your
:>       name, address etc. followed by the random sig. The fixed part  of
:>       the random sig is read from the file $HOME/.sigfixed.
:>
:>You could also set a per group signature via the group attributes file (RTM).
:>
:
:Can this be done with trn?

If you put it in one program, you have to put it in many,
some of which surely you'll not have access to.

Once a again, here's my sigrand program.  Sheesh.

--tom


#!/usr/bin/perl
#
# sigrand -- supply random fortunes for .signature file

################################################################
# begin configuration section 

$MKNOD = "/etc/mknod";

&gethome;

# for rec/humor/funny instead of rec.humor.funny
$NG_IS_DIR 	= 1; 	

$FULLNAME 	= "$HOME/.fullname";
$FIFO 		= "$HOME/.signature";
$ART 		= "$HOME/.article";
$NEWS 		= "$HOME/News";
$SIGS 		= "$NEWS/SIGNATURES";
$SEMA		= "$HOME/.sigrandpid";
$GLOBRAND	= 1/4;	# chance to use global sigs anyway

# end configuration section -- HOME and FORTUNE get autoconf'd
################################################################

&setup;

&justme;

fork && exit; 	# be a daemon 

open (SEMA, ">$SEMA") || die "can't write $SEMA: $!";
print SEMA "$$\n";
close SEMA || die "can't close $SEMA: $!";

MAIN: while (1) {
    open (FIFO, "> $FIFO") || die "can't write $FIFO: $!";
    &load_sigs;
    $sig = $sig[rand @sig];
    print FIFO $name, "\n" x (3 - ($sig =~ tr/\n//)), $sig;
    close FIFO;
    sleep 2; # to avoid dup sigs
}

################################################################

sub setup {
    if (-e $FULLNAME) {
	$name = `cat $FULLNAME`;
	die "$FULLNAME should contain only 1 line, aborting" 
	    if $name =~ tr/\n// > 1;
    } else {
	chop($host = `hostname`);
	($host) = gethostbyname($host) unless $host =~ /\./;
	$user = $ENV{USER} || $ENV{LOGNAME} || $pw[0] || die "intruder alert";
	($name = $pw[6]) =~ s/,.*//;
	$name =~ s/&/\u\L$user/g; # can't believe some folks still do this
	$name = "\t$name\t$user\@$host\n";
    } 


    &check_fortunes if !-e $SIGS;

    unless (-p $FIFO) {
	if (!-e _) {
	    system("$MKNOD $FIFO p") && die "can't mknod $FIFO";
	    warn "created $FIFO as a named pipe\n";
	} else {
	    die "$0: won't overwrite file .signature\n";
	} 
    }


    srand(time|$$);
}

sub load_sigs {
    local($sigfile) = &ng;
    if (!-e $sigfile) {
	@sig = (&fortune);
	return;
    } 
    open (SIGS,$sigfile) || die "can't open $sigfile";
    local($/) = "%%\n";
    undef @sig;
    while (<SIGS>) {
	s!$/$!!o;
	push(@sig,$_);
    } 
    close SIGS;
} 

sub ng {
     (rand(1.0) > ($GLOBRAND) && open ART) || return $SIGS;   
     local($/) = '';
     $_ = <ART>;
     ($ng) = /Newsgroups:\s*([^,\s]*)/;
     $ng =~ s!\.!/!g if $NG_IS_DIR; 	# if rn -/,  or SAVEDIR=%p/%c
     $ng = "$NEWS/$ng/SIGNATURES";
     -f $ng ? $ng : $SIGS;
} 

sub fortune {
   local($_, $tries);
   do { 
       $_ = `$FORTUNE -s`; 
   } until tr/\n// < 4 || $tries++ > 20;
   local($*) = 1;
   s/^/ /g;
   $_ || " SIGRAND: deliver random signals to all processes.\n";
} 

sub check_fortunes {
    return if $FORTUNE;
    foreach $dir (split(/:/, $ENV{PATH}), '/usr/games') {
	return if -x ($FORTUNE = "$dir/fortune");
    } 
    die "Need either $SIGS or a fortune program, bailing out";
} 

sub gethome {
    @pw = getpwuid($<);
    $HOME = $ENV{HOME} || $ENV{LOGDIR} || $pw[7]
		       || die "no home directory for user $<";
}

# "There can be only one."  --the Highlander
sub justme {
    if (open SEMA) {
	chop($pid = <SEMA>);
	kill(0, $pid) && die "$0 already running (pid $pid)\n";
	#warn "COOL: no $pid: $!";
	close SEMA;
    } 
} 
-- 
    Tom Christiansen      tchrist@cs.colorado.edu       
      "Will Hack Perl for Fine Food and Fun"
	Boulder Colorado  303-444-3212
Re: Different .sig for different group?
#7020
Author: Viktor Weisshaupl
Date: Sun, 19 Dec 1993 13:22
18 lines
1516 bytes
I am using TIN and have chosen the PICO-editor to edit letters.
I don't use a standard signature. I have created two files with two
different signatures, one detailed and one minimal. After editing the
letter I merge the sig I want into the file, in PICO the command is

 ^R <file name>

very simple if file names are only one letter. It may not be elegant but
it is transparent and easily done for a non computer expert.

Regards, Viktor

 --
Viktor Weisshaupl
Oulu University
Oulu, Finland
E-mail Internet: vweiss@phoenix.oulu.fi
                 vweiss@zombie.oulu.fi
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads