Article View: news.software.nntp
Article #86942Re: unwanted.log
From: D. Stussy
Date: Thu, 03 Sep 2015 00:24
Date: Thu, 03 Sep 2015 00:24
130 lines
6929 bytes
6929 bytes
"Avon Kerr" wrote in message news:ms6d5k$n73$1@news.bbs.geek.nz...
Hi there :)
On Tue, 01 Sep 2015 22:14:28 -0700, D. Stussy wrote:
> Yes. I have a script on my system that does just that, and it runs
> every 3 days. Note that it first filters the newsgroups to exclude
> certain hierarchies (which are checkgrouped), certain types (binaries),
> and will set the "m" flag for groups ending ".moderated" and the "n"
> flag for certain hierarchies and test groups. The script does some
> other things too, such as remove "bork"{3} groups, long names, etc., and
> places all the aliases for groups at the end of my active file.
>
> Of course, one will have missed the posts that came through that caused
> the group to be recorded in the "unwanted.log" file in the first place,
> but it will generally pick up subsequent posts. As the "newsgroups"
> file remains unchanged, there will be no matching description for these
> added groups - until a checkgroups or newgroup message subsequently
> comes along.
Thanks for the reply and the information about your script. I guess in
the end so long as it does what you want it to then it's all good. I'm
not (as I was mentioning to Julien) much of a coder (but I think I should
start to learn!) so at this stage such a thing is beyond me.
I imagine you would have spent some time on this to tweak things etc.
For now I have manually added 2-3 groups (mozilla.*) that seem like they
are of interest and contain on-topic / valid content.
Best, Paul.
===================
Here is my script - it is initiated by CRON once every 3 days. Feel free to
modify it as you see fit (and to adjust for your directory paths).
By default, all groups are set to "j" (the "sed" lines)
- ".test" groups and certain public hierarchies set to "n" (read-only)
- Groups ending ".moderated" set to "m"
- Groups ending ".unmoderated" set to "y"
Therefore, most groups still go to the "junk" group unless specifically
overridden.
/usr/local/bin/add-unwanted-newsgroups:
#!/bin/sh
if [ ! -r /news/log/unwanted.log ]; then exit 1; fi
grep = /news/index/active|cut -d = -f 2|sed "s/^/0 /"
>>/news/log/unwanted.log
egrep " [a-z][-a-z0-9_+]+(\.[a-z0-9][-a-z0-9_+]*)+$" /news/log/unwanted.log
|\
egrep -v " (all|control|ctl|example|fa|general|lo[ck]al|private)\."
|\
egrep -v " (ba|belwue|ch|cl|comp|de|eternal-september|ffm|fido7)\."
|\
egrep -v " (fr|grisbi|hacktic|hr|humanities|hun|it|ka|kgk|linux)\."
|\
egrep -v " (luebeck|misc|news|nippon|nl|nntpworld|no|openwatcom)\."
|\
egrep -v " (opennews|pnx|rec|sci|scout|soc|sub|szaf|talk|z-netz)\."
|\
egrep -v " (sdnet|to|uk|us|www|x-privat|.*(google|yahoo)groups?)\."
|\
egrep -v " (alive|bofh|hiv|islam|mod|snarked|(alt\.)?test(ing)?)\."
|\
egrep -v " (air|courts|god|ieee|info|pubnet|t-netz|tnn|uiuc|zer)\."
|\
egrep -v " ((alt|free)\.[a-z]|aalt|allt|earth|foad|gay-net|meow)\."
|\
egrep -v "
(alt\.anonymous|alt\..+\.test(ing)?|binar(ie|y)s?)(\.|$)"|\
egrep -v " (http|poster$|(alot|america|deja|dejanews|ifdef|um)\.)"
|\
egrep -v "( |\.)(alt|bin|free|jobs|sex|sesso)\.(.+\.)*\\2(\.|$)"
|\
egrep -v "\.(h[0-9a-z]pc[1lr][0-9a-z][mn]e|cr[0-9a-z]meh[0-9a-z]p)"
|\
egrep -v "\.(beastial|cock.*suck|fetich|masterbat|moron|testeless)"
|\
egrep -v "\.(bin[eir]|bain|bian|binair|binary|pa?edo|pictue|warez)"
|\
egrep -v "\.([0-9]*|all|ctl|dowap|emircpih|flonk|froup|snuh)(\.|$)"
|\
egrep -v "\.(bin|binaries|dateien|meow|netflow|gay|bi|motss)(\.|$)"
|\
egrep -v "(mail|yahoo)\.(com|net|org|info|biz|(com?\.)?[a-z]{2})$"
|\
egrep -v "(fuck|eijk|fred.hall|montgomery.wood|phuck|bailie)" |\
sed "s/^[0-9]* /ctlinnd newgroup /" | sed "s/$/ j unwanted-groups/"
|\
sed -r "s/ ((clari|gmane|google|[^.]*\.public)\..+) . / \\1 n /"
|\
sed "s/\.test . /.test n /" | sed "s/\.moderated . /.moderated m /"
|\
sed "s/\.unmoderated . /.unmoderated y /" | ~news/bin/mod-active
grep = /news/index/active | cut -d " " -f 1 | sed "s/^/ctlinnd rmgroup /" \
>/var/tmp/changes-$$
grep = /news/index/active | cut -d " " -f 1,4 | sed "s/^/ctlinnd newgroup /"
|\
sed "s/\$/ alias-groups/" >>/var/tmp/changes-$$
~news/bin/actsync -p0 -m /news/index/active /news/index/active.master |\
grep " changegroup " >>/var/tmp/changes-$$
~news/bin/actsync -p0 -b2 -d2 -t2 -g9 -q12 -s80 /news/index/active \
/news/index/active | cat - /var/tmp/changes-$$ |
~news/bin/mod-active
exec rm /news/log/unwanted.log /var/tmp/changes-$$
Explanation:
Line 1) It's a shell script. I use BASH.
Line 2) Aborts if there's no "unwanted.log" file to process.
Line 3) Auto-adds any aliased group destination.
Lines 4-24) Filters and adds acceptable groups. Discards the rest.
Lines 25-28) Identifies group aliases and commands them to be placed at the
end.
Lines 29-30) Compares groups against a master override list and applies
changes.
Lines 31-32) Posts changes. Removes "bork"{3} groups and overly-long
groups.
Line 33) Clean-up.
The group filter goes after reserved words, groups, and hierarchies,
actively-checkgrouped hierarches, bogus and defunct hierarchies, certain
misspellings, the "hipcrime" hack, abbreviated newsgroup names (namely
"alt.?.*"), and some revenge groups. Also goes after misplaced Yahoo/Google
group names, which aren't really Usenet. Lastly, note that I also filter
binary groups because I run a text-only server.
Technical Details
Message-ID:
<ms83v9$keu$1@snarked.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mailReferences:
<mrtoh9$rj1$1@news.bbs.geek.nz> <ms60jk$hrf$1@snarked.org> <ms6d5k$n73$1@news.bbs.geek.nz>Show Full Headers
Complete Article Headers
Message-ID: <ms83v9$keu$1@snarked.org> Subject: Re: unwanted.log Date: Wed, 2 Sep 2015 17:24:10 -0700 From: "D. Stussy" <spam@spam.org> References: <mrtoh9$rj1$1@news.bbs.geek.nz> <ms60jk$hrf$1@snarked.org> <ms6d5k$n73$1@news.bbs.geek.nz> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail Newsgroups: news.software.nntp Lines: 128 Reply-To: "D. Stussy" <newsgroups+replies@kd6lvw.ampr.org> NNTP-Posting-Host: pool-71-106-164-225.lsanca.dsl-w.verizon.net Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: snarked.org 1441239849 20958 71.106.164.225 (3 Sep 2015 00:24:09 GMT) X-Complaints-To: newsmaster+complaints@snarked.org NNTP-Posting-Date: Thu, 3 Sep 2015 00:24:09 +0000 (UTC) In-Reply-To: <ms6d5k$n73$1@news.bbs.geek.nz> X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 X-Newsreader: Microsoft Windows Live Mail 15.4.3538.513 X-No-Archive: Yes X-MSMail-Priority: Normal Importance: Normal X-Received-Body-CRC: 4040516062 X-Received-Bytes: 6859