RE: Perl create tcp connections

2006-12-12 Thread Ron McKeever
Thanks for the updates, I understand. Then perhaps someone can help me get this script to set the tcp to SYN_SENT on 100 ports: #!/usr/bin/perl use Socket; $count=3500; while ($count<3601) { $count++; $addr=sockaddr_in($count,inet_aton('localhost')); socket(S,PF_INET,SOCK_STREAM,getprotobynam

Perl create tcp connections

2006-12-11 Thread Ron McKeever
Hello, Im wondering how I can create on my localhost 100 tcp EST connections? Can I use perl sockets? #!/usr/bin/perl use Socket; $count=3500; while ($count<3601) { $count++; $addr=sockaddr_in($count,inet_aton('localhost')); socket(S,PF_INET,SOCK_STREAM,getprotobyname('tcp')); connect(S,$addr)

Print to new file for each results

2006-08-29 Thread Ron McKeever
I am tring to use part of someones elses code that creates a data file which prints out like this: ip|result|deptA|data ip|result|deptB|data ip|result|deptC|data My goal instead of having all the data in one big file is to loop this and create a file for each result. So I would have a deptA.o

RE: Getting ip address

2006-06-15 Thread Ron McKeever
This works also just incase you don't have perl installed: # for i in $(ifconfig -a); do echo $i | awk -F "addr:" '$2 != "127.0.0.1" && $2 > 0 {print $2}'; done List ips on system, works on bash, sh, ksh Ron -Original Message- From: Danny [mailto:[EMAIL PROTECTED] Sent: Thursday, June

loop Question

2006-01-10 Thread Ron McKeever
I wanted to print if it matches my range of IP's. I thought I could use the (#..#) and it would work, but it didn't: #!/usr/bin/perl -nlw # Print if Ip's are in # 111.9.1-18.### or # 111.9.20-100.### # range # my $a="1-18"; my $b="20-100"; while (<>) { chomp $_; next if ($_ eq "");

Skip then print

2005-12-05 Thread Ron McKeever
Hello, I would like to skip the first ten lines of output from tail, then print any new records matching my array, but I seem to be stuck, below will run but nothing prints: tail /var/log/messages is piped to it... #!/usr/bin/perl my @names = ("nb","tp","ape","berry","jab"); my $log = "/local/

Help -Perl parsing script

2004-04-17 Thread Ron McKeever
Can someone point me in the right direction?? I am trying to figure out my Perl parsing script to dump the interesting part of my log files to another parsed file. Bascially I want to try an remove "Dport" rows that contain 80,53,25, etc... Those are tabs between each field. Log File name "lo

Perl parsing script

2004-04-16 Thread Ron McKeever
I am trying to figure out my Perl parsing script to dump the interesting part of my log files to another parsed file. Bascially I want to try an remove "Dport" rows that contain 80,53,25, etc...Those are tabs between each field. Log File name "log.040411": Start BytesSIp