IPTables-IPv4-0.98 on Centos 5 v5.8.8 built for x86_64-linux-thread-multi

2007-08-10 Thread Michael Gale
when making a shared object; recompile with -fPIC libiptc/libiptc.a: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [blib/arch/auto/IPTables/IPv4/IPv4.so] Error 1 --snip-- -- Michael Gale Red Hat Certified Engineer Network Administrator Pason Systems Corp. "Wha

LWP::Authen::Ntlm::authenticate

2007-08-21 Thread Michael Gale
0', '',"domain\\mgale",'password'); my $request = GET $url; --snip-- -- Michael Gale Red Hat Certified Engineer Network Administrator Pason Systems Corp. "What we need are more people who specialize in the impossible." - Theodore Roethke -- To unsu

IPTables::IPv4 issue / relocation R_X86_64_32S against ... can not be used when making a shared object

2007-10-01 Thread Michael Gale
r there are two other Makefile's: modules/Makefile libiptc/Makefile You need to add the -fPIC flag in both of those also: modules/Makefile: CFLAGS := ... -fPIC libiptc/Makefile: CFLAGS := ... -fPIC You will have to run a make clean && perk MakeFile.PL before you can run a make again

Re: Comparing Regular Expression in Perl vs Python

2007-11-28 Thread Michael Gale
hanks, JBB -- Michael Gale Red Hat Certified Engineer Network Administrator Pason Systems Corp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

store Array in hash ?

2006-03-29 Thread Michael Gale
Hello, I have setup a hash like the following: my $test; $test->{$setup}->{'opt'} = "OK"; It works fine, now I want to save an array to the hash: my @data; push(@data,"test"); $test->{$setup}->{'data'} = @data; Now how do I use it in a for loop later in the script, I tried: for(my

Re: store Array in hash ?

2006-03-29 Thread Michael Gale
Hey, I think I am supposed to use a reference here ? If so I can't because the data array keeps over written and reused again and again. I guess I will come up with a different solution. Michael Michael Gale wrote: Hello, I have setup a hash like the following: my $test;

Term:ReadKey

2006-07-23 Thread Michael Gale
Hello, I am using Term::ReadKey with the ReadLine function, is there a way to pass my input to the shell ? So if I type in ls and hit enter, it will pass my commands to the shell to be executed ? Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Term:ReadKey

2006-07-24 Thread Michael Gale
Hello, This will not work as my system will block on the command until it is done. I want / need the script to continue catching the input. Michael Thomas Bätzler wrote: Michael Gale <[EMAIL PROTECTED]> asked: I am using Term::ReadKey with the ReadLine function, is there a way t

perl gnome like terminal ?

2006-07-24 Thread Michael Gale
Hello, I am interested in creating a perl gnome like terminal, would IPC::Open3 be the best thing to use to pass the input and output from my text window to the underlining shell ? Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: command execution

2006-07-24 Thread Michael Gale
What about: my $cmd = "ls -l"; system($cmd) == 0 or &error_msg("Could not run command"); Where error_msg is a function that takes a argument. Michael Sayed, Irfan (Irfan) wrote: Hi All, I am executing following command ` $MT chreplica`; I need to find out wheather this command is exe

Re: queuing up user input via writes to STDIN

2006-07-28 Thread Michael Gale
Of course, there are lots of other ways to do this, like saving the commands in an array and executing the array elements as if they were keyboard commands, or opening a pipe to another program that fed commands in. Is there a way to do this with manipulation of STDIN? thanks, Gavin Bowlby

Re: how to write content of file to an array / variable ?

2006-07-28 Thread Michael Gale
aking temp1 as input `/usr/bin/xxx temp1`; #temp.xxx is output of usr/bin/xxx @psa = `cat temp1.xxx`; foreach $i(@psa) { print "$i"; print ""; } -- Michael Gale Red Hat Certified Engineer Network Administrator Pason Systems Corp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Dynamically updating perl variables

2006-07-29 Thread Michael Gale
Hey, Why not use signals to do this, for example: use sigtrap qw(handler shutdown USR2); sub shutdown { &logging("Shutdown requested by signal"); $stop=1; } Michael siegfried wrote: I have some cron jobs running perl for many hours. Sometimes I would like to

store and search mail dir format ?

2006-08-27 Thread Michael Gale
Hello, I have an app that sync's an IMAP account including all folders and messages. I would like to add a search feature to this app, kind of like the Google desktop. Is there a module that can create an index file or provide a module to search through the data ? I do not want to run thr

SOAP::WSDL errors ?

2006-09-25 Thread Michael Gale
hod "endpoint" on an undefined value at /usr/lib/perl5/site_perl/5.8.5/SOAP/WSDL.pm line 30. at /usr/lib/perl5/site_perl/5.8.5/SOAP/WSDL.pm line 30 SOAP::WSDL::wsdlinit('SOAP::WSDL=HASH(0x88fc128)') called at ./soap_perl_example.pl line 46 --snip-- -- Michael Gale

WSDL issues

2006-09-26 Thread Michael Gale
edentialsType"> transport="http://schemas.xmlsoap.org/soap/http"/> soapAction="https://mydomain.com/testservice/getIdForUser"/>use="literal"/>use="literal"/> https://mydomain.com/testservice"/> --snip-- --

perl script load module as root ?

2006-10-23 Thread Michael Gale
believe you need to be root ? Is there a way that perl can load a module as root ? or somehow sudo with in it self to use the module ? Thanks -- Michael Gale Red Hat Certified Engineer Network Administrator Pason Systems Corp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Can't use string as a subroutine ref while "strict refs"

2007-02-28 Thread Michael Gale
sh_logout", "cmds" ); foreach my $a (@actions) { &show_log("Calling $a"); my $check= &{$a}; return(1) unless $check==0; } } --snip-- -- Michael Gale Red Hat Certified Engineer Network Administrator Pason Systems Corp. -- To un

regular expressions with "and do {" ?

2005-04-04 Thread Michael Gale
Hello, I am using nagios graph to plot performance data returned from nagios plugins. The file uses regular expressions to parse the data and provide it to rrd tool. The following is from Chris Wilson's post on the nagios mailing list, I was wondering if some one could explain this bit a code: -

multiple statments with ||

2005-04-04 Thread Michael Gale
Hello, I have the following piece of code: --snip-- if ($_ eq "read") { open(fileid, "/tmp/mysql_lastid") || $lastid=0; $lastid = ; close(fileid); } --snip-- With the fail of opening the file, I want the variable to be set to zero and print a message to standard out

Regular expression $1,$2,$3 ... in array ?

2005-04-05 Thread Michael Gale
Hello, I have the following input as an example: $_ =

Re: Net::SSH::Perl bind socket problem

2005-04-06 Thread Michael Gale
Hello, I am not a experienced perl programmer but from the look at your first post with the perl code. Do you not have to run a close sessions ? So after your commands: $ssh = Net::SSH::Perl->new($_, %params); $ssh->login("root"); ($stout,$sterr,$exit) = $ssh->cmd("wge

Creating reports ??

2005-04-14 Thread Michael Gale
Hello, I am currently googling for this but ... I want to know what people think or have used to create reports in perl. Maybe creating some kind of graph or an excell report ? Thanks. Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Formatted output - like a html table ?

2005-04-14 Thread Michael Gale
Hello, In perl, is there a way to produce a formatted output much like in html you can create a table to produce the output ? I have tried using tabs, but it gets messy :( Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Formatted output - like a html table ?

2005-04-14 Thread Michael Gale
Well it should be OS independent and ideally in plain ASCII. Currently I am reading up on the Template Toolkit. Michael Chris Devers wrote: On Thu, 14 Apr 2005, Michael Gale wrote: In perl, is there a way to produce a formatted output much like in html you can create a table to produce the

Passing array as refer ?

2005-04-16 Thread Michael Gale
Hello, I am trying to pass an array by reference since it could become very large. The function should take the array and print it out but only 10 elements per line. #!/usr/bin/perl -w use strict; use warnings; use DBI; .. sub printlist { my $arrayref = @_; my $max = $arrayr

Re: Passing array as refer ?

2005-04-17 Thread Michael Gale
; $n <= $max; $n++) { print "$arrayref->[$i]\t"; $n++; $i++; } print "\n"; } } &printlist(@servers); --snip-- Michael Michael Gale wrote: Hello,

Uniq from array ?

2005-03-30 Thread Michael Gale
Hello, I have using the following lines to run through an array (@servers) and run a function on each one. But I want to avoid running the function twice if an entry exist twice. I got the following from http://www.unix.org.ua/orelly/perl/cookbook/ch04_07.htm But it is not working as exp

Re: Uniq from array ?

2005-03-30 Thread Michael Gale
"; print "\n"; --snip-- On Wed, 2005-03-30 at 18:12 -0500, Offer Kaye wrote: > On Wed, 30 Mar 2005 15:53:25 -0700, Michael Gale wrote: > > > > But it is not working as expected, even if the array has the fir

Re: Uniq from array ?

2005-03-30 Thread Michael Gale
Hello, I fixed it, the string would initially contain special characters such as % signs. I strip out all the characters before the check, instead of after. Michael. On Wed, 2005-03-30 at 16:19 -0700, Michael Gale wrote: > Hello, > > I tried your example, it worked as

Re: Uniq from array ?

2005-03-30 Thread Michael Gale
: > Michael, > I noted from your original posting that you quoted from a URL which is > controversial > in that the Perl-related books from O'Reilly are actually pirated > copies. This was pointed out by one of the > subscribers to this list in a recent thread. > > Alfre

Sort array by value length ?

2005-04-22 Thread Michael Gale
Hello, I have an array of names and would like to sort the array by the length of the name but am having difficulty. Any suggestions ? I tried creating two arrays, one with the names and another with the length values, then sorting the length values but found it difficult to print them out. M

References and subroutine ?

2005-04-22 Thread Michael Gale
Hello, I have an array and I would like to pass it to a subroutine: &printlist([EMAIL PROTECTED]); sub printlist { my $array_ref = (shift); my $max; my $maxnew = @{$array_ref}; for(my $i=0;$i < $maxnew; $i++){ print "\t\t\t\t\t";

Sort multi referenced array/hash

2005-04-24 Thread Michael Gale
Hello, I have created a multi-referenced hash /array doing the following: my $total; my $machine; my $serverdata; start of loop $serverdata->{$machine}->{day} = $total; $serverdata->{$machine}->{hour} = $total / 24; ...end of loop I have a loop that gets the data for each machine and s

Re: Sort multi referenced array/hash

2005-04-24 Thread Michael Gale
Hello, I did create a new hash containing the machines and the day value, sorted it and used that sorted hash in my loop to print everything out. Please let me know if there is a better way. Michael Michael Gale wrote: Hello, I have created a multi-referenced hash /array doing the

Re: Writing my first perl script

2005-05-06 Thread Michael Gale
Hello, A bash script would be a better choice for this particular request. #!/bin/bash find . -type f -name "*.txt" -print | xargs grep -l 123 >> externalfile The above command would search the current directory plus all sub- directories for all files the end in a ".txt" and search each

Redirecting STDERR and STDOUT ?

2005-05-13 Thread Michael Gale
Hello, I am using the following to redirect STDERR and STDOUT: open(STDOUT, "> $logfile") || die "Can't redirect stdout"; open(STDERR, ">&STDOUT") || die "Can't dup stdout"; select(STDERR); $| = 1; # make unbuffered select(STDOUT); $| = 1; # make unbuffered .. close(STDOUT

slackware package from CPAN module ?

2005-06-03 Thread Michael Gale
Hello, I need to install perl and some perl modules on a ram disk. Which is fine, currently I am installing the slackware perl package. How ever there are some modules I would like to install from CPAN. Is there away to create packages for them ? or could I some how mirror the CPAN modules I

perl GUI with out X ?

2005-06-05 Thread Michael Gale
Hello, Is there a way to write a perl GUI app with out having to run X ? Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Don't understand peice of code ?

2005-08-13 Thread Michael Gale
Hello, I am going a perl file called snacktime.pl I got from: http://www.planb-security.net/wp/snacktime.html I do not understand how the "shift and die" line works in the following code section: --snip-- # Filling in all the options. my %options; getopts('hvVmt:p:f:w:D:s:P:I:',\%options) |

better option then getops ??

2005-08-14 Thread Michael Gale
Hello, I was reading online about getops and it seems that with getops the command line arguments have to be in the form: -character option What happens if you want your switchs to be characters like: --src_ip X.X.X.X Currently I have been using a for loop and going through ARGV with a re

perl net::rawip help

2005-08-14 Thread Michael Gale
Hello, I have been trying to get a UDP packet sent out using Net::RawIP but am having issues. Here is a peice I code I have tried for testing: my $a; my $p; my $f; my $ipid = int rand 5000 + 100; $a = new Net::RawIP; $a->set({ ip => {saddr => '192.168.0.15',

Re: perl net::rawip help

2005-08-14 Thread Michael Gale
Hey, I figured it out, the documentation for Net::RawIP sucks by the way. I needed to change the line: $a = new Net::RawIP; to the following: $a = new Net::RawIP({udp=>{}}); Michael Michael Gale wrote: Hello, I have been trying to get a UDP packet sent out using Net::Ra

Perl Net::RawIP not allowing broadcast ?

2005-08-14 Thread Michael Gale
Hello, I have created the following piece of code: my $packet = new Net::RawIP({udp=>{}}); $packet-> set({ ip => { saddr => '192.168.0.15', daddr => '255.255.255.255', id => $ipid,

Re: Perl Net::RawIP not allowing broadcast ?

2005-08-15 Thread Michael Gale
Hello, I have also tried sending out a packet addressed to 192.168.0.255 but I receive the same error: sendto() at /usr/lib/perl5/site_perl/5.8.6/i486-linux/Net/RawIP.pm line 550 Any help would be appreciated. Michael Michael Gale wrote: Hello, I have created the following piece of

Perl Net::Pcap loop hang ??

2005-08-16 Thread Michael Gale
Hello, I have tracked down a problem in my perl script to the module Net::Pcap I believe and the loop mod. So using perl -MPCAN -e shell I tried to install Net:Pcap to see what happens. After the make, it runs a check and produces the following out put: t/01-modules OK t/02-lookup OK t/0

Re: Perl Net::Pcap loop hang ??

2005-08-17 Thread Michael Gale
open to suggestions. Michael John W. Krahn wrote: Michael Gale wrote: Hello, Hello, I have tracked down a problem in my perl script to the module Net::Pcap I believe and the loop mod. So using perl -MPCAN -e shell I tried to install Net:Pcap to see what happens. After the make, it

perl app as a service ?

2005-08-17 Thread Michael Gale
Hello, In the past I have usually written apps that run from start to finish and then exit. I now need to write a small app that idealy will continue to run as long as the machine is :) It needs to make a db, pull some data and do X with the data. Then sleep for 90 seconds and repeat the pro

Use of uninitialized value in string at ... ??

2005-08-18 Thread Michael Gale
Hello, I got the following function online but and receiving the error and do not know why ? Use of uninitialized value in string at ./sat-main.pl line 211, line 1 Here is the code: my $input; $input = &user_func("Enter command "); sub user_func { my $user_input; my ($promptStrin

regex stored in variables ?

2005-08-23 Thread Michael Gale
Hello, I have a script the loads regex into variables from a user config file, how ever I am unable to get perl to run the regex against the string. As I test have tried: my $exp_test="m/^\d+$/"; if ( (defined $string) && ($string =~ $exp_test ) ) { print $string, "\n"; } I have tried man

Re: regex stored in variables ?

2005-08-23 Thread Michael Gale
et to work) my $exp_test=qr/$Config->get('section.name')/; if ($string =~ $exp_test) { I do not understand what I am missing / doing wrong ? Thanks Michael Jeff 'japhy' Pinyan wrote: On Aug 23, Michael Gale said: I have a script the loads regex into variables

[Fwd: Re: regex stored in variables ?]

2005-08-23 Thread Michael Gale
Hello, I resolved my issue, I forgot that in the file it may contain a CR, I used chomp to remove it. Michael Original Message Subject:Re: regex stored in variables ? Date: Tue, 23 Aug 2005 14:16:22 -0600 From: Michael Gale <[EMAIL PROTECTED]&

alarm and pcap::loop

2005-08-28 Thread Michael Gale
Hello, I am having a problem with the following piece of code: Current Net::Pcap is setup to have a capture limit of 1. So if 1 packet is received my script exits and prints the message "time out did not occure. But if a packet arrives after the timeout it prints "time out occured".

Re: alarm and pcap::loop

2005-08-28 Thread Michael Gale
Hello, This is odd ... if I use Proc::Simple to run the sub routine in the background the alarm works fine. I then simple shutdown the second process using Proc::Simple's kill function. Michael Michael Gale wrote: Hello, I am having a problem with the following piece of

toString function ??

2005-09-05 Thread Michael Gale
Hello, I can not seem to find any documentation on "toString" ? I have found am example online using it: sub packet_cap_process { my ($user, $hrd_ck, $pkt) = @_; ## Get IP header info my $header = NetPacket::Ethernet->decode($pkt); my $ether_data = NetP

Regular expression in varaible

2005-09-22 Thread Michael Gale
Hello, I have the following line of code and I believe it is correct, but it is not doing what I am expecting it to do: Config file [test] value=^OK$i $regex=$Config->get('test.value'); chomp ($regex); $regex=qr/$regex/;

Re: Regular expression in varaible

2005-09-22 Thread Michael Gale
I was hoping that $ would mean the end of the string and "i" would mean case insensitive :( Michael Jeff 'japhy' Pinyan wrote: On Sep 22, Michael Gale said: I have the following line of code and I believe it is correct, but it is not doing what I am expecting it

Perl IDE with web ?

2005-12-09 Thread Michael Gale
Hello, I am looking for a Perl IDE with possible html component, currently I have been using either vi or Scite. Both work well except I need to increase my productivity a little, so hopefully a decent IDE will help. Thanks Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Named pipe performance ??

2005-12-13 Thread Michael Gale
Hello, I am testing out named pipes and am seeing a performance problem, below is my writer and read scripts. The read never receives the same amount of messages. In the writer I moved the file open and close to inside the loop, which slowed down the overall process that 80%-90% of the message