Re: Handling special characters in peoples names in XML

2013-06-25 Thread Gregory Machin
gt; From: Gregory Machin > > I'm debugging an application written in Perl that converse data exported > > from the Nessus security scanner in xml format. I have narrowed down the > > bug to an issue with special characters in names that are in the file > such > > a

Handling special characters in peoples names in XML

2013-06-19 Thread Gregory Machin
Hi. I'm debugging an application written in Perl that converse data exported from the Nessus security scanner in xml format. I have narrowed down the bug to an issue with special characters in names that are in the file such as Frédéric and Grégoire , thus é are most likely the guilty parties.

DBI driving me nuts ... !

2009-10-06 Thread Gregory Machin
Hi Please can you advise ? #!/usr/bin/perl use Mysql; $dbh = Mysql->connect("localhost","mailscanner","root","c0nc3pt") or die ("Error " . Mysql->errno . " - " . Mysql->errstr); $sql = "SELECT to_address FROM maillog LIMIT 10;"; $sth = $dbh->query($sql) or die ("Error " . Mysql->errno . " - " .

Re: regex question

2009-09-15 Thread Gregory Machin
Thanks for the help .. knowing the anchor thing help me. if you not sure what ur looking for or what it call you end up with the wrong thing. On Tue, Sep 15, 2009 at 10:21 AM, Tim Bowden wrote: > On Tue, 2009-09-15 at 10:10 +0200, Gregory Machin wrote: >> Any numbers, but only 3 digi

Re: regex question

2009-09-15 Thread Gregory Machin
and 3 digits from the phone number eg 011 . So I only want the records that beginning and end in a number and have exactly 3 digits not longer. Thanks for you time. G On Tue, Sep 15, 2009 at 9:52 AM, Tim Bowden wrote: > On Tue, 2009-09-15 at 09:30 +0200, Gregory Machin wrote: >> Hi

regex question

2009-09-15 Thread Gregory Machin
Hi I'm look for code example that will only select a string containing 3 digits .. The string cant be less than 3 digit , can't be more than 3 and can't contain any other characters. I have googled and found code that will find 3 consecutive digits within a string or at the beginning. Any ideas

Re: Trying to remove text in inverted commas.

2009-08-24 Thread Gregory Machin
10 6 0 4 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A On Mon, Aug 24, 2009 at 12:19 PM, Thomas Bätzler wrote: > Hello Gregory, > > Gregory Machin

Trying to remove text in inverted commas.

2009-08-24 Thread Gregory Machin
ot;([^"]+)\"\s)//g but it doesn't seem to work. I got it from a website .. It looked correct .. mmm .. with regard to it's structure i don't quite get ([^"]+) as I have tried replacing it with other combinations and had less luck. I have also tried s/\"([:word:])\"

Re: using ssh to do remote audit of machines

2008-09-09 Thread Gregory Machin
Thanks will look into those . On Tue, Sep 9, 2008 at 10:07 AM, Jeff Pang <[EMAIL PROTECTED]> wrote: > 2008/9/9 Gregory Machin <[EMAIL PROTECTED]>: >> Hi >> I have a database with my servers details in .. I would like to write >> a scripts to get the servers l

using ssh to do remote audit of machines

2008-09-09 Thread Gregory Machin
Hi I have a database with my servers details in .. I would like to write a scripts to get the servers log on info ssh to the box and get basic info using the following hostname cat /etc/issue cat /proc/cpuinfo | grep "model name" cat /proc/meminfo | grep "MemTotal" uname -s -r squid -v /usr/sbin/s

Re: store a complete object?

2008-08-05 Thread Gregory Machin
hi I dont see why you couldnt just INSERT the value into a database .. It's just the column type that may be the issue with mysql i would suggest the blob or one of the text types http://dev.mysql.com/doc/refman/5.0/en/blob.html .. On Tue, Aug 5, 2008 at 1:02 PM, Oliver Block <[EMAIL PROTECTED

system() function not executing scripts

2007-10-12 Thread Gregory Machin
cripts, i have chowned them to the user squid, and even chmod 0777 them, but no joy, yet they work fine if executed buy root what have i missed ? -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

Re: script won't write to file ...

2007-07-20 Thread Gregory Machin
Chas Owens <[EMAIL PROTECTED]> wrote: On 7/20/07, Gregory Machin <[EMAIL PROTECTED]> wrote: > Hi > I have a script that i'm working on, I want it to write info to a log > file, but I can't get it to write to the file.. I run the script as > root, and I also c

testing if hardware is avalible

2007-07-19 Thread Gregory Machin
Hi can you advise on the best way test if a usb modem is plugged in ? I though about checking if the file/node /dev/ttyACM0 is present, as it's created when the device is plugged in using open (TEST, "/dev/tty/ACM0"); but just concecned if i do this while the device is acitive it will cause it to

script won't write to file ...

2007-07-19 Thread Gregory Machin
my $loop = 1; while ($loop >= -1) { print STATUS_LOG localtime() . " sleeping\n"; sleep $mainloopsleep; } print STATUS_LOG localtime() . " ifwatch exiting"; close (STATUS_LOG); } 1 ; -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Dynamically loading perl code

2007-07-12 Thread Gregory Machin
On 7/12/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 7/12/07, Gregory Machin <[EMAIL PROTECTED]> wrote: > Hi > I have a rusty memory of perl have the ability, where by you can load > perl code into an variable / array then execute it on demand, anyone > got an e

Dynamically loading perl code

2007-07-12 Thread Gregory Machin
Hi I have a rusty memory of perl have the ability, where by you can load perl code into an variable / array then execute it on demand, anyone got an example of how to do this .. Many Thanks -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

missing something from regex ...

2007-05-16 Thread Gregory Machin
and not found ./vpninfo.pl: line 2: syntax error near unexpected token `(' ./vpninfo.pl: line 2: `$row = ~/(\w+)\,(\w+)\,(\d+\.\d+\.\d+\.\d+\:\d+)\,(\d+\.\d+\.\d+\.\d+)\,(\d+)\,(\d+)\,\,(\d+)/' [EMAIL PROTECTED] ~]# what have I missed ... Many thanks -- Gregory Machin [EMAIL PR

Re: $ARGV[0] breaks the script

2006-12-15 Thread Gregory Machin
put=$ARGV[0] to give the process name from the command line, it runs as if the process is running if if I have stoped/killed it.. the only reason for this is that there is a hidden character, but where is it comming from ? On 12/14/06, D. Bolliger <[EMAIL PROTECTED]> wrote: Gregory Mach

$ARGV[0] breaks the script

2006-12-14 Thread Gregory Machin
$input=$ARGV[0]; #$input="httpd"; chomp $input; open PROS, "ps -ef|grep $input |"; while ($line = ){ unless ($line =~ m/grep/){ print "$input is running\n"; exit; } } print "$input isn't running\n"; exec "/etc/init.d/$input restart &";

creepy print() that doesnt print.

2006-12-13 Thread Gregory Machin
t does not print the hello. what have I missed .. Many thanks for your time -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: removing single quotation marks from a string ?

2006-11-23 Thread Gregory Machin
if ( $row[ 0 ] =~ /$regex/ ) { print < } else { > print "Malformed Log Entry: $row[0]\n"; > } > } > > undef $search; > undef $dbh; John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts o

Re: removing single quotation marks from a string ?

2006-11-16 Thread Gregory Machin
print("hour is $hour\n"); print("minute is $minute\n"); print("second is $second\n"); print("clientip is $clientip\n"); print("port is $port\n"); print("query is $qu

removing single quotation marks from a string ?

2006-11-16 Thread Gregory Machin
Hi I need to remove all the quotation marks from, a string I tried s/\'// but it did not work. what have i missed ?? Many Thanks -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: please advise help with regex

2006-09-28 Thread Gregory Machin
AIL PROTECTED]> wrote: Gregory Machin wrote: > Hi > I need to parse the logs for my named server. i'm having difficulty getting > my mind around the regex to break the data up .. i want the break it up and > store it in a data base then maniptulate the data from there ... &

please advise help with regex

2006-09-28 Thread Gregory Machin
uot; any ideas ? Many thanks -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za

Re: advise on writing cgi scripts to create + manage certificate authority.

2006-08-03 Thread Gregory Machin
Thanks for the lead ... But my question was focused on the creation of a certifictate authority mangment interface "using" cgi as aposed to comandline ... which is the norm ... I have a basic knowlage of perl cgi.. On 8/3/06, Gregory Machin <[EMAIL PROTECTED]> wrote: Hi I hav

advise on writing cgi scripts to create + manage certificate authority.

2006-08-03 Thread Gregory Machin
Hi I have to write a cgi appliction to manage a certificate authority for AES 256 CBC and 128 CBC ... How would I go about this the only application I have used for this was comand lline interactive... Any suggestions .. -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za

Re: need to return exit code

2006-07-31 Thread Gregory Machin
thanks for the support guys .. have a grate day .. On 7/31/06, Prabu <[EMAIL PROTECTED]> wrote: Gregory Machin wrote: > Hi > My perl script is called by a bash script, used in a compile / build env. > But the bash script is not seeing my script's exit and is timming

need to return exit code

2006-07-31 Thread Gregory Machin
Hi My perl script is called by a bash script, used in a compile / build env. But the bash script is not seeing my script's exit and is timming out and continuing ... How can I pass a standard exit code 0 = success 1 = fail to the operating system / calling script. Many Thanks -- Gregory M

Re: regex and parsing config file directives..

2006-07-14 Thread Gregory Machin
rated by a space into an array my $key = shift @array; gets the first value, of the array and sets key to this value $hash{$key} = [EMAIL PROTECTED] || 'nodefined'; ... sets the value of the hash to the array ?? } >From: "Gregory Machin" <[EMAIL PROTE

Re: regex and parsing config file directives..

2006-07-14 Thread Gregory Machin
alue) = split/\ /; to split the kay and the value ? -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za

Re: regex and parsing config file directives..

2006-07-14 Thread Gregory Machin
__END__ Run it and get the result output: $ perl test.pl $VAR1 = { 'PREFORK_CHILDS' => '5', 'IP' => '1.2.3.4', 'MIN_SPARE_CHILDS' => 'nodefined', 'PORT' => '80'

regex and parsing config file directives..

2006-07-14 Thread Gregory Machin
.pl opening config file for processing => dev => tun0 proto => tcp remote => 192.168.1.1 1194 resolv-retry => infinite => => => ca => ca.crt cert => greg.crt key => greg.key cipher => AES-128-CBC => verb => 3 => proto => tcp cert => greg.crt dev => tun0 ca => ca.crt key => greg.key remote => 192.168.1.1 1194 verb => 3 cipher => AES-128-CBC resolv-retry => infinite Many Thanks Greg -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za

regex and parsing config file directives..

2006-07-10 Thread Gregory Machin
persist_key} = $_; } but I still end up with an empty field ... Any ideas.. -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za

Re: perl + ncurses turtorial ?

2006-07-06 Thread Gregory Machin
source code.. with menus and windows and popups etc ... Thanks On 7/7/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: Gregory Machin wrote: > Hi Hello, > I'm looking for an perl ncuses tutorial so I can write a remote admin > app to > work via ssh .. Not really a tutoria

perl + ncurses turtorial ?

2006-07-06 Thread Gregory Machin
Hi I'm looking for an perl ncuses tutorial so I can write a remote admin app to work via ssh .. Many Thanks -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za

Active Perl and cgi-bin problem

2003-08-14 Thread Gregory Lewis
Hi, I'm brand new with this, I downloaded and installed Apache2, works fine. I downloaded and installed ActivePerl 5.8. I ran this install line from the command prompt (Windows 2000): C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/mod_perl.ppd Everything seemed to load fine, until the end,

Mysql script not working ...

2002-10-08 Thread Gregory Bernard
Here is a little script I am working on, first part executes without any problem... The database is deleted from MySQL but the second part of the script which is supposed to take a file on my disk and insert it into my db does not work... Second part (after for (split(// #!/usr/bin/perl $in =

Anyone want to help modify a script?

2002-09-30 Thread eric gregory
Ok, I've got this script which I pulled off of a website for rotating apache logfiles. But since I'm runnig numberous sites on my server it doesn't quite do what I need. It works just fine for a single set of logfiles for instance if the files are in /logs/test in the example below. but what

File Search - String Match - String Count

2002-05-10 Thread Gregory Matthews
emails found in text file. 7. I then want to be able to process the good emails as needed. Any help would be greatly appreciated! Thanks in advance. Gregory -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: scp inside perl

2002-04-01 Thread Lirot, Gregory
some host trust your login / host combination. Best Regards, Greg -Original Message- From: Jeff Liu [mailto:[EMAIL PROTECTED]] Sent: Monday, April 01, 2002 12:06 PM To: Lirot, Gregory; Beginners Subject: RE: scp inside perl Hi Greg, Thanks for your help. But I have difficulty to f

RE: scp inside perl

2002-04-01 Thread Lirot, Gregory
Jeff: Yes. Merely use something like: system("scp Source Destination"); This would be the easiest way, or, also: `scp Source Dest`; More elaborate stuff can be done, but this is good for starters. Best Regards, Greg -Original Message- From: Jeff Liu [mailto:[EMAIL PROTECTED]] Sent:

Creating a Unique Key

2002-03-28 Thread Gregory Matthews
What is the best way to create a unique, almost impossible to guess, KEY, i.e., ftu880oli88UI8flpq, which can in turn be used as part of a security string, i.e., username: ftu880oli88UI8flpq ? Thanks in advance. Gregory

Fwd: ENC: É O BRASIL....

2002-01-31 Thread Gregory
>"COM LOUVOR" (este foi o título da reportagem do Correio Braziliense do >dia 22/12/01 a respeito da seguinte situação): "... Bruno, (o filho do >presidente do TJDF) fez concurso público para o cargo de segurança. Eram >12 vagas disponíveis, com um salário de R$1300,00, e nível exigido de 2º

Re: Compress::Zlib and .Z files dont work !!

2001-12-26 Thread Gregory
Sorry my bad english Yes , and the error is the same -3 (Z_DATA_ERROR) ... If you have any sample .. send me please At 21/12/2001 10:30 AM, Michael Fowler wrote: >On Fri, Dec 21, 2001 at 10:17:58AM -0200, Gregory wrote: > > I try the inflate example . and dont w

Re: Compress::Zlib and .Z files dont work !!

2001-12-21 Thread Gregory
Hi , I try the inflate example . and dont work again The error is -3 (Z_DATA_ERROR) , but i can uncompress or zcat in the file at the line command of unix. WHAT IS WRONG or the module dont work ??? the sample is : use strict ; use warnings ; use Compress::Zlib ;

Compress::Zlib and .Z files dont work !!

2001-12-20 Thread Gregory
Hi i have a .Z file generated by compress and i need read this file in a Perl script. I install the Compress::Zlib to do this, but the samples of Compress::Zlib dont work !! The example work like a 'cat file.Z' not a zcat. What is wrong ?? Any body have a sample ??? Sorry the bad English

RE: change uid in perl ??

2001-10-31 Thread Lirot, Gregory
If running on Unix, one can use the "su" command to change to a different user. Then the perl script would have to be run as root on the host. To change user, the shell syntax is : su - fred So one could set up something like: system("su - fred -c \"shell commands, mv a f, etc...\"); Inside t

output from system call

2001-10-18 Thread Gregory Nicholls
aviour. I know I can get the msgs in a result variable but I'd like them to appear at the time they're issued. Thanks for any help you can give me on this. Gregory Nicholls, -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: New Project, Design Thoughts appreciated

2001-09-26 Thread Lirot, Gregory
If one is in a Unix shop, this is very straightforward. Telnet would not be practical, that is for interactive connections. Something like the following could be called from the crawler. There are some security issues for you to think through here. !#/bin/perl $SCRIPT = "/home/joesmoe/somes

RE: input output append

2001-08-02 Thread Shepard, Gregory R
Try $Directory= $file="$directory.$file.txt"; # don't forget to add "\" between dir and file open FH, ">$file" or die "Cannot open $file:$!"; print FH "blah \n"; print FH ""blah \n"; print FH ""blah \n"; close FH; -Original

Certification

2001-08-02 Thread Shepard, Gregory R
I was looking online for information on Perl Certification but only found people discussing it, and not where to get it. Is certification available? And who provides the most valid certification? Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

RE: Read text files only into a hash

2001-07-27 Thread Shepard, Gregory R
$dir_file ); # if directory then next next unless -T "$dir_file"; # if not a text or what exhibits text file next Ran it it got only text files and no directories. Wags ;) -Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Friday, Ju

RE: Read text files only into a hash

2001-07-27 Thread Shepard, Gregory R
"$dir/$file" || /^\./; -Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 3:47 PM To: [EMAIL PROTECTED] Subject: Read text files only into a hash All, I am trying to read only text files (using the -T test) from a directory into

Read text files only into a hash

2001-07-27 Thread Shepard, Gregory R
All, I am trying to read only text files (using the -T test) from a directory into a hash, and not directories themselves. How do I prevent it from it reading in directories? This sounds like a basic question and know there is probably an easy answer... but I can't think of it. Thanks. @ARG

RE: Recursive find for a file within a directory

2001-07-27 Thread Shepard, Gregory R
All, I am trying to read only text files (using the -T test) from a directory into a hash, and not directories themselves. How do I prevent it from it reading in directories? This sounds like a basic question and know there is probably an easy answer... but I can't think of it. Thanks. @ARGV=$d

stat() keeps returningthe incorrect date

2001-07-25 Thread Shepard, Gregory R
I am trying to create a script which gathers the stat info of every file in a given directory. Then return the date it was last modified for the purpose of picking the file that was created/modiefied last. The script is reading the files ok, however, when placing them in the stat() to exctact the

RE: make problems

2001-05-25 Thread Gregory L. Hering
Hm... from your output: `sh cflags hash.o` -DPERL_FOR_X2P hash.c CCCMD = -c /config.sh: File or directory doesn't exist 1) This first line looks messed up; unless 'cflags' is a shell script which returns something like 'gcc -o hash.o' I don't think you will be compilin'. 2) If

RE: reg ftp

2001-05-25 Thread Gregory L. Hering
The 'man page' is a bit vague: ascii Set the file transfer type to network ASCII. This is the default type. binary Set the file transfer type to support binary image transfer. however, we know that if you were to translate characters in executable files that could be interprete

RE: reg ftp

2001-05-25 Thread Gregory L. Hering
Oops. 'bin' means BINARY mode and the intent is that NO translation takes place. BINARY mode should be used for files that would be messed up by EOL translation. Like executables, tar or ZIP files, jpep, etc. ASCII means "please move my file, but translate the EOL appropriate to the system receiv

RE: reg ftp

2001-05-25 Thread Gregory L. Hering
How 'bout ftp in ASCII mode. I recon' that's what it's for. Greg -Original Message- From: baby lakshmi [mailto:[EMAIL PROTECTED]] Sent: Friday, May 25, 2001 1:50 AM To: [EMAIL PROTECTED] Subject: reg ftp hi while doing ftp from windows to unix, the file contains ctl M at the end of eac