Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adblocker
10-26-2015, 09:36 AM
Post: #1
Adblocker
The web is full of advertising. On the low-end machines it takes memory and slow you' re browsing (unless you're using a terminal based browser). A while ago I discovered a simple script that puts a list of unwanted garbage in the host file. In other words, it doesn't matter what browser you use it saves from most of the advertising hell Smile

(1) Install sudo with pacman (the script need it)
(note: this solution was from an Ubuntu forum, that's why 'sudo' is used)
(2) Put your name in the etc/sudoers file
(3) Create a new file called hosts.0 with sudo cp /etc/hosts /etc/hosts.0
(4) Create a file newhosts.sh in ~/bin which looks like this:

Code:
#!/bin/bash
# get MVPS hosts file to block ad sites and merge it with our hosts file
wget -O - http://www.mvps.org/winhelp2002/hosts.txt | sed 's/[[:space:]]*#.*$//g;' |
    grep -v localhost | tr ' ' '\t' | tr -s '\t' | tr -d '\015' | sort -u >/tmp/hosts0
cat /etc/hosts.0 /tmp/hosts0|sudo dd of=/etc/hosts
rm -f /tmp/hosts0

(5) Make it executable with: chmod +x newhosts.sh

Run it and say goodbye to most of the advertisments Smile

Some backgroundinformation (what is does and works)
Blocking websites (or content) can be regulated with the /etc/host file
This script downloads a file which contains a list of advertisment companies and merged it into the host file. Once in a while this file is updated so you don't have to do it everytime by hand, just run the script and your up to date.
It saves you time and memory Smile

Goodluck!

Hardware in use: Compaq PIII- 1GHZ, Geforce 4000, 256mb, 80gb HD
Dutch Delicate Linux information: http://www.delicatelinux.nl.ae
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | DeLi(cate) Linux | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication