Submitted by kurtismccartney on
In December 2009 I made the choice to move away from browser level adblocking into system and router level filtering. This article explains the technical details of my conversion as well as how I chose to deal with problems as they occurred.
Update: Since the command keeps on disappearing from different sites here is my backup.
logger WAN UP Script Executing
sleep 5
test -s /tmp/dlhosts
if [ $? == 1 ] ; then
echo -e "#!/bin/sh\nwget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep 127.0.0.1 | tr -d '\015\032' | sed -e '2,\$s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' > /etc/hosts\nlogger DOWNLOADED http://www.mvps.org/winhelp2002/hosts.txt\nkillall -1 dnsmasq" > /tmp/dlhosts
chmod 777 /tmp/dlhosts
/tmp/dlhosts
fi
cru a Gethosts "45 23 * * 5 /tmp/dlhosts"
First I sought out a solution for adblocking My Chrome install, my girlfriend (AlieBalan.com) and her Firefox/Ubuntu install, and my rother Ky Gratton's Internet Explorer/Windows XP and 7 installs without causing a small war. Originally Alie and I were content with using Firefox/AdBlockPlus, while Ky received a full dose of ads by his own choice.
Unfortunately as I migrate to a new platform and my brother considers migrating entirely to Windows 7 the advertising issue has come up again. Of course, as I already implied the router based filter is preferable but not without some concern. This solution effects all users of my network, wired or wireless but users like my brother may not be easily convinced this is an acceptable idea because it IS censorship by a higher level operator. Even though this operator is me, and I only intend to censor advertisements the point is valid. I will have to convince users on my network how this is a good idea and how it can be monitored as a free and open act.
First I contended that blocking ads would reduce unnecessary bandwidth consumption without negatively effecting quality of service. Quality of service comes first, because otherwise I would have to block all non-text works to conserve bandwidth. Concerns about business models do not immediately effect users on my network, if your favourite site operates only on ad revenue and I have chosen to block ads on MY network is that wrong? Not entirely, after all I do not receive a cut of their ad revenue and I wouldn't want it - just likem public libraries I believe users should influence Internet content providers to make the information free and subsidize the distribution of the content on networks - a public Internet option that is not unlike public healthcare or libraries. I could probably write a very long essay about the importance of sharing useful information and how the useless plays a role in our lives as well. Recreation like gaming typically has a business model that collects money from consumers not advertisers. If demand permits going both ways then solutions like RuneScape have appeared. When I mentioned RuneScape, it clicked - Ads or payment, but we live in a world where organizations like PBS/NPR/CBC/BBC would keep the necessary free and ambitious users would offer competitive entertainment solutions.
So I went to work activating the DD-WRT script found here:
http://www.dd-wrt.com/wiki/index.php/Useful_Scripts#Block_URLs_with_an_A...
This script goes in (Adminsistration>Commands>PASTE IT>Save for Start-up) and then you are nearly done.
Just reboot your router and it will automatically activate the script on reboot. This uses a blocklist that is frequently updated, but it updates itself from the script.
New Problem 1 - With AdBlocking the tough part is finding a list that suits your browsing habits, as some configurations blocked key features on sites like digg.com*. (*Please note that Digg.com may be mixing their stylesheet with their ads to prevent AdBlocking, if you are serious about free media use another social media site. I will be using m.digg.com until they fix their main page stylesheet for use with http://www.mvps.org/winhelp2002/hosts.txt a popular list for preventing ads from eating away my download cap)




