maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] 'advoid' a hostfile based ad blocker (https://talk.maemo.org/showthread.php?t=30970)

rcull 2009-08-25 20:28

[Announce] 'advoid' a hostfile based ad blocker
 
1 Attachment(s)
Advoid is now in extras + downloads

Advoid uses a downloaded file of adservers from www.mvps.org to amend your systems hostfile. This results in total blockage of any access to these servers. Not only will this block adverts within any browser, it will block access to these servers from any program using URLs and not direct IPs.

There are probably bugs :(:(

Please report any found here :)

Any suggestions, bugfixes, code improvements ( desperately needed :o) gratefully recieved.

Rick

Edit: As YoDude correctly pointed out. This program will need the python2.5-runtime in order to work.

Also, I should mention that it comes with a reasonably up-to-date adserver file so there is no immediate need to download another.

Once 'Update System' has been used you probably do not need to run this prog again untill ( or if ) you find any adservers not covered by the current file. You can then either try a new download or add to your personal file.

The program saves your original hosts and when 'Update System' is pressed/clicked it concatenates the original with any personal and then the adserver file and copies to your hostfile.

You should always be able to 'Revert to Default' putting your hostfile back as it was initially before running this program.

There is now a settings screen allowing file loading chunksize, some fontsize settings, enable credit and full screen on loading + 3 different hostfile sources. In filelist display screens use +/- keys for font size.

I don't know about Windows or Mac ( don't use em ) but this works fine on Debian based Linux as well.

pelago 2009-08-25 20:44

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Where on mvps.org does one download a file of adservers?

rickcull 2009-08-25 20:51

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Quote:

Originally Posted by pelago (Post 315459)
Where on mvps.org does one download a file of adservers?

You use the a program button to do this :)

YoDude 2009-08-25 22:47

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Will an un-install from the app manager revert the hosts file to its previous state?

EDIT: Requires Python runtime >> http://pymaemo.garage.maemo.org/installation.html

rcull 2009-08-26 05:47

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Quote:

Originally Posted by YoDude (Post 315489)
Will an un-install from the app manager revert the hosts file to its previous state?

YoDude
There is a 'Revert to Default' Button within the app for this purpose. Then one of the first things the app does is save your /etc/hosts contents in ~/.apvoid/orighosts.

Rick

HowHH 2009-08-26 13:48

Re: [Announce] 'advoid' a hostfile based ad blocker
 
This is an appreciated addition. I currently use a modified hostfile, manually edited with the www.mvps.org file. An automated process like this will make it much easier to keep up to date.

My question is, should I restore the original hostfile before installing this app and downloading the data, or will it handle the hostfile already in place?

rcull 2009-08-26 14:36

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Quote:

Originally Posted by HowHH (Post 315649)
This is an appreciated addition. I currently use a modified hostfile, manually edited with the www.mvps.org file. An automated process like this will make it much easier to keep up to date.

My question is, should I restore the original hostfile before installing this app and downloading the data, or will it handle the hostfile already in place?

HowHH

The first thing the program does is to save your current hostfile in ./advoid/orighosts. If 'Revert to default' is selected then that file is copied back to /etc/hosts so If there is already a copy of mvps in the hostfile on the initial run the only way to revert would be to manually edit ~/.advoid/orighosts or revert and then edit /etc/hosts.

Rick

rcull 2009-08-26 17:48

Re: [Announce] 'advoid' a hostfile based ad blocker
 
New release.

https://garage.maemo.org/frs/downloa...-0.6-2_all.deb

gui tweeks
Can now add a personal url without displaying files.
Fixed bug in initial copy of /etc/hosts.

Updated link on first post

YoDude 2009-08-28 01:14

Re: [Announce] 'advoid' a hostfile based ad blocker
 
This does a very good job. http://www.clicksmilies.com/auswahl/ernaehrung004.gif

Better than my hand edited hosts file... it even kills images that are inserted into mobile formatted sites like >> http://www.6abctogo.com/wap/traffic/...start=1&loc=13

The Dunkin' Donuts ad on ^that page... history. :)

coredumb 2009-09-07 13:11

Re: [Announce] 'advoid' a hostfile based ad blocker
 
rcull,
how to delete an url that we add manually from the app?

rcull 2009-09-08 16:27

Re: [Announce] 'advoid' a hostfile based ad blocker
 
coredump

The only way with the current version is to delete the line in
/home/user/.advoid/personal with a text editor and then 'Update system' from the app.

I have a new version in the making which will fix this but it will be a little while yet. :(

Rick

tso 2009-09-08 17:55

Re: [Announce] 'advoid' a hostfile based ad blocker
 
si there a way to tell if one is using the downloaded host file or the default one?

rcull 2009-09-08 18:33

Re: [Announce] 'advoid' a hostfile based ad blocker
 
tso
'Show Data Files' displays the 'Current Hostfile' in the third column.
the downloaded file is huge in compareson with the default.

I know this takes a long time to display ( the new version loads the data quickly and progressively - there is a 'More' button below each column )

Rick

tso 2009-09-08 20:17

Re: [Announce] 'advoid' a hostfile based ad blocker
 
ok, when i hit update, the nokia entry goes away.

but nothing shows up in its place...

bah, why do i keep forgetting the stanadard unix erroer checking way, run it in xterm...

anyways, it seems i am getting a sudo prompt. Could it be related to me having sshd installed?

rcull 2009-09-08 21:17

Re: [Announce] 'advoid' a hostfile based ad blocker
 
tso
The Post Install script should run

Code:

echo "user ALL = NOPASSWD: /bin/cp /home/user/.advoid/tmphosts /etc/hosts" >> /etc/sudoers
to allow the copy.

if you run

Code:

tail /etc/sudoers
this should show the sudo line as the last line. (as long as nothing else has added to it since)

Rick

tso 2009-09-08 23:25

Re: [Announce] 'advoid' a hostfile based ad blocker
 
ah, ok. seems i missed a memo somewhere.

seems the line is there, but i stil get a password request in xterm, and i got this when trying up update without supplying a password:

Code:

Traceback (most recent call last):
  File "/usr/bin/advoid", line 197, in Upd_Host_File
    orig=open(self.HOME+"/.advoid/orighosts","r")
IOError: [Errno 2] No such file or directory: '/home/user/.advoid/orighosts'


rcull 2009-09-09 19:38

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Ok
A couple of problems.

1. The sudoers line should refer to tmphost not tmphosts

2. There should be a second line
echo "user ALL = NOPASSWD: /bin/cp /home/user/.advoid/orighosts /etc/hosts" >> /etc/sudoers

These will both be fixed in the comming new version.

If /home/user/.advoid/orighosts is not present it can be written with any editor and the original hostfile for the N8*0 is just the one line:-

127.0.0.1 localhost

Rick

tso 2009-09-16 17:07

Re: [Announce] 'advoid' a hostfile based ad blocker
 
0.8.0-1 fails to install...

rcull 2009-09-16 19:45

Re: [Announce] 'advoid' a hostfile based ad blocker
 
tso You were quick off the mark :) It wasn't there the last time I looked!

It looks like there was a bug in the post-install script.
0.8.0-2 now in the Q'

Rick

tso 2009-09-17 02:01

Re: [Announce] 'advoid' a hostfile based ad blocker
 
heh, i have nothing better to do...

it installed, but it seems i still have issues with sudo. probably something local...

it also fails when trying to download a new list:

Code:

Traceback (most recent call last):
  File "/usr/bin/advoid", line 341, in download
    if self.DLFile.open:
AttributeError: 'file' object has no attribute 'open'

ah, i see what the sudo issue is now, there is a line missing for the backing up of the hosts file in sudoers.

rcull 2009-09-17 05:39

Re: [Announce] 'advoid' a hostfile based ad blocker
 
tso

Yep. The sudoers file is what is amennded in the postinstall script and there was a bug in that :( the problem with the 'file not open' should also be fixed in 0.8.0-2

Rick

tso 2009-09-17 06:30

Re: [Announce] 'advoid' a hostfile based ad blocker
 
that was after i installed 0.8.0-2, as 0.8.0-1 failed to install at all...

rcull 2009-09-17 17:28

Re: [Announce] 'advoid' a hostfile based ad blocker
 
tso

Because its just a read a sudoers line isn't needed to copy /etc/hosts. Advoid checks for the presence of orighosts before doing a copy.
Check your ~/.advoid for orighosts if its there it should contain just the original contents of /etc/hosts.

0.8.0-3 now in the extras-devel queue.

Rick

rcull 2009-09-19 08:32

Re: [Announce] 'advoid' a hostfile based ad blocker
 
advoid is now available from extras-devel. Please test. All bugs / suggestions gratefully recieved.

DaveP1 2009-10-01 20:57

Re: [Announce] 'advoid' a hostfile based ad blocker
 
I installed version 0.8.0-3 on my N810 running OS version 5.2008.43-7.

Installation seemed to go without a hitch. Program starts up with information screen (a minor suggestion - put the version in there). I dismiss the screen and see a downloaded file (from 1/10/2009 according to the header), no personal additions, and a Nokia-N810-43-7 line in the current system settings. So far so good.

Then I click update system and the message "Updating hostfile.." comes up and stays up (for hours if I let it run) with no obvious effect. The Home Tools applet shows minimal CPU load so I would guess it's hung somewhere.

However it's not locked. I can get back to my home screen and if I click Advoid's End Program button it terminates promptly and, seemingly, gracefully. Upon restart it shows only the Nokia line in the current system settings.

This behavior occurs before and after switching off, when plugged in or unplugged, when connected to the Internet or not, or when I try to include a personal URL or not.

I thought it might be a problem with Python but I have HomeTools installed and operating. HomeTools shows in its details that it uses the hildon-desktop-python-loader and python2.5-hildondesktop but these don't show up in the list of installed applications.

Any suggestions would be appreciated.

Addison 2009-10-07 06:26

Re: [Announce] 'advoid' a hostfile based ad blocker
 
I have the exact same issues as reported by Dave.

I recently installed Adblocker on my home computer and love it to death.

Would be nice to hear from someone in getting this to work. :)

Addison 2009-10-07 09:21

Re: [Announce] 'advoid' a hostfile based ad blocker
 
If I run Advoid from Xterm it's requesting a password.

rcull 2009-10-07 20:45

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Guys

Sorry I've been out of circulation for a while. :(

The reason your having problems is that there needs to be an extra line in the sudoers file.

Tso told me about this a few posts ago but I couldn't see it at the time.

I've got a new version about to be submitted. Give it a day or so and update from the new version - It should sort these problems out.

Rick

DaveP1 2009-10-07 21:51

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Quote:

Originally Posted by rcull (Post 341374)
Sorry I've been out of circulation for a while. :(

No need to apologize, it's not like we're sending you a paycheck. :p

Between my Windoze computers, my old Palm, and my N810, I have plenty of open source apps that were last updated two years ago. A response in less than a week is express service.

Thanks for your efforts,

Dave

Addison 2009-10-07 23:43

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Super awesome that you're building another release for us.

Many thanks ahead. :)

rcull 2009-10-08 20:12

Re: [Announce] 'advoid' a hostfile based ad blocker
 
New version 0.9.0 now in autobuilder queue

do your worst.

Rick

Addison 2009-10-08 22:07

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Quote:

Originally Posted by rcull (Post 342079)
New version 0.9.0 now in autobuilder queue

do your worst.

Rick

Oh, it's already worsten! *lol*

Hey dude, I have Extra Dev as a catalog but when I checked for updates Advoid didn't get dinged for having any changes available.

I unistalled Advoid then checked the Application Manager but it's still showing only the old version available.

So what's this auto builder that you're talking about?

Thanks chief!

tso 2009-10-08 23:26

Re: [Announce] 'advoid' a hostfile based ad blocker
 
its a service thats supposed to compile and .deb pack incoming source...

YoDude 2009-10-09 00:05

Re: [Announce] 'advoid' a hostfile based ad blocker
 
doh: When I recently bought an N810 this was the first program I installed after restoring a "back-up" that I made from my old N800 settings. The ad blocking worked it just looked like this program had a problem with its front end....

Today I looked at the bottom of my UserContent.CSS file and saw that I had added the following at some point with the N800..

Code:

/*
 * This file can be used to apply a style to all web pages you view
 * Rules without !important are overruled by author rules if the
 * author sets any.  Rules with !important overrule author rules.
 */

/* You can find the latest version of this ad blocking css at:
 * http://www.floppymoose.com
 * hides many ads by preventing display of images that are inside
 * links when the link HREF contans certain substrings.
 */

A:link[HREF*="javascript:void"]  IMG,
A:link[HREF*="addata"]  IMG,
A:link[HREF*="ad."]  IMG,
A:link[HREF*="ads."]  IMG,
A:link[HREF*="/ad"]  IMG,
A:link[HREF*="/A="]  IMG,
A:link[HREF*="/click"]  IMG,
A:link[HREF*="?click"]  IMG,
A:link[HREF*="?banner"]  IMG,
A:link[HREF*="=click"]  IMG,
A:link[HREF*="clickurl="]  IMG,
A:link[HREF*=".atwola."]  IMG,
A:link[HREF*="spinbox."]  IMG,
A:link[HREF*="transfer.go"]  IMG,
A:link[HREF*="adfarm"]  IMG,
A:link[HREF*="adSpace"]  IMG,
A:link[HREF*="adserve"]  IMG,
A:link[HREF*=".banner"]  IMG,
A:link[HREF*="bluestreak"]  IMG,
A:link[HREF*="doubleclick"]  IMG,
A:link[HREF*="/rd."]  IMG,
A:link[HREF*="/0AD"]  IMG,
A:link[HREF*=".falkag."]  IMG,
A:link[HREF*="trackoffer."]  IMG,
A:link[HREF*="casalemedia."]  IMG,
A:link[HREF*="valueclick."]  IMG,
A:link[HREF*="betterbasketball."]  IMG,
A:link[HREF*="sponsors.phtml"]  IMG,
A:link[HREF*="realgmtix.phtml"]  IMG,
A:link[HREF*="BurstingPipe"]  IMG,
A:link[HREF*="ebayobjects"]  IMG,
A:link[HREF*="tracksponsor."]  IMG { display: none ! important }

/* disable ad iframes */
IFRAME[SRC*="addata"],
IFRAME[SRC*="ad."],
IFRAME[SRC*="ads."],
IFRAME[SRC*="/ad"],
IFRAME[SRC*="/A="],
IFRAME[SRC*="/click"],
IFRAME[SRC*="?click"],
IFRAME[SRC*="?banner"],
IFRAME[SRC*="=click"],
IFRAME[SRC*="clickurl="],
IFRAME[SRC*=".atwola."],
IFRAME[SRC*="spinbox."],
IFRAME[SRC*="transfer.go"],
IFRAME[SRC*="adfarm"],
IFRAME[SRC*="adSpace"],
IFRAME[SRC*="adserve"],
IFRAME[SRC*="adjuggler"],
IFRAME[SRC*=".banner"],
IFRAME[SRC*="bluestreak"],
IFRAME[SRC*="doubleclick"],
IFRAME[SRC*="/rd."],
IFRAME[SRC*="/0AD"],
IFRAME[SRC*=".falkag."],
IFRAME[SRC*="trackoffer."],
IFRAME[SRC*="connextra."],
IFRAME[ID*="merchandisingMERC"],
IFRAME[SRC*="tracksponsor."]  { display: none ! important }


/* miscellaneous different blocking rules to block some stuff that gets through */

A:link[onmouseover*="AdSolution"] IMG,
*[class=sponsors],
*[class=sp_links],
*[class=advertising],
*[ID=sponsors],
*[ID=ad],
*[ID=inlinead],
*[ID=ad_creative],
*[ID=contextualLinks],
IMG[SRC*=".msads."] { display: none ! important }


/* turning some false positives back off */

A:link[HREF*="/add"]  IMG,
A:link[HREF*="/adsl"] IMG,
A:link[HREF*="thread."] IMG,
A:link[HREF*="download."] IMG,
A:link[HREF*="downloads."] IMG,
A:link[HREF*="netflix.com/AddToQueue"] IMG,
A:link[HREF*="load."],
A:link[HREF*="loads."],
IFRAME[SRC*="load."],
IFRAME[SRC*="loads."],
A:link[HREF*="click.mp3"] IMG { display: inline ! important }


/*
 * For more examples see http://www.mozilla.org/unix/customizing.html
 */


Apparently that^ is why ad blocking worked for me :o

Please disregard my previous post in this thread...

Addison 2009-10-09 00:10

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Okay, so he uploaded the new, compiled version somewhere and soon the internet will puke out his latest version for us to download?

Can't wait! :)

No idea what you just said their Yodude but then again that happens a lot to me on these forums. :)

YoDude 2009-10-09 01:45

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Quote:

Originally Posted by Addison (Post 342213)
Okay, so he uploaded the new, compiled version somewhere and soon the internet will puke out his latest version for us to download?

Can't wait! :)

No idea what you just said their Yodude but then again that happens a lot to me on these forums. :)

Way back on the first or second page of this thread I said it was working for me... it wasn't, something else was.

So I guess I'm saying either wait patiently for the update to hit the "Extras" repositories (a few days at most I suspect) or search for UserContent.css + Maemo + chrome and perhaps learn how to do it yourself by adding the posted code to your newly created UserContent.css file.

Either way it ain't instant, but then again both methods are free, and community supported. :)

Addison 2009-10-09 04:34

Re: [Announce] 'advoid' a hostfile based ad blocker
 
I'm more than happy to wait patiently.

Installing most stuff on the Tablet leaves me feeling a tad bit dispeptic afterwards because of the weird difficulty in doing it right. :)

rcull 2009-10-09 05:51

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Addison

When an application is submitted to Extras-Devel it goes into a queue to be auto-built and then added to the catalogue.

Its there now.

Have you clicked on the 'Check for updates' icon - its two semi-circular arrows at the right hand end of the toolbar in application manager.

Rick

rcull 2009-10-09 05:52

Re: [Announce] 'advoid' a hostfile based ad blocker
 
YoDude

Thanks for the vot of confidence :)

Addison 2009-10-09 06:09

Re: [Announce] 'advoid' a hostfile based ad blocker
 
Garbage I tell ya! *lol*

I just checked and it's still showing version 0.8.0-3 from "Extras-Devel".

I don't get it. But hey, let's not talk about my sex life. :)


All times are GMT. The time now is 10:05.

vBulletin® Version 3.8.8