#perl
24 December 2007
Total 13 pages. You are browsing page 5/13.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
19:52 <****> :|
19:52 <****> yes, perl is multithreaded, and yes you can do that
19:52 * Monie googles
19:52 <****> perl CAN be multithreaded
19:52 <****> But I wouldn't try it.
19:53 <****> IO::Async comes to mind =p
19:53 <****> Whyever..
19:53 <****> Hi simcop2387
19:53 <****> hey rindolf
19:53 <****> simcop2387: what's up?
19:54 <****> not much just getting ready to go over to my cousins for the rest of xmas, we were going to have it else where but her hubby's back went out (degenerative disc condition)
19:55 <****> sounds like a type of DRM
19:56 <****> Haha
19:56 <****> <.< maybe notfunny
19:56 <****> Then how can I make my bot connect to two servers on one proccess?
19:56 <****> Multiplexing?
19:56 <****> IO::Async?
19:56 <****> There's a couple of others in that general vein
19:56 <****> select on socket and switch
19:56 <****> Then of course there is POE.
19:57 <****> Monie: if you write it using POE::Component::IRC that just works
19:57 <****> simcop2387: how old is your cousin?
19:57 <****> Monie: just throw out the IO::Socket version and start again with real tools
19:57 <****> What he said.
19:59 <****> rindolf: older than me, don't know exactly 30?
20:00 <****> rindolf: they've got two kids together now
20:00 <****> How can I download it using cpan in terminal?
20:00 <****> simcop2387: I see.
20:00 <****> rindolf: one of them is almost 2, the other is 6 moths
20:00 <****> well i need breakfast\
20:01 * CPAN upload: Devel-PerlySense-0.0138 (++++ ) by JOHANL
20:01 <****> Monie: The usual way?
20:02 <****> I forgot how to do it.
20:02 <****> cpan Module
20:03 <****> I mean in terminal isn't there something I type like cpan something etc or?
20:03 <****> cpan POE::Component::IRC
20:04 <****> kk thanks
20:04 <****> Ok, can someone help me fix my regex? I'm trying to read httpd-access.log via pipe (tail -f httpd-access.log | script.pl), and parse out the IP addresses that match a known botnet style using this regex:
20:04 <****> $checkip =~ s/^(\d+\.\d+\.\d+\.\d+) - - \[.+\] ".* HTTP\/\d\.\d" \d+ \d+ "-" "-"$/$1/g;
20:05 <****> an example botnet style:
20:05 <****> 222.165.6.36 - - [24/Dec/2007:16:11:58 +0000] "GET / HTTP/1.1" 200 27147 "-" "-"
20:05 <****> Great Youtube Video, this guy should run for president himself!!: http://www.youtube.com/watch?v=UZAqZUafCdM
20:05 <****> Kage`: Regexp::Common already provides a regexp for matching an IP
20:05 <****> mst++
20:06 <****> However, whenever I try and do anything to $checkip, it completely alters the string, either turning it into "1" or a newline
20:06 <****> Alright installing 3 modules.
20:06 <****> there is also a module for parsing logs :)
20:06 <****> mst, it's not the validating an IP I care about, I just want to extract the damn IP as a normal string
20:06 <****> Kage`: so do that then
20:06 <****> Khisanth, I don't want something prebuilt, because I have my own intentions for this
20:06 <****> mst, well, how?
20:06 <****> what am I doing wrong/
20:06 <****> ?^
20:07 <****> Kage`: then you should be using m// not s///
20:07 <****> Kage`: you're doing an s// which is "replace the current string"
20:07 <****> I tried that, too
20:07 <****> Kage`: you want m// which is just a match
20:07 <****> m// with the assignment in list context
20:07 <****> Kage`: well you did it wrong
20:07 <****> simcop2387: will you have Inet there?
20:07 <****> s/assignment/LHS/
20:07 <****> Kage`: because that's the correct approach.
20:07 <****>) { my $checkip = $_ =~ s/^(\d+\.\d+\.\d+\.\d+) - - \[.+\] ".* HTTP\/\d\.\d" \d+ \d+ "-" "-"$/;
20:07 <****> Kage`: go back to thge m// code
20:07 <****> And it did the same shit
20:07 <****> Kage`: fail.
20:07 <****> Kage`: right, you did it wrong :)
20:07 <****> Kage`: we said m//
20:07 <****> mst, ok, well, can you help me fix it?
20:08 <****> Kage`: not s//
20:08 <****> err
20:08 <****> Sorry
20:08 <****>) { my $checkip = $_ =~ m/^(\d+\.\d+\.\d+\.\d+) - - \[.+\] ".* HTTP\/\d\.\d" \d+ \d+ "-" "-"$/;
20:08 <****> That
20:08 <****> Kage`: still wrong
20:08 <****> my ($checkip)
20:08 <****> or my $checkiup = $1 on the next line
20:08 <****> Kage`: $checkip = $_ =~ m/.../ will put the success status of the match in $checkip
20:08 <****> it's all about context
20:08 <****> Gumbybrain: EVAL SIGMEOW
20:08 <****> 'jones' ~~ [ qw(jones page.
20:08 <****> Kage`: ypu want to m/.../ and then $checkip = $1;
20:10 <****> m/^(\d+\.\d+\.\d+\.\d+) - - \[.+\] ".* HTTP\/\d\.\d" \d+ \d+ "-" "-"$/;
20:10 <****> my $checkip = $1;
20:10 <****> print $checkip;
20:10 <****> doesn't print anything now
20:10 <****> actually you want m//, check for success then do the assignment
20:10 <****> erm, then it didn't match anything on that regex
20:10 <****> so rework the regex
20:10 <****> shaldannon, it should, there's a constant botnet going on right now :/
20:10 <****> Kage`: are you sure the regex matched?
20:11 <****> yath, it does match against the example I showed you
20:12 <****> !1 [~] $ echo '222.165.6.36 - - [24/Dec/2007:16:11:58 +0000] "GET / HTTP/1.1" 200 27147 "-" "-"' | perl -nle 'print "foo: $1" if m/^(\d+\.\d+\.\d+\.\d+) - - \[.+\] ".* HTTP\/\d\.\d" \d+ \d+ "-" "-"$/'
20:12 <****> foo: 222.165.6.36
20:12 <****> so, $1 isn't empty.
20:12 <****> Ok, got it working now
20:13 <****> what did it take
20:13 <****> shaldannon, I added a success check
20:13 <****> my $match = m/.../;
20:13 <****> Just m/.../; didn't work
Total 13 pages. You are browsing page 5/13.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
