Home / Away / Decoy / Away .

CONTENTS

NAME
DESCRIPTION
FILES
CONFIGURATION
PATTERNS
PROFILE
REDIRECT
INSTALL
TIPS
FEEDBACK
LICENSE
AUTHOR

NAME

decoy.pl -- no-ad redirection utility for squid or compatible cache apps

DESCRIPTION

decoy.pl is written for squid. yet it can be used in any cache or application with the same behaviour (as squid). decoy.pl works as follows: get line (url) from the standard input (squid) then check if this line can be matched against list of regular expression patterns. if found return specific url (usually empty gif image--1x1 transparent). if no match found it will return empty line. decoy.pl will reload configuration and patterns list if any of those two files has been changed during decoy.pl's run time. reload will be done on HUP signal as well. checks for file changes are performed on 1 minute (could be configurable in the future). for setup instructions see INSTALL section below.

FILES

Used files are: decoy.pl this is the main executable--can be placed anywhere you want. decoy.cfg this is configuration file which can be placed in one of these locations: /etc/decoy.cfg /usr/etc/decoy.cfg /usr/local/etc/decoy.cfg /usr/local/decoy/decoy.cfg and finally in the current working directory (for test purposes mostly). patterns.def this file holds regular expressions (well mostly simple strings matching known ad hosts). each line is considered expression. empty lines or lines with leading `#' will be ignored. this file name is not fixed and can be changed in the decoy.cfg access.log this file is used to log decoy.pl activity. its name is not fixed and can be changed in decoy.cfg. (see CONFIGURATION) profile.log this file is used to log used patterns, i.e. every matched pattern will be logged for later statistics.

CONFIGURATION

Example PATTERNS=/usr/local/decoy/patterns.def LOG=/usr/local/decoy/access.log PROFILE=/usr/local/decoy/profile.log REDIRECT=http://192.168.3.1/pub/banner.gif

PATTERNS

which file to be loaded as pattern definition. LOG which file to be used as activity log.

PROFILE

which file to be used as profile (pattern usage) log.

REDIRECT

url to which requests will be redirected if pattern matched.

INSTALL

install decoy.pl anywhere you want. edit decoy.cfg as you want and set it in one of the locations mentioned in the FILES/decoy.cfg section above. edit squid.conf and set "redirect_program" to point location of decoy.pl. for example my is: redirect_program /usr/local/decoy/decoy.pl restart squid this should be enough, if you have problems contact me :)

TIPS

if you want to check what are the top 10 matched patterns, the simplest way to do is: cat profile.log | sort | uniq -c | sort -r | head -n 10 in the directory where `profile.log' is. this only works if profile log is enabled and its name is set to `profile.log', otherwise you have to fix the command line above. it is good idea to add all patterns you can think of (usefull really) and at the end of the month (or any time period you want) to sort the profile and use it as patterns list. one way to do this is: cat profile.log | sort | uniq -c | sort -r | cut -f 2 > patterns.def this will overwrite your original patterns file so make a copy before! this will not work if patterns contain spaces. the good thing is that profile entries are sorted by match count so most used patterns will be probed first.

FEEDBACK

it would be very nice if you send me your top 10 matched patterns with their hit counts, so I'll be able to maintain useable sample of the patterns file with decoy.pl distribution package.

LICENSE

GPL.

AUTHOR

(c) Vladi Belperchinov-Shabanski "Cade" 2002 <cade@biscom.net> <cade.datamax.bg> http://soul.datamax.bg/~cade

HISTORY
Thu May  8 2003
321 bytes
Decoy-20021212.tar.gz
Thu Dec 12 2002
9'948 bytes
Decoy-20030508.tar.gz
Thu May  8 2003
10'875 bytes
Decoy-20050826.tar.gz
Fri Aug 26 2005
11'770 bytes

1997-2017 © Vladi Belperchinov-Shabanski | <cade@biscom.net> | <cade@datamax.bg> | http://cade.datamax.bg
The original place of this page is http://cade.datamax.bg/away/decoy. Generated with Evolver.pl on Mon Nov 13 2017