This script is supposed to parse an Apache log file, look for all domains that exceed a certain amount of accesses (threshold is set as percentage of all accesses), normalize/generalize them and then add it to a .htaccess file in order to block those domains for the future. v1.1: bugfixes, small structural changes, RECOMMENDED UPDATE.