Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Killing Apache

by Aristotle (Chancellor)
on Dec 30, 2002 at 16:47 UTC ( [id://223074]=note: print w/replies, xml ) Need Help??


in reply to Killing Apache

There probably is some F::F::R extension that looks into files that could eliminate my greps and readfiles completely.
Yep, and it's waiting right there in the File::Find::Rule POD.. :) I know you said it's throwaway, but for the heck of it (untested):
#!/usr/bin/perl -w use strict; use File::Find::Rule; my %uid; my %vm_data; print("Killing $_\n"), kill 15, $_ for map /(\d+)/, File::Find::Rule ->file ->name('status') ->grep(sub { my $fullname = $_[2]; $uid{$fullname}++ if /^Uid:\s*33\b/; $vm_data{$fullname}++ if /^VmData:\s*(\d+)/ and $1 > 16384 +; return $uid{$fullname} and $vm_data{$fullname}; }) ->in('/proc');
What can I say? File::Find::Rule rocks. :)

Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://223074]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found