For those of you who haven't been paying much attention to the website,
you'll of noticed that we've had some... difficulties.
One of the things that was desired was to fetch the google-domain
list and to transform it into something we could paste in the
appropriate config file to block referrals from extra-national
google servers.
It's just a few command-line commands (yay command line!). Since I
used tcsh as my login shell, the commands made a pretty simple csh
shell script. It was pointed out that this may be of some interest
to some folks.
So...
_____________________________________________________________________________
#!/bin/csh -f
set RWCND = "RewriteCond %{HTTP_REFERER}"
mkdir /tmp/$$
pushd /tmp/$$
wget http://www.google.com/supported_domains
touch exclude_list
foreach i ( `cat supported_domains | grep -v '^\.google\.com$'` )
echo "$RWCND ^http://www$i [OR]" >> exclude_list
end
popd
cp /tmp/$$/exclude_list ./
_____________________________________________________________________________
(Transforming this into a bourne-shell script is trivial, and left as
an exercise for the motivated reader. Transforming this into a one-line
perl script is left as an exercise for perl weenies.)
And yes, I know that the "cat" is superfluous, but hey, it reads better.
And I got CPU cycles to burn, baby.
[This script is considered public domain yadda yadda yadda...]
--
_ |\_
\|
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg