Timezone conversion

2004-04-02 Thread Distribution Lists
can someone give me ideas of how I could covert this date and time stamp
that is in GMT to Central time ?

2004-04-01-19:15:15.525+00:00

Thanks

-- 


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




Timezone conversion

2004-04-01 Thread Distribution Lists

can someone give me ideas of how I could convert this date and time stamp
that is in GMT to Central time ?

2004-04-01-19:15:15.525+00:00

Thanks

-- 




-- 


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




Re: Regular expression to replace whitespace with comma

2004-03-12 Thread Distribution Lists
That worked great!
Thanks Darryl
> On Mar 12, 2004, at 3:19 PM, Distribution Lists wrote:
>
>> Thanks but I've that already try that
>>
>> C:\temp>perl -pi.bak -e "s/\s+/,/g" tempfile.out
>
> Add the -l switch to that to chomp the newline and replace it when it
> prints:
>
> perl -pli.bak -e "s/\s+/,/g" tempfile.out
>
> James
>
>> C:\temp>more < tempfile.out
>> Server,Drive,FSTYPE,Size,Free,Used,SERVER1,C$,NTFS,4095,296,3799,SERVER
>> 1,D$,NTFS,4001,1908,2093,SERVER1,C$,NTFS,38123,29808,8315,
>>
>> The only thing that is missing this the new line after field 6
>>
>> So that it will come out like this
>>
>> Server,Drive,FSTYPE,Size,Free,Used
>> SERVER1,C$,NTFS,4095,296,3799
>> SERVER2,D$,NTFS,4001,1908,2093
>> SERVER3,C$,NTFS,38123,29812,8315
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>


-- 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




[Fwd: Re: Regular expression to replace whitespace with comma]

2004-03-12 Thread Distribution Lists


Thanks but I've that already try that

C:\temp>perl -pi.bak -e "s/\s+/,/g" tempfile.out

C:\temp>more < tempfile.out
Server,Drive,FSTYPE,Size,Free,Used,SERVER1,C$,NTFS,4095,296,3799,SERVER1,D$,NTFS,4001,1908,2093,SERVER1,C$,NTFS,38123,29808,8315,

The only thing that is missing is that after field 6 there is no comma,
but a newline

So that it will come out like this

Server,Drive,FSTYPE,Size,Free,Used
SERVER1,C$,NTFS,4095,296,3799
SERVER2,D$,NTFS,4001,1908,2093
SERVER3,C$,NTFS,38123,29812,8315



> On Mar 12, 2004, at 2:55 PM, Distribution Lists wrote:
>
>> Can someone please tell what regular expression would change
>>
>> Server   Drive   FSTYPE   Size  Free  Used
>> SERVER1  C$   NTFS4095   296  3799
>> SERVER2  D$   NTFS4001  1908  2093
>> SERVER3  C$   NTFS   38123 29811  8312
>>
>> to
>>
>> Server,Drive,FSTYPE,Size,Free,Used
>> SERVER1,C$,NTFS,4095,296,3799
>> SERVER2,D$,NTFS,4001,1908,2093
>> SERVER3,C$,NTFS,38123,29812,8312
>
> s/\s+/,/g;
>
> James
>
>


-- 




-- 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Regular expression to replace whitespace with comma

2004-03-12 Thread Distribution Lists
Can someone please tell what regular expression would change

Server   Drive   FSTYPE   Size  Free  Used
SERVER1  C$   NTFS4095   296  3799
SERVER2  D$   NTFS4001  1908  2093
SERVER3  C$   NTFS   38123 29811  8312

to

Server,Drive,FSTYPE,Size,Free,Used
SERVER1,C$,NTFS,4095,296,3799
SERVER2,D$,NTFS,4001,1908,2093
SERVER3,C$,NTFS,38123,29812,8312

Thanks

-- 


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




search for string then deleting a line

2003-07-31 Thread Distribution Lists
Can someone give me a clue

I want to search through a file for a given string, when the string is
found then delete the whole line. For example

test.user: cd9p06

search for "test.user", then delete "test.user: cd9p06"

Thanks


-- 
http://www.e-securenetworks.net
http://www.shopper-holic.com
http://www.planet247.net
http://www.auction-holic.com

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



Re: Can't get the regular expression right

2003-07-09 Thread Distribution Lists
Doh...just realized I'm evaluating the wrong way...sorry


> I'm trying to check if a user exists in /etc/passwd on a remote
>
> Here is my code, tried to do this 2 different ways, neither way will work.
> Any advice ?
>
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $FORM{$name} = $value;
> }
>
> $userid = $FORM{userid};
> $username = $FORM{username};
> #chomp ($userid);
> print $userid;
>
> @listusers = `ssh -i ~/.ssh/whoisit  -l  'cat
> /etc/passwd'`;
> print "";
> foreach $file (@listusers) {
> print "$file";
>
> #  if ($userid =~ /a.*/) {
> if ( $userid  =~ /^$file./ ) {
> print "exists";
> ## yes, it matches
> } else {
> print " not exist";
> #   print " does not exist";
> ## no, it doesn't
> }
>
>
>
>
>
>
>
> print "";
> }
>
> print "";
> foreach ($i = 0; $i<$#listusers; $i++) {
>
> #   if ($userid =~ /^$listusers[$i]/) {
> #   if $listusers[$i] =~ /a/) {
> print "$listusers[$i]";
> print "";
> if ( $userid =~ /^$listusers[$i]/i ) {
>
> print "exists ";
> ## yes, it matches
> } else {
> print " does not exist ";
> ## no, it doesn't
> }
> }
>
>
>
>
> --
> http://www.e-securenetworks.net
> http://www.shopper-holic.com
> http://www.planet247.net
> http://www.auction-holic.com
>


-- 
http://www.e-securenetworks.net
http://www.shopper-holic.com
http://www.planet247.net
http://www.auction-holic.com

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



Can't get the regular expression right

2003-07-09 Thread Distribution Lists
I'm trying to check if a user exists in /etc/passwd on a remote

Here is my code, tried to do this 2 different ways, neither way will work.
Any advice ?

@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}

$userid = $FORM{userid};
$username = $FORM{username};
#chomp ($userid);
print $userid;

@listusers = `ssh -i ~/.ssh/whoisit  -l  'cat
/etc/passwd'`;
print "";
foreach $file (@listusers) {
print "$file";

#  if ($userid =~ /a.*/) {
if ( $userid  =~ /^$file./ ) {
print "exists";
## yes, it matches
} else {
print " not exist";
#   print " does not exist";
## no, it doesn't
}







print "";
}

print "";
foreach ($i = 0; $i<$#listusers; $i++) {

#   if ($userid =~ /^$listusers[$i]/) {
#   if $listusers[$i] =~ /a/) {
print "$listusers[$i]";
print "";
if ( $userid =~ /^$listusers[$i]/i ) {

print "exists ";
## yes, it matches
} else {
print " does not exist ";
## no, it doesn't
}
}




-- 
http://www.e-securenetworks.net
http://www.shopper-holic.com
http://www.planet247.net
http://www.auction-holic.com

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



should be simple perl cgi

2003-03-31 Thread Distribution Lists
Can anyone please tell me what is wrong with this

#!/usr/bin/perl

print "Content-type:text/html\n\n";

$OUTPUT = `rsh testaix "ldapsearch -h  -D "cn=root" -w
 -b "o=,c=us" uid= userpassword | grep
userpassword | cut -f 2 -d ="`;

chomp ($OUTPUT);


print "\n";

basically, $OUTPUT has a password that I get from LDAP, and I want to send
this variable to via a redirect to redirect_pd.php

When I run from command line it looks good

[EMAIL PROTECTED] cgi-bin]# ./test1.pl
Content-type:text/html


>

but through a web browser $OUTPUT is a null value.
What am I missing here ?

thanks





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



module to encrypt TCP stream

2003-02-06 Thread Distribution Lists
Hi,
using IO:SOCKET I have written a server daemon that listens on a
particular port. Is there a module that I can use in my code to encrypt
traffic between the client and server ?

Thanks



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




Timing an execution of an command

2003-02-04 Thread Distribution Lists
I've written some Perl code that will make use of LDAP modules and will do
an LDAPSEARCH to a specific ldap server. However, I would like to know the
time take to complete the LDAPSEARCH so I can graph the response time.
What can I do within Perl to measure the completion time of the search ?

Any ideas

Thanks



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