Setting up adblock on Raspberry Pi

Posted by Mike Redrobe | Posted in Technology | Posted on 16-03-2013

Tags:

2

So you’re used to browsing on the PC with Adblock installed,
then you use the default browser (midori)
on the raspberry Pi and find the web is full of annoying ads !

This not only distracts, but also slows down page loading.

Unfortunately the version of midori on the pi does not support ad blocking direct in the browser,

While Chrome and Firefox are actually available on the raspberry Pi in the form of Chromium and Iceweasel and they do support adblock plus, they are very slow and bring the low powered Pi to a crawl.

Here is a quick way you can block all the ads. Not only will your surfing be faster but you will also save some bandwidth.

Simply use a hosts file from the guys at MVPS – they maintain a list of ads which we can use.

Open a terminal window and type (or copy and paste) the following:

wget http://winhelp2002.mvps.org/hosts.txt
sudo mv hosts.txt /etc/hosts

Ads are now gone !

We could stop there – but you will quickly realise that many sites show an error where the advert used to be. There is a way around that too – by running a local webserver that shows a blank image in their place.

Kwakd – simple webserver to serve blank webpages / images
http://code.google.com/p/kwakd/

We’ll have to download and compile it on the raspberry pi:

wget http://kwakd.googlecode.com/files/kwakd-0.3.tgz
tar -xvf kwakd-0.3.tgz
cd kwakd-0.3
./configure
make

now we can run it:

sudo ./kwakd -p 80 &

Ads are now removed, and blank images are served in their place.

Enjoy a cleaner and faster web browsing experience !

Comments (2)

Please let me know how to use VPN?
reda

What is VPN? and how it is used? Please let me know.
Thanks
Reda

Write a comment