Re: [PLUG] One-liners to empty all files in a directory?

2011-08-17 Thread Randal L. Schwartz
> "Jameson" == Jameson Williams writes: Jameson> Hm, I'll be damned. Truncate is part of coreutils, but /is/ relatively new Jameson> (2008)! Here's where it got merged: Jameson> http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=75e0047c4b916393b6be3cb985c4c4d4a2d1a836 Wait... *GNU*

Re: [PLUG] One-liners to empty all files in a directory?

2011-08-17 Thread Jameson Williams
On 08/17/2011 08:51 PM, Randal L. Schwartz wrote: > Daniel> truncate -s0 * > > "man truncate" > > Not found. > > You're using some weird OS. Hm, I'll be damned. Truncate is part of coreutils, but /is/ relatively new (2008)! Here's where it got merged: http://git.savannah.gnu.org/cgit/coreutils.g

Re: [PLUG] One-liners to empty all files in a directory?

2011-08-17 Thread Randal L. Schwartz
> "Jameson" == Jameson Williams writes: Jameson> Agreed. /var/log definitely has some nesting, though (below). But that's no Jameson> excuse for me not to learn Perl. :-) Then why did you asy "a directory"? The subject line already says it. Please be more precise. A directory tree is *no

Re: [PLUG] One-liners to empty all files in a directory?

2011-08-17 Thread Randal L. Schwartz
> "Jameson" == Jameson Williams writes: Jameson>find . -type f -exec truncate -s 0 {} \; Jameson> rm * might otherwise work well in most settings, but probably doesn't meet the Jameson> spec of the original one-liner problem statement. :-) Find is overkill if you're not descending dir

Re: [PLUG] One-liners to empty all files in a directory?

2011-08-17 Thread Jameson Williams
On 08/17/2011 06:52 PM, Randal L. Schwartz wrote: > Jameson> I haven't been able to get this one yet. > Jameson> Challenge: A one-line statement (pipes okay, but explicit loops not) > Jameson> that empties all found files (as for debugging with /var/log, > Jameson> perse). > Randal> In a singl

Re: [PLUG] One-liners to empty all files in a directory?

2011-08-17 Thread Jameson Williams
On 08/17/2011 08:10 PM, Randal L. Schwartz wrote: > Find is overkill if you're not descending directories. > >perl -e 'open F, ">$_" for @ARGV' * Agreed. /var/log definitely has some nesting, though (below). But that's no excuse for me not to learn Perl. :-) jameson@orange:/var/log$ sudo

Re: [PLUG] One-liners to empty all files in a directory?

2011-08-17 Thread Michael Rasmussen
On Wed, Aug 17, 2011 at 06:52:20PM -0700, Randal L. Schwartz wrote: > > "Jameson" == Jameson Williams writes: > > Jameson> I haven't been able to get this one yet. > Jameson> Challenge: A one-line statement (pipes okay, but explicit loops not) > Jameson> that empties all found files (as for

Re: [PLUG] Using DNS information to close smtp port...

2011-08-17 Thread Michael C. Robinson
Hmm, people are being kinda quiet... There is code at the beginning of this thread, but trust me when I say there isn't a lot of code. Well, the DNS checking is increasing my rejection rate. Figuring out if I'm blocking at the right times is another issue. Is there ever a situation where a PTR

Re: [PLUG] One-liners to empty all files in a directory?

2011-08-17 Thread Randal L. Schwartz
> "Jameson" == Jameson Williams writes: Jameson> I haven't been able to get this one yet. Jameson> Challenge: A one-line statement (pipes okay, but explicit loops not) Jameson> that empties all found files (as for debugging with /var/log, Jameson> perse). In a single directory? "rm *". Wh

Re: [PLUG] Looking for a Mid-Sr Perl Developer for Ops group

2011-08-17 Thread Randal L. Schwartz
> "Kevin" == Kevin K writes: Kevin> My manager is opening a new req for a mid-sr level perl developer Kevin> for a operations group, supporting RHEL and FreeBSD servers. We Kevin> are still working with HR to get the job listed on the website, Kevin> but here is a job description: Please ple

Re: [PLUG] Why some sites no PTR record???

2011-08-17 Thread Randal L. Schwartz
> "Michael" == Michael C Robinson writes: Michael> Should I go ahead and block if there's no reverse PTR record? Only if you want to lose about 10% of legitmate mail. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehenge.com/merlyn/> Smalltal

[PLUG] Using DNS information to close smtp port...

2011-08-17 Thread Michael C. Robinson
My perl based subroutine that does Net::DNS based checking follows, comments please... sub dns_rev_resolve() { # Check for a PTR record and try to match it up with an A query... ($ipsrc)=@_; my $target_IP = join('.', reverse split(/\./, $ipsrc)).".in-addr.arpa"; my $res = Net::DNS::R

Re: [PLUG] The problem with DNS blacklists...

2011-08-17 Thread Michael C. Robinson
On Wed, 2011-08-17 at 09:34 -0700, Russell Johnson wrote: > On Aug 16, 2011, at 11:20 PM, Michael C. Robinson wrote: > > > Is it > > legitimate for their to be no reverse record when one site is hosted on > > the IP block of another? > > Unfortunately, there are a lot of DNS admins out there that

Re: [PLUG] The problem with DNS blacklists...

2011-08-17 Thread Russell Johnson
On Aug 16, 2011, at 11:20 PM, Michael C. Robinson wrote: > Is it > legitimate for their to be no reverse record when one site is hosted on > the IP block of another? Unfortunately, there are a lot of DNS admins out there that don't reverse list their forward tables. Russell Johnson r...@dimsta

Re: [PLUG] The problem with DNS blacklists...

2011-08-17 Thread Russell Johnson
On Aug 16, 2011, at 10:09 PM, Michael C. Robinson wrote: > A curious question, shouldn't I be able to look up any IP that is > claiming to be a mail server via the DNS system? In theory, yes. In practice, no. The only mail server records that have to be there are MX records, and those only say

Re: [PLUG] Why some sites no PTR record???

2011-08-17 Thread Mike Connors
:~$ dig ebay.com mx ; <<>> DiG 9.7.2-P2 <<>> ebay.com mx ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16443 ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;ebay.com. IN MX ;; ANSWER

[PLUG] Can I modify email headers with Perl script...

2011-08-17 Thread Michael C. Robinson
Apparently I'm not supposed to reject email when there is no reverse PTR record. Can I have my Perl script add a line to the email headers that says essentially, reverse resolution failed? I'm using iptables QUEUE on SMTP connection packets. What I'm asking is, what is the extent of what I have