ALL-U-NEED Ad Blocking

I'm not sure this is the same as zombie processes but when I run the ps command in the Tools\System Commands I see a bunch of /tmp/pixelserv processes. They don't die and they start to grow to a point where I have to kill the process as memory starts to get low.

I'm not sure this is the same as zombie processes but when I run the ps command in the Tools\System Commands I see a bunch of /tmp/pixelserv processes. They don't die and they start to grow to a point where I have to kill the process as memory starts to get low.

If you look up "zombies" in wikipedia, you will find these are not zombies - they are worse! They are probably stuck processes consuming resources, waiting for a reply from a browser, but connection has been broken. If you have reliable way of generating them with any version of pixeleserv please let us know - its an intermittent fault so difficult to know if/when fixed.

I started using the PXL_URL method instead of the pixelserv in NVRAM to see if that helps and also since I couldn't figure out how to get pixelserv 21 into NVRAM. I added a scheduler script to killall pixelsrv every night to see if that would be a good workaround.

Also, I'm using pixelserv v21 on Linux 2.4.37.9 using Victek Tomato RAF Firmware v1.28.8515 _RAF ND Std in case someone else has a similar setup. (I tried using the K26 version but it brought my router to a crawl. I'm not sure if I needed to bump up the CPU as I've seen one other poster mentioned.)

The default time is everyday at 4 AM.
AdBlock has optimisations to know if it has to download, remove duplicates (6 min) and restart dnsmasq.
So you may be able to update it more frequently, but I recommend to do it if you have a powerful router.
To force AdBlock to update its files without verifying if they changed, add a parameters to AdBlock when you call it on the command line, for example:
/tmp/ADBLOCK.sh --force

Click to expand...

If I want to update only weekly at 4AM then I must enter:
cru a AdUpd "0 4 * * 1 $ADB" ?

This one has the same effects but it deletes "Advanced > DHCP / DNS > Intercept DNS port" rule each time to guarantee rules are appended in the correct order.

I'm not sure if it will work on all type of tomato versions (default rule for Intercept DNS port might change)

The two scripts have a different rule order ( iptables -L PREROUTING -t nat --line-numbers ).

The one using insert will always place the redirect rule on top (It appear to work fine and it was a suggested alternative in DD-WRT tutorial but I'm not sure if it correctly applies to tomato as well. )

I'm using script for ftp uploading stats and if i paste AdBlock into WAN script i get error that WAN script is too long (max 4096 bytes). I did removed comments and blank lines, but I'm still above 4096. Anyone with resolution for that?

I'm using script for ftp uploading stats and if i paste AdBlock into WAN script i get error that WAN script is too long (max 4096 bytes). I did removed comments and blank lines, but I'm still above 4096. Anyone with resolution for that?

Click to expand...

You could have admin Init generate a /tmp/backup.sh file and add /tmp/backup.sh to Wanup script.

After using the script for a day I have found out that using the default blacklist (1,2,3,4) flash videos from espn.com / abcnews.go.com are being blocked. I have not checked what is being blocked and from what list it is but after a some years of using Firefox's AdBlock and its EasyList feed I dont remember having something legit blocked. Have anybody tried using EasyList with the script?

After using the script for a day I have found out that using the default blacklist (1,2,3,4) flash videos from espn.com / abcnews.go.com are being blocked. I have not checked what is being blocked and from what list it is...

Click to expand...

For abcnews.go.com whitelist cdn.gigya.com which is blocked on the MVPS list.
For espn.com whitelist cdn.visiblemeasures.com which is blocked on the MVPS list and fwmrm.net which is blocked on both the MVPS list and the pgl.yoyo.org list.

For abcnews.go.com whitelist cdn.gigya.com which is blocked on the MVPS list.
For espn.com whitelist cdn.visiblemeasures.com which is blocked on the MVPS list and fwmrm.net which is blocked on both the MVPS list and the pgl.yoyo.org list.

This is an adblock redirect problem to the web interface - pixelserv is listening on port 80, but your web gui https is active on 443 (and a blocked host is trying to get an ad via https). If sticking with that version of Tomato you need to run the Tomato web gui on a non-standard port, say 4343, and access it using "https://myrouter:4343"

pxl_ip- i have set to my router, it would use port 80 becuase i only use port 443 to access my web interface
pxl_exe- location i want to be stored on my usb drive
pxl_url-isn't this a good enough image?

Once you have uploaded pixelserv on a public webserver you'll have to confirm that the URL will work fine:
If you access the download URL in your browser it should download an uncompressed binary executable without asking for passwords or CATPCHA's

Alternatively, if you have a persistent storage, you can place pixelserv in a folder that tomato can access and run a command to grant executable/run rights. (eg chmod +x /tmp/mnt/ROUTER_USB/pixelserv ).

If pixelserv is placed on a persistent storage that tomato can access ( PXL_EXE variable in adblock script ) and it is also granted executable permissions, there will be no need to set PXL_URL variable in adblock script.

Alternatively, if you have a persistent storage, you can place pixelserv in a folder that tomato can access and run a command to grant executable/run rights. (eg chmod +x /tmp/mnt/ROUTER_USB/pixelserv ).

If pixelserv is placed on a persistent storage that tomato can access ( PXL_EXE variable in adblock script ) and it is also granted executable permissions, there will be no need to set PXL_URL variable in adblock script.

If you installed the script on your router, every computers connected to it will block ads (the router blocks ads, not the computer).
If you want a computer to bypass the block, set manually the DNS on this computer instead of using your router IP.

Ever since moving the web gui to https and port 43, I have also been plagued by all kinds of certificate errors. Even opening some emails in Outlook 2000 would bring up a router logon. Goofy stuff. Then I tried this...

This is an adblock redirect problem to the web interface - pixelserv is listening on port 80, but your web gui https is active on 443 (and a blocked host is trying to get an ad via https). If sticking with that version of Tomato you need to run the Tomato web gui on a non-standard port, say 4343, and access it using "https://myrouter:4343"

Click to expand...

Moving the gui to port 4343 fixed EVERYTHING!

Thanks mstombs!!!

Now the real fun begins. I should be getting my new E2000 tomorrow. :biggrin:

and the ad block script does not work anymore, even after erasing NVRAM and reinstalling Tomato 1.28.8520 _RAF ND USB VPN...seems like Tomato 1.28.8520 _RAF ND USB VPN does not support wan up scripts, even though the option is there?
anyone confirm?

I too saw the same problem. I tried re-running the script manually but it looks like it's still picking up the old settings. The script shows that I've updated which host files to get but the script is still running with the old host file.

I ran this cmd: /tmp/ADBLOCK.sh --force

Anyway to force it to pick up the updated script without rebooting the router?

mmmh... did you have an error message ?
The original code was meant to check if pixelserv was started, and restart it if not, or else log some stats.
Your code logs the stats (-SIGUSR1) and force a restart of pixelserv even if it already is started.

What was your problem during the cron update ?
If pixelserv is already running, you don't have to restart it.

That may have been the original intent, but as you can see from the original code, a check is first performed for the pixelserv Process ID. If no PID is found -- pixelserv is started -- otherwise the pixelserv process is killed...

@Bender Bending Rodriguez:
"kill -SIGUSR1 $(pidof pixelserv);" doesn't 'kill' the process, unlike the command says...
It sends the command -SIGUSR1 to the process, which logs some stats in the router's log (You can read them in the control panel).

Are we using the same version of pixelserv here ?
I tested this command and it doesn't kill my pixelserv.
If you say it kills yours, it's a problem with pixelserv, not adblock.

Click to expand...

Aha -- that's the issue!

Code:

/tmp/pixelserv V18 compiled: Nov 3 2010 08:15:01 from pixelserv18.c

I am using pixelserv version 1.8 downloaded via this link from the pixelserv installation section on the first page of this thread

I attempted to get pixelserv version 2.7 working (via the link listed in your signature), but I couldn't get either version contained within the ZIP archive to work on my WRT54G running "vanilla" Tomato 1.28.

you need to whitelist the ff: hotfile, rapidshare, fileserve and a few downloading sites... If I remember correctly, it appears these sites have been blacklisted by the yoyo.org and malwaredomains or two of the other hostfiles....

I have a question/problem.
I am using the adblock script, but now whenever i visit sites (not all, but most?) i get popups like this
"A username and password are being requested by http://rd.clickshift.com."
with different links, such as by statse.webtrendslive.com, demandbase.com, etc

says "It works!" when i click on the link itself.
it's when i, for example, go to wordpress.com, i get this
"A username and password are being requested by http://pixel.quantserve.com. The site says: "Wireless Access Point""
and when i press cancel, i get a second one
"A username and password are being requested by http://b.scorecardresearch.com. The site says: "Wireless Access Point""
then a third when i press cancel again
A username and password are being requested by http://s.stats.wordpress.com. The "site says: "Wireless Access Point""

For various websites, not just wordpress.com
prompts the same popup when i actually go to that link too (eg. b.scorecardresearch.com)

using it with pixelserv27 on a WRT54GL using tomatousb 1.28 if that helps.

I'm using pixelserv v2.7 and Tomato RAF Firmware v1.28.8515 _RAF ND Std on a WRT54GS. I tried v1.8 as well, and both versions of pixelserv v2.7, but I still receive the "Bus error" error. I can confirm that the ad blocking is working but I'd like to get pixelserv working.

I'd appreciate any help

EDIT: Managed to fix it. Turns out my WRT54GS was buggy, so I replaced with with my WRT54GL and had to use the pixelserv.oldT version of pixelserv v2.7 (with Victek's RAF firmware).

I'm having similar as stated earlier. Using pixelserv, it works for a couple days flawlessly. Then given sufficient time, it appears that the ip address specified for pixelserv is instead pointing to the router web gui. I'm experiencing this on two WRT54GL's, dling pixelserv from my dropbox, and downloading a optimized list compiled by the router previously offline.

Still doing it after a copy/paste and just the edits for the lists and pixelserv.

Do you think it is my PATH statement:
root@rtn16:~# echo $PATH
/opt/bin:/opt/sbin:/opt/usr/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/home/root

I am setting it for Optware programs. Maybe the sed, or awk from Optware is behaving differently?

That was it. Looks like I broke it. Your script was barfing on the Optware versions. I added
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
to the top of ADBLOCK.sh and everything worked as planned. Maybe you can add this edit for just in case purposes.
I can mod it here for now. Thanks

Is it possible to just use a static/manually updated list from onboard storage on the router (JFFS2 or USB) instead of grabbing the set of lists or would it just be easier storing a text file on a website and keeping a single entry on the startup list?

I found that by only retrieving the 4th URL (from the GETS variable), I was able to get the script to run without crashing my router.

While monitoring top, I noticed that the awk and sort commands are pretty CPU intensive. My suggestion: might it make sense to run those as "nice" processes? I'm not saying that it would solve the issue I was having (which I have to assume was related to memory, or corrupt data in retrieved URLs), but it couldn't possibly hurt anything, right?

-SIGUSR1 sends a command to pixelserv, it doesn't kill it. This command asks for pixelserv to log something, look into your log.

Click to expand...

-SIGUSR1? Gotcha! I recently read that you can get dnsmasq to write stats to the log that way, too. Now I understand that it's not supposed to kill it, but in my experience, it was. Every time my WAN DHCP lease ran out, pixelserv would either be killed, or re-launched. After I made that small change to the script, it runs fine, and that's enough for me.

Since this router is now serving up to 30 simultaneous users 24/7, I'm not too keen to continue experimenting, :biggrin:

Hi. I'm having a problem getting this script to work. I'm too newb to figure it out by myself, unfortunately. I'm using the latest Victek k2.4 release on a WRT54GL. When I use the cron command in the script, I can read from the log that the script tries updating hosts, but it ends up having 0 entries.

When running ADBLOCK.sh --force, this is the output I'm getting:

Code:

Connecting to pgl.yoyo.org (95.172.9.82:80)
Connecting to mirror1.malwaredomains.com (208.109.181.115:80)
Connecting to [url]www.malwaredomainlist.com[/url] (143.215.130.61:80)
Connecting to [url]www.mvps.org[/url] (209.197.125.64:80)
/tmp/ADBLOCK.sh: line 283: nice: not found
/tmp/ADBLOCK.sh: line 283: nice: not found
/tmp/ADBLOCK.sh: line 283: nice: not found
Done.
4399 nobody 816 R dnsmasq --conf-file=/tmp/gen

This is some relevant conf:
OPTIMISE="Y"
USEPIXELSERV="Y"
ADD_CONF="N"
USEHOSTS="N"
ROUTER="Y"

Please let me know if more information about my setup is needed in order to hopefully get this script working for me.