Blocking ad servers on *nix machines
Here is my homegrown ad blocking solution. Put this in a text file, name it something like “block”, stick it in ~/bin.
#!/bin/sh
echo “127.0.0.1 $1″ >> /private/etc/hosts
lookupd -flushcache
tail /private/etc/hosts
Now you can sudo block ads.example.com to your heart’s content.
Of course the location of your hosts file might vary depending on your system. The above works for OS X. Also, flushing the lookupd cache is just some added sugar, on systems that don’t use lookupd the blocking will still take effect eventually.
2 Comments so far
Leave a comment
adblock.mozdev.org is God’s own plugin. Block ads with two clicks of the mouse. Regular expressions. Handles embedded plugins. Makes it easy to find transparent 1×1 tracker gifs. More efficient than the localhost hack because it never has to try making a connection, as the html is filtered.
By akb on 02.01.05 8:55 am
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>