Latest version of Pup Advert Blocker is...?? [Solved]

Booting, installing, newbie
Post Reply
Message
Author
mrj
Posts: 19
Joined: Wed 19 Aug 2009, 16:57

Latest version of Pup Advert Blocker is...?? [Solved]

#1 Post by mrj »

Currently I'm using Pup Advert Blocker 0.7 .
When using a search engine to try and find
what the current version is all I can find is
version 0.5 . What is the most up-to-date
version of this tool ?
Last edited by mrj on Sun 26 Jan 2014, 00:59, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hello, mrj.

None of the above, but rather Adblock Plus?
https://adblockplus.org

Best regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Terryphi
Posts: 761
Joined: Wed 02 Jul 2008, 09:32
Location: West Wales, Britain.

#3 Post by Terryphi »

mrj:
Puppy Forum member scottman wrote the program and it was updated later by Barry Kauler. The block list has to be manually updated from a selected advert blocking service using an option within Pup-Advert-Blocker and it writes the list to your hosts file. As far as I know it is no longer supported and the URL for the most comprehensive block list, at mvps.org , has changed.

I think musher0 is suggesting it is now easier to use a browser extension for Adblock Plus. There are extensions for Opera, Firefox and Seamonkey and they automatically update the block list.
[b]Classic Opera 12.16 browser SFS package[/b] for Precise, Slacko, Racy, Wary, Lucid, etc available[url=http://terryphillips.org.uk/operasfs.htm]here[/url] :)

mrj
Posts: 19
Joined: Wed 19 Aug 2009, 16:57

#4 Post by mrj »

musher0 and Terryphi, thank you both for your replies.

At home when using dial-up the browser I like to use
is Dillo. Therefore I like altering the hosts file so Dillo
doesn't waste time downloading unnecessary stuff.

Once in awhile I do need to use Firefox or Seamonkey
for those times I need to see more complicated web
pages. I do use Adblock Plus, NoScript and RequestPolicy
to control what is shown on the webpage.

Terrphi wrote;

"Pup-Advert-Blocker ... As far as I know it is no longer
supported and the URL for the most comprehensive block
list, at mvps.org , has changed."

Thank you for letting me know. I will continue to use
Pup Advert Blocker 0.7 but now I'll manually download the
list from mvps.org .

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#5 Post by OscarTalks »

Apologies for posting to ths thread after it has been marked as solved.

@mrj
Where did you get your version 0.7 from?

Anyway, I would normally just install Adblock Plus in each of my installed browsers, but I took a look at Pup Advert Blocker 0.5 and it seems that the Technobeta download URL is dead, BUT the mvps.org one does still download a recently-updated hosts.txt file.

The thing is though, this hosts.txt file has all the host listings starting with 0.0.0.0 instead of 127.0.0.1

Someone said that this is in fact better. Can anyone confirm this?

The snag is that the code in the script which is designed to clean-up and organise the hosts list ends up deleting all of the content of the file. It ends up empty so has no effect. I think this is because the lines are all starting with a zero.

There is a line of code:-

Code: Select all

cat /tmp/adlist{1,2,3,4} |grep ^[1-9] |sed "s/\t//g" |sort |uniq > /tmp/adlist-all
If I change the grep from a 1 to a zero like this:-

Code: Select all

cat /tmp/adlist{1,2,3,4} |grep ^[0-9] |sed "s/\t//g" |sort |uniq > /tmp/adlist-all
the hosts list from mvps is appended to /etc/hosts with the lines starting with 0.0.0.0

...but I need someone to confirm if there is anything wrong with this.
Oscar in England
Image

User avatar
Terryphi
Posts: 761
Joined: Wed 02 Jul 2008, 09:32
Location: West Wales, Britain.

#6 Post by Terryphi »

OscarTalks,

A Google search reveals there has been quite a lot of discussion about the use of 0.0.0.0 (invalid) versus 127.0.0.1. Some people claim that 0.0.0.0 is (minutely) faster which is why it has become popular. However, it is claimed that 0.0.0.0 can create problems if a proxy server is used.

How about coding a conversion to the msvp list to change instances of 0.0.0.0 to 127.0.0.1 before appending to hosts file?
[b]Classic Opera 12.16 browser SFS package[/b] for Precise, Slacko, Racy, Wary, Lucid, etc available[url=http://terryphillips.org.uk/operasfs.htm]here[/url] :)

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#7 Post by OscarTalks »

Terryphi wrote:How about coding a conversion to the msvp list to change instances of 0.0.0.0 to 127.0.0.1 before appending to hosts file?
That sounds like a good idea. I don't know how to code an edit like that though, maybe you or someone can advise.
EDIT:- Think I have figured it out now.

The mvps list is being appended correctly now (based on its format when downloaded) and it does block adverts with the 0.0.0.0 at the beginning of the lines. The only thing is that if you tick all 3 available blocking services you get some duplication because the same bad host may be blocked twice, once with 0.0.0.0 and then again with 127.0.0.1 but this is not a big problem I don't think.

EDIT:- Now that the numbers are edited to 127.0.0.1 the duplicates are removed correctly when the lists are combined.

Apart from that, what I have done so far is change everything "Technobeta" to "Spare" so it can be used for another blocking service later. I changed the instances of "icon=" to "stock=" so the button icons display more universally and I put a bit of extra text in to say that clicking "Start" with nothing selected will remove all blocking.
Last edited by OscarTalks on Fri 31 Jan 2014, 08:59, edited 1 time in total.
Oscar in England
Image

mrj
Posts: 19
Joined: Wed 19 Aug 2009, 16:57

#8 Post by mrj »

OscarTalks wrote:
"Where did you get your version 0.7 from? "

Well that's a good question! I must have found
it a few months ago and can't remember where
it came from. I can't even find the pet I used but
here's the script:

#!/bin/sh

#created by sc0ttman, August 2010
#GPL license /usr/share/doc/legal/gpl-2.0.txt
#100830 BK added GPL license, amended Exit msg, bug fixes.
#updated v06 - increased timeout limit, removed {1,2,3,4} syntax

# make a hosts file if none found, or add a marker
if [ ! -f /etc/hosts ];then
echo "#host file
127.0.0.1 localhost puppypc
" > /etc/hosts
fi

# set vars
export appver='0.7'
export title='Pup Advert Blocker'
# the markers used to find the changes in /etc/hosts, which are made by this app
export markerstart='# pup-advert-blocker IPs below'
export markerend='# pup-advert-blocker IPs above'
export mvps='false'
export systcl='false'
export technobeta='false'
export yoyo='false'

# create functions
set -a

# cleanup all leftover files
cleanup () {
# remove all temp files
rm -f /tmp/adlist1 /tmp/adlist2 /tmp/adlist3 /tmp/adlist4 /tmp/adlist-all /tmp/hosts-temp
}

# download the ads lists
download_adlist () {
# mvps
if [ "$mvps" = true ]; then
wget -c -4 -t 0 -T 20 -O /tmp/adlist1 'http://www.mvps.org/winhelp2002/hosts.txt'
fi
# systcl
if [ "$systcl" = true ]; then
wget -c -4 -t 0 -T 20 -O /tmp/adlist2 'http://sysctl.org/cameleon/hosts'
fi
# technobeta
if [ "$technobeta" = true ]; then
wget -c -4 -t 0 -T 20 -O /tmp/adlist3 'http://www.technobeta.com/download/urlfilter.ini'
fi
# yoyo
if [ "$yoyo" = true ]; then
wget -c -4 -t 0 -T 20 -O /tmp/adlist4 'http://pgl.yoyo.org/as/serverlist.php?h ... =plaintext'
fi
#100830 BK bug fix: create if not exist...
touch /tmp/adlist1
touch /tmp/adlist2
touch /tmp/adlist3
touch /tmp/adlist4
# combine the downloaded lists, then sort and remove duplicates
cat /tmp/adlist1 /tmp/adlist2 /tmp/adlist3 /tmp/adlist4 |grep ^[1-9] |sed "s/\t//g" |sort |uniq > /tmp/adlist-all
}

# clean out everything but the list of IPs and servers
clean_adlist () {
sed -i '/^#/d' /tmp/adlist-all # remove all comments
sed -i '/localhost/d' /tmp/adlist-all # remove the original links to localhost (we already have them)
sed -i '/^$/d' /tmp/adlist-all # remove empty lines
sed -i 's/\t/ /' /tmp/adlist-all # replace all tabs with spaces
sed -i 's/ / /g' /tmp/adlist-all # remove double spaces
dos2unix -u /tmp/adlist-all # change all carriage returns to UNIX format
# remove duplicates (again)
adlistall="`cat /tmp/adlist-all |sort | uniq`" #100830 BK
echo "$adlistall" > /tmp/adlist-all #100830 BK
}

# append the list to the /etc/hosts
append_adlist () {
# echo all but the stuff between the markers to a temp hosts file
sed -e "/$markerstart/,/$markerend/d" /etc/hosts > /tmp/hosts-temp
# remove the markers
sed -i -e "/$markerstart/d" /tmp/hosts-temp
sed -i -e "/$markerend/d" /tmp/hosts-temp
# check the size of the final adlist
# get contents of the downloaded adlist
adlist=`cat /tmp/adlist-all`
if [ ! -z "$adlist" ];then
# add list contents into the hosts file, below a marker (for easier removal)
echo "$markerstart" >> /tmp/hosts-temp
echo "$adlist" >> /tmp/hosts-temp
echo "$markerend" >> /tmp/hosts-temp
else
Xdialog --title "$title $appver" --msgbox "No ad lists selected. Ad blocking will be disabled." 0 0
fi
# replace the original with the cleaned version
mv "/tmp/hosts-temp" "/etc/hosts"
}

success () {
# tell user
Xdialog --title "$title $appver" --msgbox "Success - your settings have been changed.\n\nYour hosts file has been updated." 0 0 &
}

# create a GUI
export HELP_GUI='<window title="'$title' '$appver'">
<frame>
<vbox>
<text width-request="360">
<label> The "'$title'" tool adds stuff to your "/etc/hosts" file, so that many advertising servers and websites will not be able to connect to this PC.</label>
</text>
<text><label>""</label></text>

<text width-request="360">
<label>Leave your cursor over a service to see a short description. You can choose one service or combine multiple services for more advert protection.</label>
</text>
<text><label>""</label></text>

<text width-request="360">
<label>Blocking ad servers protects your privacy, saves you bandwidth, greatly improves web-browsing speeds and makes the internet much less annoying in general.</label>
</text>
<text><label>""</label></text>

<text width-request="360">
<label>'$title' '$appver', by sc0ttman</label>
</text>
</vbox>

<text><label>""</label></text>

<hbox>
<button tooltip-text="Close this help dialog">
<input file icon="gtk-quit"></input>
<label>Close</label>
<action>exec gtkdialog3 --program GUI --center &</action>
<action type="exit">EXIT_NOW</action>
</button>
</hbox>
</frame>
</window>'

export GUI='<window title="'$title' '$appver'">
<vbox>
<vbox homogeneous="true">
<frame>
<text><label>'$title'</label></text>
<text><label>Block online ads in all browsers with this simple tool</label></text>
</frame>
</vbox>
<vbox>

<frame>
<vbox>
<text>
<label>Choose your preferred ad blocking service(s)</label>
</text>
</vbox>
<hbox>
<checkbox tooltip-text="Blocks many known malware sites and unsafe adult networks">
<label>Mvps.org</label>
<variable>mvps</variable>
<default>false</default>
</checkbox>
<checkbox tooltip-text="A large, fairly comprehensive list of many known ad servers">
<label>Systcl.org</label>
<variable>systcl</variable>
<default>false</default>
</checkbox>
<checkbox tooltip-text="A smaller list of popup adverts, ad servers and ad networks">
<label>Technobeta.com</label>
<variable>technobeta</variable>
<default>false</default>
</checkbox>
<checkbox tooltip-text="A small and effective list of popular ad servers">
<label>Yoyo.org</label>
<variable>yoyo</variable>
<default>false</default>
</checkbox>
</hbox>
</frame>

<frame>
<vbox>
<hbox>
<text>
<label>Click the "Start" button to download and block the latest list of known advertising servers</label>
</text>
<button width-request="70" tooltip-text="Click to download and then block a list of advertising servers">
<variable>START</variable>
<input file icon="gtk-execute"></input>
<label>Start</label>
<action>download_adlist</action>
<action>clean_adlist</action>
<action>append_adlist</action>
<action>cleanup</action>
<action>success</action>
</button>
</hbox>

<text><label>""</label></text>

<hbox>
<text>
<label>Or click the "Edit" button to manually edit your hosts file, using your default text editor</label>
</text>
<button width-request="70" tooltip-text="Manually edit your hosts file in a text editor, adding or removing any entries you like">
<variable>EDIT</variable>
<input file icon="gtk-edit"></input>
<label>Edit</label>
<action>defaulttexteditor /etc/hosts &</action>
</button>
</hbox>
</vbox>
</frame>

<frame>
<hbox>
<button tooltip-text="Learn more about blocking ads">
<variable>HELP</variable>
<input file icon="gtk-help"></input>
<label>Help</label>
<action>exec gtkdialog3 --program HELP_GUI --center &</action>
<action type="exit">EXIT_NOW</action>
</button>
<button tooltip-text="Exit '$title'">
<variable>QUIT</variable>
<input file icon="gtk-quit"></input>
<label>Quit</label>
<action type="exit">EXIT_NOW</action>
</button>
</hbox>
</frame>

</vbox>
</vbox>
</window>'

# cleanup before start
cleanup
# run the program
gtkdialog3 --program GUI --center
# end
unset GUI


That's all folks.

OscarTalks, sorry for the late reply. I don't check this forum daily.

User avatar
Terryphi
Posts: 761
Joined: Wed 02 Jul 2008, 09:32
Location: West Wales, Britain.

#9 Post by Terryphi »

OscarTalks wrote:
Terryphi wrote:How about coding a conversion to the msvp list to change instances of 0.0.0.0 to 127.0.0.1 before appending to hosts file?
That sounds like a good idea. I don't know how to code an edit like that though, maybe you or someone can advise.
Under these lines:

Code: Select all

# download the ads lists
download_adlist () {
	# mvps
	if [ "$mvps" = true ]; then
		wget -c -4 -t 0 -T 10 -O /tmp/adlist1 'http://winhelp2002.mvps.org/hosts.txt' 
    fi
Insert:

Code: Select all

sed -i 's/0.0.0.0/127.0.0.1/' /tmp/adlist1
[b]Classic Opera 12.16 browser SFS package[/b] for Precise, Slacko, Racy, Wary, Lucid, etc available[url=http://terryphillips.org.uk/operasfs.htm]here[/url] :)

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#10 Post by OscarTalks »

Terryphi,

Thanks for that. It does work. The list is now almost perfect and does work perfectly as it is. I think there is just one other step that would tidy things up completely.

The mvps list has a comment in square brackets on the end of a small number of the lines. This leads to those hosts still being duplicated (if I run it with 2 or 3 blocking services selected) because the lines are different due to the comments eg:-

Code: Select all

127.0.0.1 00fun.com
127.0.0.1 00fun.com #[Tracking.Cookie]
127.0.0.1 ad2.netshelter.net
127.0.0.1 ad2.netshelter.net #[a.collective-media.net]
127.0.0.1 ad.aim4media.com
127.0.0.1 ad.aim4media.com #[ad.yieldmanager.com]
127.0.0.1 www.worlds-best-online-rob you blind.com
127.0.0.1 www.worlds-best-online-rob you blind.com #[AdWare.Win32.rob you blind.w]
Do you know how to remove those comments from the ends of the lines (obviously without deleting the entire lines)?
Oscar in England
Image

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#11 Post by Ted Dog »

thanks guys for updating this. I prefer this method over in browser methods.

User avatar
Terryphi
Posts: 761
Joined: Wed 02 Jul 2008, 09:32
Location: West Wales, Britain.

#12 Post by Terryphi »

OscarTalks,

The addition of this line removes the comments in the mvps list

Code: Select all

sed -i 's/#.*$//' /tmp/adlist1
Here are my amendments to the mvps section:

Code: Select all

# download the ads lists
download_adlist () {
	# mvps
	if [ "$mvps" = true ]; then
		wget -c -4 -t 0 -T 10 -O /tmp/adlist1 'http://winhelp2002.mvps.org/hosts.txt' # TP fix update URL
	fi
	sed -i 's/0.0.0.0/127.0.0.1/' /tmp/adlist1 # TP fix to change 0.0.0.0 to 127.0.0.1 in mvps list
	sed -i 's/#.*$//' /tmp/adlist1 # TP fix to remove comments in mvps list
I have tested this with the 3 working list sources and it works as expected. There are currently a few remaining duplicates ( such as 00fun.com) I think because of some carriage return errors in one of the smaller downloaded lists. Personally, I think that the mvps.org list is all that is required.

PLEASE BACKUP YOUR SAVE FILE BEFORE TESTING THESE CHANGES.
[b]Classic Opera 12.16 browser SFS package[/b] for Precise, Slacko, Racy, Wary, Lucid, etc available[url=http://terryphillips.org.uk/operasfs.htm]here[/url] :)

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#13 Post by OscarTalks »

Terryphi,

Is it possible that you need to include the space before the comment hash so that sed clips right back to the end of the text without leaving a space on the end of the line? I was trying to test that here and it seems to eliminate those remaining duplicates:-

Code: Select all

sed -i 's/ #.*$//' /tmp/adlist1
Oscar in England
Image

User avatar
Terryphi
Posts: 761
Joined: Wed 02 Jul 2008, 09:32
Location: West Wales, Britain.

#14 Post by Terryphi »

OscarTalks wrote:Terryphi,

Is it possible that you need to include the space before the comment hash so that sed clips right back to the end of the text without leaving a space on the end of the line? I was trying to test that here and it seems to eliminate those remaining duplicates:-

Code: Select all

sed -i 's/ #.*$//' /tmp/adlist1
Yes, that works here too! :)
[b]Classic Opera 12.16 browser SFS package[/b] for Precise, Slacko, Racy, Wary, Lucid, etc available[url=http://terryphillips.org.uk/operasfs.htm]here[/url] :)

Post Reply