Re: exec statement

2002-07-18 Thread Roger Morris

At 08:28 AM 7/18/2002 -0700, Maureen E Fischer wrote:
Thank you Bob,
 This works for me.  One further question.  I thought I read somewhere
that you should
not put full paths in a CGI program for security reasons.  Should that be a
consideration?
Maureen

For security, you should put full paths.

if you called 'blah.cgi', someone could create blah.cgi, their blah.cgi 
could get called instead of your blah.cgiby 
specifying  /usr/local/bin/blah.cgi  it clearly defines which blah.cgi 
would get called.

Roger



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How to do a cron job?

2002-04-15 Thread Roger Morris

At 04:03 PM 4/15/2002 -0700, Dennis G. Wicks wrote:
Greetings;

For ssh access get Tera Term and the SSH extensions.

I use it both at home and at work and it works and
is simple to set up.

You can find them using Google.

Good Luck!
Dennis

Putty is another alternative.  Single file, no dll's.  The only thing I 
dislike is the preferences are stored in the registry.

Roger

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: help with perl/Tk

2002-03-07 Thread Roger Morris

At 01:14 PM 3/7/2002 -0500, richard noel fell wrote:
Below is a simple script which I am using as part of my attempt to learn
how to program a gui with perl and Tk. I have copied the program from a
book, Cross Platform Perl (not very good, but some isolated good
parts), but get the following error message when I try to compile the
program. Has anyone any idea what is wrong?
Thanks in advance,
Dick Fell



[rfell@rosewall webproject]$ tktext.pl
Unquoted string end may clash with future reserved word at ./tktext.pl
line 57.
Can't modify negation (-) in scalar assignment at ./tktext.pl line 8,
near File,
Execution of ./tktext.pl aborted due to compilation errors.
[rfell@rosewall webproject]$



#!/usr/local/ActivePerl-5.6/bin/perl5.6.1 -w

use Tk;
my $main=new MainWindow;
$menubar= $main-Frame(-relief=raised,
-borderwidth=2);

$filebutton=$menubar-Menubutton;(-text=File,
 -underline=0);

Stray ;  up there?


$filemenu=$filebutton-Menu();

$filebutton-configure(-menu=$filemenu);

$filemenu-command(-command=\open_choice,
-label=Open...,
-underline=0);

$filemenu-command(-command=\dump_choice,
-label=Dump.,
-underline=0);
$filemenu-command(-command=\exit_choice,
-label=Exit,
-underline=1);

$filemenu-pack(-side=left);

$text=$main-Scrolled('Text',
   -relief=sunken,
   -boderwidth=2,
   -setgrid=true);

$text-insert(1.0,This is somes text.);

$text-pack(-side=top,
 -expand=1,
 -fill='both');

$status=$main-Label(-text=Status Area,
  -relief=sunken,
  -borderwidth=2,
  -anchor=w);

$status-pack(-side=top,-fill=x);

MainLoop;

sub exit_choice{
exit; }

sub open_choice{
$status-congiure(-text=Open file.);
}

sub dump_choice{
$status-congiure(-text=Dumping text...);
print $text-get(1.0,end);
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Email Validation

2002-02-19 Thread Roger Morris

I've been working on email validation for a script.  The examples I've seen 
haven't exactly done that great of a job.  I've taken the code and messed 
with it some.
My thoughts were, if the email is in the correct format, 
ie  [EMAIL PROTECTED]  or some form like   [EMAIL PROTECTED]  then go 
to the second 'if' statement and check for bad characters.
It seems to work how I want, have I caught most of the problems?   I'm only 
interested in the email address, not checking to see if this is 
valid:  roger [EMAIL PROTECTED]


sub  valid_email ()
{
if ($e_address =~ /^\w+(\.\w+){0,}\@\w+(\.\w+){1,}$/i)
{
if ($e_address =~ /\'\{\}\[\]\(\)\$\%*/i)
{   
return 0;
}
return 1;
}
return 0;
}




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Email Validation

2002-02-19 Thread Roger Morris

At 03:35 PM 2/19/2002 -0800, Randal L. Schwartz wrote:
  Roger == Roger Morris [EMAIL PROTECTED] writes:

Roger I've been working on email validation for a script.  The examples I've
Roger seen haven't exactly done that great of a job.  I've taken the code
Roger and messed with it some.

But not enough. :)

Roger sub  valid_email ()
Roger {
Roger if ($e_address =~ /^\w+(\.\w+){0,}\@\w+(\.\w+){1,}$/i)

That ignores fred[EMAIL PROTECTED], a valid and active email
address. (Try it!  It's an autoresponder!)

It permits [EMAIL PROTECTED], an invalid email address.

Definitely wanna look at those other modules.


I hadn't found that module when I was searching the net.  the 
Email::Validdoesn't catch the @this_host.com  It also doesn't catch | 
in the email, which I would've thought shouldn't be permitted.
I'll keep digging.


Roger



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: wondering what might be causing this error

2002-02-11 Thread Roger Morris

At 06:55 PM 2/11/2002 -0500, Ian Christie wrote:
Hi,

I'm trying to get a script to work. I'm using linux and when I do 
something like the following

../myscript.cgi

I get

bash: ./myscript.cgi: bad interpreter: no such file or directory

I know the #! is correct. Could this be a bash problem? The script runs 
fine if I do

perl ./myscript.cgi

Be sure that myscript.cgi  has the correct permissions.

chmod 700 myscript.cgi

should do the trick.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Debug some simple code

2002-01-31 Thread Roger Morris

At 11:09 AM 1/31/2002 -0500, you wrote:
I am attempting a program that reads a list of numbers from the screen until
the number 999 is read.  It then prints the sum of all numbers read- with
the exception of the 999.

My code looks like:

until ($number=999) {
print Please input your number:\n;
chomp($number=STDIN);
@a=$number;
}
foreach $i (@a) {
$c+=$i;
}
if ($number=999) {
print Your total is: $c\n
}

The program immediately terminates with and the line Your total is: is
output with a  a blank value.  It never even prompts me to input a number.
What am I doing wrong?
=  is an assignment operator.  Equality is   ==

Roger
--
Roger Morris
User Services Specialist II
[EMAIL PROTECTED]
541-687-3579

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Filenames

2002-01-30 Thread Roger Morris

At 04:38 PM 1/30/2002 -0500, you wrote:
Hi,

Could someone please help out with the problem of dynamically changing the 
name of an output file?  I would like to concatenate the date to the name 
of the output file so that each time I run my script, the name of the 
output file is different...Any help would be greatly appreciated.

Thanks.

Just tried this on my linux machine.  `date +%s` will return the number of 
seconds since   00:00:00 1970-01-01 UTC

my $date=`date +%s`;
open (FILE,file.$date);
print FILE (blah);


It works for me.
Roger


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to abut two files?

2002-01-30 Thread Roger Morris

At 06:18 PM 1/30/2002 -0500, you wrote:
One of the most common needs in data analysis is to abut two files.  This
means to create a single file by horizontally pasting two files together.

So: starting with two files each with, say, 4 columns and 4 rows, the result
is one file with 8 columns and 4 rows.

For a couple decades now I've relied on Gary Perlman's stat utilities
(specfically, the abut program) to do this in a unix environment.

How to do it on a macintosh?  I'd like to avoid having to use a program like
microsoft excel.  I'm wondering if perl has the ability to abut two files.
I've downloaded perl, but before trying to master it, I'm hoping someone
knowledgeable would be willing to tell me if (and how) perl can easily abut
two files.

Essentially, you would go through both files a line at a time printing to a 
third file.
first reading the first file, print, read second file, print etc. for each 
line.

Which Mac OS do you have?  X should have perl by default.

Roger

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Sendmail and PERL

2002-01-17 Thread Roger Morris

chmod 700 should do it.  Any group or world writable should kill it.  I 
don't think sendmail complains about readable files as much as it does 
about writable files.
What do the logs say?

One other way is via a procmail recipe.

Something like:

:0
*
/path/to/perlscript



Roger



At 08:15 AM 1/17/2002 -0800, you wrote:
First thing I would do is check the permissions of the .forward file.  It
has to be VERY specific.  I wish I remembered what it was..

Agustin Rivera
Webmaster, Pollstar.com
http://www.pollstar.com



- Original Message -
From: Lysander [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 17, 2002 8:12 AM
Subject: Sendmail and PERL


Okay, this is probably more of a sendmail than a PERL question so I
apologize.  If anyone can give me information or even point me to a sendmail
list or resource I would appreciate it.

I am writing a PERL script that takes incoming mail, parses the contents,
and then uses them to update a status page.

I thought the sendmail part would be as simple as adding a
|/path/to/script.pl to the aliases file.  Unfortunately, I do not even
have read access to the aliases file on my webhost's computer.  I called
them and they told me I could accomplish the same thing with a .forward
file, but that they could not tell me how.

So I tried making a .forward file in my home directory with the line I would
have put in an aliases file.  But this didn't work.

Does anyone have any ideas, or resources on this?

Thanks
Sheridan



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Script Idea

2002-01-12 Thread Roger Morris

I've got a laptop running Linux.  When I go to work, the laptop gets it's 
IP address via DHCP, at home I have a private IP address that I use (for a 
home network that uses dial up for Internet), and at my other place of 
employ I have a third IP address that is used.
I've created a shell script that will prompt for where I am located, then 
sets the host information appropriate for my location (home,work1,work2).

I was thinking of automating it somewhat but wanted to get some ideas 
before I proceed.
My thought is to create a script that would set the IP address to work2 IP, 
then check to see if the gateway that's in use is available, if it's not 
then set to the private IP for home and see if one of the other computes is 
visible.  If none of the first two work, then assume it's DHCP and set the 
files; of course, non of this takes into account I may boot the computer 
with it not being part of any network.  I'd check for DHCP first, but if 
it's not available, I don't want to wait for the dhcp timeout to occur.

Question, Is it more trouble than it's worth to set something like this 
up?  Does the basic logic of what I want to do look okay?


Any thoughts?

Roger

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: formmail.pl security

2002-01-11 Thread Roger Morris

At 12:18 PM 1/11/2002 -0800, Scott Lutz wrote:
I am curious if anyone is familiar with a way to tighten security on
this script?
We am experiencing some sort of script that is exploiting this code, and
am looking for some previous experience here . .

please

Is this the script available from Matt's Script Archive?  The web site says 
there is an upgrade to fix a security problem.  What problems are you having?

The problem that I saw was that the script takes the email address that is 
embedded in the form and mails the form to that person.  The problem is, 
someone off-site could create a form that points to the script and send via 
your mail program (can you say spam).  One work around is to hack the code 
such that the recipient is hard-coded in the script, not the form.


Roger

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Roger Morris

Eugene, Oregon.


At 10:08 AM 11/9/2001 -0500, Etienne Marcotte wrote:
By reading the messages everyday I can guess most of us are from United
States right? And since there are not a lot of messages in (my) morning
time, probably means most are from the west coast (different timezone).

Am I right?

I'm from Quebec, Canada.. and you?

Sorry if it's way off topic, I hope the ones that hate OT subject
filtered *off*topic* in their  emails!

Etienne

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
Roger Morris
User Services Specialist II
[EMAIL PROTECTED]
541-687-3579

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




combine commands

2001-08-29 Thread Roger Morris

Hi,
Just trying to un-clutter some code.   Following is the relevant part:
$ucscode is assigned a value via a split on :  There could be white space 
at the begging and end of the value.  the value could be Upper case.  The 
end result should be no white space, all lower case. There may or may not 
be a line-feed.
the result ends up in $scode.

I have:

my $ucscode;
my $scode;

split


chomp $ucscode; # remove line-feed
$ucscode =~ s/^\s+|\s+$//g; # remove spaces
$scode=lc($ucscode);# make lower case.


Can this series be done with one variable?  Can this be done on one line?


Thanks.

Roger

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]