1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ALL-U-NEED Ad Blocking

Discussion in 'Tomato Firmware' started by srouquette, Nov 6, 2010.

  1. ~nephelim~

    ~nephelim~ LI Guru Member

    You could test pixelserv V21.

    EDIT: pixelserv V21 might need and additional -n br0 parameter

    Tomato version with Linux 2.4.37.10 might also help. (you might have an updated version already but it might worth to confirm it with uname -sr)
     
  2. mstombs

    mstombs Network Guru Member

    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.
     
  3. seraphsf

    seraphsf LI Guru Member

    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.)
     
  4. windozer

    windozer Networkin' Nut Member

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

    srouquette Network Guru Member

    yes, "1" will update monday morning at 4AM.
     
  6. ~nephelim~

    ~nephelim~ LI Guru Member

    Thought it would be nice to leverage on the existing already_running_test to poll pixelserv counters each time cron runs adblock.
    Code:
    if [[ "$(pidof pixelserv)" == "" ]]; then $PXL_EXE $PXL_IP; sleep 1 ; else  kill -SIGUSR1 $(pidof pixelserv); fi
     
  7. ~nephelim~

    ~nephelim~ LI Guru Member

    I've been experimenting with a dnsmasq/adblock disable script for Administation > Buttons that provide an alternative to Yaqui's approach (restart dnsmasq).

    Code:
    ## SES - DISABLE Adblocking by Yaqui v1.0
    if ps | grep tmp/gen ; then
       service dnsmasq stop
       killall -9 dnsmasq
       logger ADBLOCK SES button activated adblock shutdown
       sleep 2 
       dnsmasq
       led amber on   #Turn on warning light that adblock is off!
    fi
    The alternative script is preset to run when SES/AOSS Button is pressed for 4-6 seconds.

    dnsnum can be used to choose only one server. (1 or 2 sent from provider; 3, 4 or 5 from Basic > Network > Static DNS)
    dnsnum=1 defaults to the first DNS sent by your ISP.
    Code:
    [COLOR="Blue"]if [ $1 -ge 4 ] && [ $1 -lt 7 ]; then #Press SES button for 4-6 seconds[/COLOR]
    
    [B]dnsnum[/B]=1 # Only a single number; 1 - 2  use a DNS sent by provider; 3 - 5 use one from Basic > Network > Static DNS
    
    nv="nvram get"
    flag="/tmp/dns_flag"
    dnscnt=0; for i in $($nv wan_get_dns;$nv wan_dns|sed 'y/\n/ /'); do
    let dnscnt+=1 
    [ "$i" != "0.0.0.0" ] && dns=$i
    [ $dnscnt -eq $dnsnum ] && break
    done
    
    lan_ipaddr=$($nv lan_ipaddr) 
    lan_netmask=$($nv lan_netmask)
    
    rule="PREROUTING -i br0 -s $lan_ipaddr/$lan_netmask -p udp --dport 53 -j DNAT --to $dns"
    
    if [ -f $flag ] ; then
    iptables -t nat -D $rule
    logger Remove dnsmasq/adblock bypass 
    rm -f $flag
    else
    iptables -t nat -I $rule
    logger "Set dnsmasq/adblock bypass (dns redirected to $dns)"
    touch $flag
    fi
    #iptables -L PREROUTING -t nat --line-numbers 
    
    [COLOR="#0000ff"]fi # Press SES button fi[/COLOR]
    The blue parts of the script should be probably removed for use in Tomato RAF by Victek


    The first time it redirects DNS queries to one of the available DNS servers (including the ones sent by the ISP)

    When DNS traffic is redirected "Advanced > DHCP / DNS > Intercept DNS port" obviously won't apply even if enabled.


    The second time the script is called it removes such DNS redirection.
    "Advanced > DHCP / DNS > Intercept DNS port" will apply again (if it was enabled).

    Since the script did not restart dnsmasq. The adblock filtering will apply again.



    DNS intercept rule from Intercept DNS Port Specific Ip/Range DD-WRT tutorial.


    If a domain is provided in "Basic > Identification > Domain Name", nslookup will not resolve the host correctly until a dot is appended (Browsers are not affected by this)

    Code:
    nslookup www.linksysinfo.org.
     
  8. srouquette

    srouquette Network Guru Member

    good idea, I update adblock with the kill stuff.

    Your script is more efficient than restarting adblock, I'll try it :)
     
  9. ~nephelim~

    ~nephelim~ LI Guru Member

    I made a small correction to use insert ( iptables -t nat -I $rule )

    Will have to make some more tests to see if it is possible to replace that with iptables -t nat -A $rule

    Code:
    [COLOR="Blue"]if [ $1 -ge 4 ] && [ $1 -lt 7 ]; then #Press SES button for 4-6 seconds[/COLOR]
    dnsnum=1 # Only a single number; 1 - 2 sent from provider; 3 - 5 from Basic > Network > Static DNS
    nv="nvram get"
    flag="/tmp/dns_flag"
    dnscnt=0; for i in $($nv wan_get_dns;$nv wan_dns|sed 'y/\n/ /'); do
    let dnscnt+=1 
    [ "$i" != "0.0.0.0" ] && dns=$i
    [ $dnscnt -eq $dnsnum ] && break
    done
    
    lan_ipaddr=$($nv lan_ipaddr) 
    lan_netmask=$($nv lan_netmask)
    
    rule_intcpt="PREROUTING -i br0 -s $lan_ipaddr/$lan_netmask -p udp --dport 53 -j DNAT --to $dns"
    
    if [ -f $flag ] ; then
    iptables -t nat -D $rule_intcpt
    logger Remove dnsmasq/adblock bypass
    rm -f $flag
    else
    iptables -t nat -A $rule_intcpt
    logger "Set dnsmasq/adblock bypass (dns redirected to $dns)"
    touch $flag
    fi
    
    default_intcpt="PREROUTING -p udp -s $lan_ipaddr/$lan_netmask ! -d $lan_ipaddr/$lan_netmask --dport 53 -j DNAT --to-destination $lan_ipaddr"
    
    if [ $($nv dns_intcpt) -eq 1 ]; then
    iptables -t nat -D $default_intcpt
    iptables -t nat -A $default_intcpt
    fi
    
    [COLOR="#0000ff"]fi # Press SES button fi[/COLOR]
    
    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. )
     
  10. alienrex

    alienrex Addicted to LI Member

    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?
     
  11. ~nephelim~

    ~nephelim~ LI Guru Member

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

    Code:
    [COLOR="Blue"]BKS="/tmp/backup.sh"
    {
    cat <<'ENDF' >$BKS
    #!/bin/sh[/COLOR]
    USER="ftpusername"
    PASSWORD="ftppassword"
    SITE="ftpsite" #url WITHOUT ftp://, like "mysite.com" or "IPADDRESS"
    FOLDER="ftpfolder" #WITHOUT ending slash, like "/tomato"
    
    ps | grep -q rstats
    if [ $? == 0 ] ; then
    
    #backup rstats
    led amber on
    led white on
    
    ftpput  -u $USER -p $PASSWORD $SITE $FOLDER/rstats-history.gz /tmp/var/lib/misc/rstats-history.gz
    ftpput  -u $USER -p $PASSWORD $SITE $FOLDER/rstats-speed.gz /tmp/var/lib/misc/rstats-speed.gz
    ftpput  -u $USER -p $PASSWORD $SITE $FOLDER/rstats-stime /tmp/var/lib/misc/rstats-stime
    ftpput  -u $USER -p $PASSWORD $SITE $FOLDER/rstats-source /tmp/var/lib/misc/rstats-source
    
    led white off
    led amber off
    fi
    [COLOR="#0000ff"]ENDF
    }
    chmod 775 $BKS[/COLOR]
     
  12. Mojonba

    Mojonba Network Guru Member

    Quick question about pixelserv.

    I downloaded the v27 zip that contains the 4 files. I uploaded to pixelserv (8kb) file to my webspace and entered the url into your script. Is the way to do it bacause right now it is not working.

    Thanks for the script.
     
  13. mstombs

    mstombs Network Guru Member

    Which version of Tomato?
     
  14. Mojonba

    Mojonba Network Guru Member

    1.28.
     
  15. Mojonba

    Mojonba Network Guru Member

    I did an nslookup to an ad server it it redirected to 0.0.0.0. I suppose it is suppose to redirect to 192.168.1.2?
     
  16. srouquette

    srouquette Network Guru Member

    If you use Tomato 1.28 (and not TomatoUSB), I think you need to copy the 13k file.

    If you are redirected to 0.0.0.0, you forgot to set USEPIXELSERV="Y", and reboot your router.
    Check the log if it says "/tmp/pixelserv V27 compiled: Dec 12 2010 21:49:05 from pixelserv27.c"
     
  17. Mojonba

    Mojonba Network Guru Member

    Code:
    Jan 10 16:53:22 unknown daemon.info pixelserv[412]: /tmp/pixelserv V27 compiled: Dec 12 2010 22:57:42 from pixelserv27.c
    Jan 10 16:53:22 unknown daemon.err pixelserv[415]: Abort: Address already in use
    Jan 10 16:53:23 unknown user.notice root: ADBLOCK ERROR: cannot start pixelserv
    
    USEPIXELSERV is set to Y
    I uploaded the pixelserv.oldT and renamed it to pixelserv
    PXL_IP address is free. I am able to ping it and get the router login prompt.
     
  18. QSxx

    QSxx LI Guru Member

    pixelserv is fighting with tomato integrated web server over port 80 there...

    Try selecting HTTPS instead of HTTP in Administration / Admin Access, leave port 443 (as is). That should free port 80 for pixelserv (if you put PXL_IP to ip of your router)

    Hope this helps
     
  19. Mojonba

    Mojonba Network Guru Member

    Good call. It works now. Thanks.
     
  20. Mojonba

    Mojonba Network Guru Member

    BTW, PXL_IP is set to 192.168.101.2 and the router is on 192.168.101.1. Why the conflict? Why is the router responding on 192.168.101.2:80 as well?

     
  21. mstombs

    mstombs Network Guru Member

    It's a 'feature' of stock Tomato, it binds to port 80 on all interfaces/IPs. This is fixed in Tomatousb - the web server only binds to the lan interface IP.
     
  22. fun.k

    fun.k Addicted to LI Member

    I just gave this quick a shot on a WRT54GS v1 running TomatoUSB, all default settings of the script. Everything seems to be working fine, optimization takes about 4m, thank you guys :)


    Code:
    Jan 13 01:07:36 unknown user.notice root: ADBLOCK: 29613 entries
    Jan 13 01:07:36 unknown user.notice root: ADBLOCK: sorting hosts...
    Jan 13 01:07:43 unknown cron.err crond[89]: time disparity of 21581227 minutes detected
    Jan 13 01:11:48 unknown user.notice root: ADBLOCK: hosts sorted.
    Jan 13 01:11:49 unknown user.notice root: ADBLOCK: 21976 entries
     
  23. Mojonba

    Mojonba Network Guru Member

    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?

    EasyList
     
  24. tmr250z

    tmr250z LI Guru Member

    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.
     
  25. Mojonba

    Mojonba Network Guru Member

    Thanks, I guess the MVPS guys dont watch ESPN.
     
  26. Mojonba

    Mojonba Network Guru Member

    Thx, What would the WAN UP line to start the script be?
     
  27. ~nephelim~

    ~nephelim~ LI Guru Member

    It's the full path to the script generated using init.

    For that example it would be /tmp/backup.sh

    if /tmp/backup.sh still doesn't fit in wanup script you could modify the example to create a shorter script name in the /tmp folder (BKS="/tmp/bks" ) .

    Saving the scripts with firefox or chrome might also increase the script length a little (unlike FF and chrome, IE8 and Opera will count two characters for each new line).
     
  28. Mojonba

    Mojonba Network Guru Member

    I am also getting a lot of these kind of error messages which I believe are due to the Ad Blocking because I did not get them before. They happen in many other secure sites as well/

    [​IMG]
     
  29. mstombs

    mstombs Network Guru Member

    @Mojonba

    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"
     
  30. iXiCYNiKiXi

    iXiCYNiKiXi Networkin' Nut Member

    Hi guys, can someone help me out with pixelserv?
    Here is my problem...

    Jan 18 04:57:39 Tomato user.notice root: ADBLOCK ERROR: cannot start pixelserv

    Obviously, this looks like pixelserv cannot start, here is my config

    USEPIXELSERV="Y"
    PXL_IP=192.168.1.1
    PXL_EXE="/tmp/mnt/ROUTER_USB/Pixelserv"
    PXL_URL="http://upload.wikimedia.org/wikipedia/commons/c/ca/1x1.png"

    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?

    running on:
    Asus WL520GU with Tomato Firmware v1.28.8754 ND USB Ext

    maybe i am just retarded?
     
  31. ~nephelim~

    ~nephelim~ LI Guru Member

    PXL_URL is not meant for an image but for an executable (pixel server).

    You have to download the latest version of pixelsev, extract it from the zip archive and place it on a webserver/filesharig service so it can be directly downloaded by adblock script.

    pixelservXX.zip contain two version of the pixel server:

    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.
     
  32. rhester72

    rhester72 Network Guru Member

    What is the output of this command?

    netstat -an | grep LISTEN | grep :80

    Rodney
     
  33. iXiCYNiKiXi

    iXiCYNiKiXi Networkin' Nut Member

    kk so i did the above quoted and now this is my output

    Jan 18 08:18:15 Tomato daemon.info pixelserv[500]: /tmp/mnt/ROUTER_USB/Pixelserv/pixelserv V27 compiled: Dec 12 2010 21:49:05 from pixelserv27.c
    Jan 18 08:18:15 Tomato daemon.notice pixelserv[503]: Listening on 192.168.1.1:80
    Jan 18 08:18:20 Tomato user.notice root: ADBLOCK: http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml
    Jan 18 08:18:21 Tomato user.notice root: ADBLOCK: http://mirror1.malwaredomains.com/files/justdomains
    Jan 18 08:18:22 Tomato user.notice root: ADBLOCK: http://www.malwaredomainlist.com/hostslist/hosts.txt
    Jan 18 08:18:26 Tomato user.notice root: ADBLOCK: http://www.mvps.org/winhelp2002/hosts.txt
    Jan 18 08:18:27 Tomato user.notice root: ADBLOCK: 28913 entries
    Jan 18 08:18:27 Tomato user.notice root: ADBLOCK: sorting hosts...
    Jan 18 08:18:41 Tomato cron.err crond[114]: time disparity of 21589278 minutes detected
    Jan 18 08:21:26 Tomato user.notice root: ADBLOCK: hosts sorted.
    Jan 18 08:21:26 Tomato user.notice root: ADBLOCK: 21291 entries
    Jan 18 08:21:28 Tomato daemon.info dnsmasq[141]: exiting on receipt of SIGTERM
    Jan 18 08:21:30 Tomato daemon.info dnsmasq[701]: started, version 2.55 cachesize 2048
    Jan 18 08:21:30 Tomato daemon.info dnsmasq[701]: compile time options: no-IPv6 GNU-getopt no-RTC no-DBus no-I18N DHCP TFTP
    Jan 18 08:21:30 Tomato daemon.info dnsmasq[701]: asynchronous logging enabled, queue limit is 5 messages
    Jan 18 08:21:30 Tomato user.alert kernel: Unable to handle kernel paging request at virtual address 00000000, epc == 8001d60c, ra == 800042ec
    Jan 18 08:21:30 Tomato user.warn kernel: Oops in fault.c::do_page_fault, line 206:
    Jan 18 08:21:30 Tomato user.warn kernel: $0 : 00000000 1000dc00 00000000 00000000 00000011 00313139 00000000 ffff00ff
    Jan 18 08:21:30 Tomato user.warn kernel: $8 : 1000dc01 0000dc00 00000000 80188000 000007b8 1000dc01 00000000 00000001
    Jan 18 08:21:30 Tomato user.warn kernel: $16: 00000008 80515e80 00000011 80515f30 00000012 00000012 7fff7a74 000000e7
    Jan 18 08:21:30 Tomato user.warn kernel: $24: ba2e8ba3 8000c35c 80514000 80515e40 805143d0 800042ec
    Jan 18 08:21:30 Tomato user.warn kernel: Hi : ffffe8d8
    Jan 18 08:21:30 Tomato user.warn kernel: Lo : 000007b8
    Jan 18 08:21:30 Tomato user.warn kernel: epc : 8001d60c Tainted: P
    Jan 18 08:21:30 Tomato user.warn kernel: Status: 1000dc02
    Jan 18 08:21:30 Tomato user.warn kernel: Cause : 00000008
    Jan 18 08:21:30 Tomato user.warn kernel: PrId : 00029029
    Jan 18 08:21:30 Tomato user.warn kernel: Process dnsmasq (pid: 699, stackpage=80514000)
    Jan 18 08:21:30 Tomato user.warn kernel: Stack: 80515ec8 7faea138 80562940 805628c0 00000008 7fff7a74 00000008
    Jan 18 08:21:30 Tomato user.warn kernel: 80515f30 00000000 00000008 800042ec 80514000 8000bcc0 8000bc5c 1000dc01
    Jan 18 08:21:30 Tomato user.warn kernel: 006898b0 80ed73e0 80ed7450 80515eb8 7fff7a74 80ed7450 00000000 805628c0
    Jan 18 08:21:30 Tomato user.warn kernel: 000000e7 0043dc88 80042c7c 806f0cc0 8035bcbc 80012d80 80012bb8 00000000
    Jan 18 08:21:30 Tomato user.warn kernel: 80514000 00000000 00000000 80ed73e0 00000008 fffffe00 80042da0 ffffffff
    Jan 18 08:21:30 Tomato daemon.info dnsmasq[701]: reading /etc/resolv.dnsmasq
    Jan 18 08:21:30 Tomato user.warn kernel: 00000000 ...
    Jan 18 08:21:30 Tomato user.warn kernel: Call Trace: [<800042ec>] [<8000bcc0>] [<8000bc5c>] [<80042c7c>] [<80012d80>]
    Jan 18 08:21:30 Tomato user.warn kernel: [<80012bb8>] [<80042da0>] [<80038524>] [<800384b4>] [<80008e10>] [<8005cd1c>]
    Jan 18 08:21:30 Tomato user.warn kernel: Code: 00041142 00021080 00431021 <8c420000> 3083001f 00621006 30420001 10400008 278403e0
    Jan 18 08:21:30 Tomato daemon.info dnsmasq[701]: using nameserver 208.67.221.221#53
    Jan 18 08:21:30 Tomato daemon.info dnsmasq[701]: using nameserver 208.67.220.220#53
    Jan 18 08:21:30 Tomato daemon.info dnsmasq[701]: using nameserver 208.67.222.222#53
    Jan 18 08:21:30 Tomato daemon.info dnsmasq[701]: read /etc/hosts - 2 addresses
    Jan 18 08:21:30 Tomato user.notice root: ADBLOCK: dnsmasq is running
    Jan 18 08:21:30 Tomato daemon.info dnsmasq[701]: read /etc/hosts.dnsmasq - 4 addresses

    i can see from this line:
    /Pixelserv/pixelserv V27 compiled: Dec 12 2010 21:49:05 from pixelserv27.c

    that it is compiled, but how do i check if its working? I dont see any difference (hence why i think it isnt working)

    i am sure i used the correct pixelserv file, the one WITHOUT the oldt right
    pixelserv will work with Victek's Tomato RAF and Teddybear's Tomato USB builds of Tomato
    that one?

    i rebooted and then got this as my output:
    Jan 18 08:38:24 Tomato daemon.info pixelserv[478]: /tmp/mnt/ROUTER_USB/Pixelserv/pixelserv V27 compiled: Dec 12 2010 21:49:05 from pixelserv27.c
    Jan 18 08:38:25 Tomato daemon.notice pixelserv[481]: Listening on 192.168.1.1:80

    not sure if im done yet, or how to check if this is working and how many ads it blocked.
    Is there anything i need to do client side?

    edit:
    ran command "kill -SIGUSR1 $(pidof pixelserv)" and i assume if i get this output, it must be working:
    Jan 18 09:34:06 Tomato auth.info login[696]: root login on 'pts/0'
    Jan 18 09:36:08 Tomato daemon.info pixelserv[478]: 22 requests, 0 errors, 0 bad, 12 gif, 10 txt replies
    Jan 18 09:36:37 Tomato daemon.info pixelserv[478]: 22 requests, 0 errors, 0 bad, 12 gif, 10 txt replies
    Jan 18 09:36:58 Tomato daemon.info pixelserv[478]: 22 requests, 0 errors, 0 bad, 12 gif, 10 txt replies
    Jan 18 09:37:39 Tomato daemon.info pixelserv[478]: 26 requests, 0 errors, 0 bad, 13 gif, 13 txt replies
    Jan 18 09:38:53 Tomato daemon.info pixelserv[478]: 33 requests, 0 errors, 0 bad, 13 gif, 20 txt replies
     
  34. ~nephelim~

    ~nephelim~ LI Guru Member

    Looks like pixelserv is up and already replacing ads.

    I guess you should ask around about those kernel warnings in you log.
    They don't look reassuring. :eek:
     
  35. srouquette

    srouquette Network Guru Member

    try an address from pgl.yoyo.com, for example: adclick.com

    If you see a white page with a title (1x1), it means it works :)
     
  36. iXiCYNiKiXi

    iXiCYNiKiXi Networkin' Nut Member

    thanks for getting pixelserv to work, works great!

    but one more question,

    how would i have this adblock apply to every single computer on my LAN besides one. Is there a way to block a certain IP on my LAN from being blokced by ads?
     
  37. srouquette

    srouquette Network Guru Member

    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.
     
  38. ~nephelim~

    ~nephelim~ LI Guru Member

    Also keep "Advanced > DHCP / DNS > Intercept DNS port" disabled or Tomato will intercept all DNS requests even for computers configured to use a different DNS server.
     
  39. atom.Man

    atom.Man Networkin' Nut Member

    Ad Block not working

    hi all!

    TomatoUSB 1.28

    pertinent details...

    Code:
    OPTIMISE="N"
    GETS="1"
    S1="http://www.malwaredomainlist.com/hostslist/hosts.txt" 
    TRIM_BEGIN=3
    S1="http://www.malwaredomainlist.com/hostslist/hosts.txt"
    USEWHITELIST="N"
    USEPIXELSERV="N"
    UPLOAD="N"
    ADD_CONF="N"
    USEHOSTS="N"
    ROUTER="Y"
    NIP="0.0.0.0"
    UPDATE="Y"
    
    i cleared my DNS cache, installed the script, saved and rebooted a couple times and it isn't working

    here's some log stuff shortly after a reboot...

    Code:
    Jan 22 02:53:48 ATOMNET user.notice root: ADBLOCK: http://www.malwaredomainlist.com/hostslist/hosts.txt
    Jan 22 02:53:48 ATOMNET user.notice root: ADBLOCK: 2515 entries
    Jan 22 02:53:48 ATOMNET user.notice root: ADBLOCK: 2515 entries
    Jan 22 02:53:49 ATOMNET daemon.info dnsmasq[125]: exiting on receipt of SIGTERM
    [B]Jan 22 02:53:49 ATOMNET daemon.crit dnsmasq[428]: error at line 1 of /tmp/gen[/B]
    [B]Jan 22 02:53:49 ATOMNET daemon.crit dnsmasq[428]: FAILED to start up[/B]
    [B]Jan 22 02:53:49 ATOMNET user.notice root: ADBLOCK ERROR: restarting dnsmasq...[/B]
    Jan 22 02:53:49 ATOMNET daemon.info dnsmasq[435]: started, version 2.55 cachesize 150
    Jan 22 02:53:49 ATOMNET daemon.info dnsmasq[435]: compile time options: no-IPv6 GNU-getopt no-RTC no-DBus no-I18N DHCP TFTP
    Jan 22 02:53:49 ATOMNET daemon.info dnsmasq[435]: reading /etc/resolv.dnsmasq
    Jan 22 02:53:49 ATOMNET daemon.info dnsmasq[435]: using nameserver 156.154.70.22#53
    Jan 22 02:53:49 ATOMNET daemon.info dnsmasq[435]: using nameserver 208.67.222.222#53
    Jan 22 02:53:49 ATOMNET daemon.info dnsmasq[435]: using nameserver 208.67.220.220#53
    Jan 22 02:53:49 ATOMNET daemon.info dnsmasq[435]: read /etc/hosts - 2 addresses
    Jan 22 02:53:49 ATOMNET daemon.info dnsmasq[435]: read /etc/hosts.dnsmasq - 1 addresses
    Jan 22 02:53:52 ATOMNET daemon.err nmbd[116]: Samba name server ATOMNET is now a local master browser for workgroup HOME on subnet 192.168.1.1
    Jan 22 02:54:20 ATOMNET cron.err crond[100]: time disparity of 21594714 minutes detected
    
    i tried Yaqui's script before this one and it worked fine - trying this one 'cause i like to play

    i'm VERY new to Tomato and know bery little about linux, so i may have missed something simple...

    i didn't dump the nvram after removing the old script and before using this one, though i did reboot in between - is that a possible problem?
     
  40. Sharp Rock

    Sharp Rock Addicted to LI Member

    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...

    Moving the gui to port 4343 fixed EVERYTHING!

    Thanks mstombs!!! :)

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

    Jerry
     
  41. srouquette

    srouquette Network Guru Member

    Hello,
    sometimes, it happens there's a mistake in the source file.
    Do you have putty ?
    Connect to your router with it (telnet to your router IP, login: root, pass: your password)
    and type this:
    Code:
    cd /tmp
    less gen
    
    post here what are the first lines (the error is at line 1...)

    You can wait a few days and restart your router to see if they fixed it...
     
  42. atom.Man

    atom.Man Networkin' Nut Member

    @srouquette

    told ya i was a nOOb - took awhile to figure out i had to log in as 'root' and not 'admin' - sheesh

    'less gen' returned 'less: can't open 'gen': No such file or directory'

    there are 2 'gen' files in /tmp: 'gen.last' and 'gen.md5'
     
  43. srouquette

    srouquette Network Guru Member

    it's strange you don't have a gen file.
    in tmp directory, try to start adblock with this line:
    ./ADBLOCK.sh --force
    Then see if there's a gen file and take a look at the log too.
     
  44. atom.Man

    atom.Man Networkin' Nut Member

    Code:
    root@ATOMNET:/tmp# ./ADBLOCK.sh --force
    Connecting to www.malwaredomainlist.com (143.215.130.61:80)
    
    Done.
    
    dnsmasq: error at line 1 of /tmp/gen
    what's the gen file for BTW?
     
  45. tmr250z

    tmr250z LI Guru Member

    Why did you modify the sources like that? If you only wanted to use the MDL hosts file, you should have left them alone and just changed GETS to 3.

    Code:
    GETS="3"
    TRIM_BEGIN=3
    S1="http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml"  #44K
    S2="http://mirror1.malwaredomains.com/files/justdomains"    #189K
    S3="http://www.malwaredomainlist.com/hostslist/hosts.txt"   #97K
    S4="http://www.mvps.org/winhelp2002/hosts.txt"              #620K
    S5="http://hosts-file.net/hphosts-partial.asp"              #460K
    S6="http://hostsfile.mine.nu/Hosts"                         #2641K
    S7="http://support.it-mate.co.uk/downloads/hosts.txt"       #3851K
    
    That's probably what's causing the problem...
     
  46. atom.Man

    atom.Man Networkin' Nut Member

    dumb mistake on my part - i didn't see that the list i wanted was already provided by default

    it works fine now
     
  47. iXiCYNiKiXi

    iXiCYNiKiXi Networkin' Nut Member

    hey i changed from tomato usb nd to
    Tomato 1.28.8520 _RAF ND USB VPN

    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?

    edit: i post this script in my INIT and i edited the sleep value to 30 ,and it ran...though i cannot confirm its running, but here is my output from the INIT script
    Dec 31 19:00:42 tomato user.info init[1]: Tomato 1.28.8520 _RAF ND USB VPN
    Dec 31 19:00:42 tomato user.info init[1]: Asus WL-520GU
    Dec 31 19:00:43 tomato user.notice root: ADBLOCK: http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml
    Dec 31 19:00:44 tomato user.notice root: ADBLOCK: http://mirror1.malwaredomains.com/files/justdomains
    Dec 31 19:00:45 tomato user.notice root: ADBLOCK: http://www.malwaredomainlist.com/hostslist/hosts.txt
    Dec 31 19:00:51 tomato user.notice root: ADBLOCK: http://www.mvps.org/winhelp2002/hosts.txt
    Dec 31 19:00:52 tomato user.notice root: ADBLOCK: 29671 entries
    Dec 31 19:00:52 tomato user.notice root: ADBLOCK: sorting hosts...
    Dec 31 19:02:53 tomato user.notice root: ADBLOCK: hosts sorted.
    Dec 31 19:02:53 tomato user.notice root: ADBLOCK: 21979 entries
    Dec 31 19:02:55 tomato daemon.info dnsmasq[109]: exiting on receipt of SIGTERM
    Dec 31 19:02:56 tomato daemon.info dnsmasq[308]: started, version 2.55 cachesize 150
    Dec 31 19:02:56 tomato daemon.info dnsmasq[308]: compile time options: no-IPv6 GNU-getopt no-RTC no-DBus no-I18N DHCP no-scripts TFTP
    Dec 31 19:02:57 tomato daemon.info dnsmasq[308]: reading /etc/resolv.dnsmasq
    Dec 31 19:02:57 tomato daemon.info dnsmasq[308]: using nameserver 208.67.221.221#53
    Dec 31 19:02:57 tomato daemon.info dnsmasq[308]: using nameserver 208.67.220.220#53
    Dec 31 19:02:57 tomato daemon.info dnsmasq[308]: using nameserver 208.67.222.222#53
    Dec 31 19:02:57 tomato user.notice root: ADBLOCK: dnsmasq is running
    Dec 31 19:02:57 tomato daemon.info dnsmasq[308]: read /etc/hosts - 2 addresses
    Dec 31 19:02:57 tomato daemon.info dnsmasq[308]: read /etc/hosts.dnsmasq - 1 addresses
     
  48. srouquette

    srouquette Network Guru Member

    Code:
    ADBLOCK: dnsmasq is running
    Yes it's running :)

    I can't comment on the firmware you're using, I don't use this one.
     
  49. iXiCYNiKiXi

    iXiCYNiKiXi Networkin' Nut Member

    its weird that the firmware wont execute a WANUP script, however generally speaking is there anything wrong with running it in the INIT script oppose to WANUP?
     
  50. srouquette

    srouquette Network Guru Member

    There's a "sleep 10" at the beginning of the script, your WAN should be up at the time the script starts downloading the hosts files.
    it's ok in INIT.
     
  51. QSxx

    QSxx LI Guru Member

    Hey guys...

    As of this morning, ad-block seems to have died - it's not sorting properly...

    Anyone else noticed this behavior?

    Here's the log:

    Jan 31 09:54:17 nodeone user.notice root: ADBLOCK: http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml
    Jan 31 09:54:18 nodeone user.notice root: ADBLOCK: http://mirror1.malwaredomains.com/files/justdomains
    Jan 31 09:54:19 nodeone user.notice root: ADBLOCK: http://www.malwaredomainlist.com/hostslist/hosts.txt
    Jan 31 09:54:27 nodeone user.notice root: ADBLOCK: http://www.mvps.org/winhelp2002/hosts.txt
    Jan 31 09:54:28 nodeone user.notice root: ADBLOCK: http://xxx/qs/tomato/blacklist
    Jan 31 09:54:28 nodeone user.notice root: ADBLOCK: whitelist http://xxx/qs/tomato/whitelist
    Jan 31 09:54:30 nodeone user.notice root: ADBLOCK: 31684 entries
    Jan 31 09:54:30 nodeone user.notice root: ADBLOCK: sorting hosts...
    Jan 31 09:54:42 nodeone cron.err crond[416]: time disparity of 21607734 minutes detected
    Jan 31 09:55:34 nodeone user.notice root: ADBLOCK: hosts sorted.
    Jan 31 09:55:34 nodeone user.notice root: ADBLOCK: 0 entries

    EDIT: FOUND THE CAUSE - Source 2 (http://mirror1.malwaredomains.com/files/justdomains) is borked for now so skip it if you get the same thing as i do
     
  52. iXiCYNiKiXi

    iXiCYNiKiXi Networkin' Nut Member

    definitely can confirm that error

    Jan 31 09:16:02 tomato user.notice root: ADBLOCK: http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml
    Jan 31 09:16:03 tomato user.notice root: ADBLOCK: http://mirror1.malwaredomains.com/files/justdomains
    Jan 31 09:16:04 tomato user.notice root: ADBLOCK: http://www.malwaredomainlist.com/hostslist/hosts.txt
    Jan 31 09:16:08 tomato user.notice root: ADBLOCK: http://www.mvps.org/winhelp2002/hosts.txt
    Jan 31 09:16:10 tomato user.notice root: ADBLOCK: 31685 entries
    Jan 31 09:16:10 tomato user.notice root: ADBLOCK: sorting hosts...
    Jan 31 09:16:26 tomato cron.err crond[111]: time disparity of 21608056 minutes detected
    Jan 31 09:17:21 tomato user.notice root: ADBLOCK: hosts sorted.
    Jan 31 09:17:21 tomato user.notice root: ADBLOCK: 0 entries

    guess i'll just edit out the 2nd host till tomorrow.

    EDIT: removed second source just like QSxx did and added S5 and the script worked.
    Jan 31 09:25:57 tomato user.notice root: ADBLOCK: http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml
    Jan 31 09:25:58 tomato user.notice root: ADBLOCK: http://www.malwaredomainlist.com/hostslist/hosts.txt
    Jan 31 09:26:02 tomato user.notice root: ADBLOCK: http://www.mvps.org/winhelp2002/hosts.txt
    Jan 31 09:26:06 tomato user.notice root: ADBLOCK: http://hosts-file.net/hphosts-partial.asp
    Jan 31 09:26:07 tomato user.notice root: ADBLOCK: 22351 entries
    Jan 31 09:26:07 tomato user.notice root: ADBLOCK: sorting hosts...
    Jan 31 09:26:16 tomato cron.err crond[111]: time disparity of 21608066 minutes detected
    Jan 31 09:27:40 tomato user.notice root: ADBLOCK: hosts sorted.
    Jan 31 09:27:40 tomato user.notice root: ADBLOCK: 14308 entries
     
  53. seraphsf

    seraphsf LI Guru Member

    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?
     
  54. malwaredomains

    malwaredomains Networkin' Nut Member

    malwaredomains fixed (we hope)

    can someone try again - we fixed the file at malwaredomains...
     
  55. QSxx

    QSxx LI Guru Member

    Jan 31 21:46:04 nodeone user.notice root: ADBLOCK: http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml
    Jan 31 21:46:06 nodeone user.notice root: ADBLOCK: http://mirror1.malwaredomains.com/files/justdomains
    Jan 31 21:46:07 nodeone user.notice root: ADBLOCK: http://www.malwaredomainlist.com/hostslist/hosts.txt
    Jan 31 21:46:18 nodeone user.notice root: ADBLOCK: http://www.mvps.org/winhelp2002/hosts.txt
    Jan 31 21:46:20 nodeone user.notice root: ADBLOCK: 28687 entries
    Jan 31 21:46:20 nodeone user.notice root: ADBLOCK: sorting hosts...
    Jan 31 21:47:27 nodeone user.notice root: ADBLOCK: hosts sorted.
    Jan 31 21:47:27 nodeone user.notice root: ADBLOCK: 0 entries

    Negative, still borked... congrats on fast reply though :) [time on router is correct in GMT+1]

    There's an empty line on top of the file, maybe that's killing our script... Can't help you more till one of the coders sees this...
     
  56. malwaredomains

    malwaredomains Networkin' Nut Member

    Please try again

    Please try again....
     
  57. iXiCYNiKiXi

    iXiCYNiKiXi Networkin' Nut Member

    Jan 31 18:09:35 tomato user.notice root: ADBLOCK: http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml
    Jan 31 18:09:36 tomato user.notice root: ADBLOCK: http://mirror1.malwaredomains.com/files/justdomains
    Jan 31 18:09:37 tomato user.notice root: ADBLOCK: http://www.malwaredomainlist.com/hostslist/hosts.txt
    Jan 31 18:09:42 tomato user.notice root: ADBLOCK: http://www.mvps.org/winhelp2002/hosts.txt
    Jan 31 18:09:43 tomato user.notice root: ADBLOCK: 28688 entries
    Jan 31 18:09:43 tomato user.notice root: ADBLOCK: sorting hosts...
    Jan 31 18:09:59 tomato cron.err crond[108]: time disparity of 21608589 minutes detected
    Jan 31 18:11:39 tomato user.notice root: ADBLOCK: hosts sorted.
    Jan 31 18:11:39 tomato user.notice root: ADBLOCK: 21010 entries
    Jan 31 18:11:41 tomato daemon.info dnsmasq[130]: exiting on receipt of SIGTERM
    Jan 31 18:11:43 tomato daemon.info dnsmasq[809]: started, version 2.55 cachesize 150
    Jan 31 18:11:43 tomato daemon.info dnsmasq[809]: compile time options: no-IPv6 GNU-getopt no-RTC no-DBus no-I18N DHCP no-scripts TFTP
    Jan 31 18:11:43 tomato user.notice root: ADBLOCK: dnsmasq is running
    ---------

    it works, confirmed...what was the issue though?
     
  58. QSxx

    QSxx LI Guru Member

    Yep, I can confirm iXiCYNiKiXi's finding - you are safe with no. 2 again:

    ...
    Feb 1 10:30:23 nodeone user.notice root: ADBLOCK: http://mirror1.malwaredomains.com/files/justdomains
    ...
    Feb 1 10:30:32 nodeone user.notice root: ADBLOCK: 28713 entries
    Feb 1 10:30:32 nodeone user.notice root: ADBLOCK: sorting hosts...
    Feb 1 10:32:18 nodeone user.notice root: ADBLOCK: hosts sorted.
    Feb 1 10:32:18 nodeone user.notice root: ADBLOCK: 21035 entries

    Not sure about the reason why - they said their list was somehow corrupted (http://www.malwaredomains.com/wordpress/?p=1597)... Glad everything's allright now...
     
  59. Bender Bending Rodriguez

    Bender Bending Rodriguez Networkin' Nut Member

    The current base64 encoded section of the script contains an error that causes pixelserv to fail to properly restart during the 4:00AM nightly cron update:

    :oops:

    Code:
    if [[ "$(pidof pixelserv)" == "" ]]; then $PXL_EXE $PXL_IP; sleep 1 ; else  kill -SIGUSR1 $(pidof pixelserv); fi
    if [[ "$(pidof pixelserv)" == "" ]]; then
    logger ADBLOCK ERROR: cannot start pixelserv
    

    I remedied the issue by implementing the following code changes:

    Code:
    if [[ "$(pidof pixelserv)" != "" ]]; then kill -SIGUSR1 $(pidof pixelserv); fi
    $PXL_EXE $PXL_IP
    sleep 1
    if [[ "$(pidof pixelserv)" == "" ]]; then
    logger ADBLOCK ERROR: cannot start pixelserv
    
     
  60. srouquette

    srouquette Network Guru Member

    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.
     
  61. dthatcher

    dthatcher Networkin' Nut Member

    @srouquette:

    Thank you so very much! I have an ASUS RT-N16 with TomatoUSB and your script eliminated the need for me to run blacklists/filtering on my individual computers.

    May I suggest an additional list? It is:
    http://hostsfile.org/Downloads/hosts.txt

    I added it as S8 on my end.

    Thanks again!
     
  62. Bender Bending Rodriguez

    Bender Bending Rodriguez Networkin' Nut Member

    Code:
    if [[ "$(pidof pixelserv)" == "" ]]; then $PXL_EXE $PXL_IP; sleep 1 ; else  kill -SIGUSR1 $(pidof pixelserv); fi
    
    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...
     
  63. Mojonba

    Mojonba Network Guru Member

    Is there a way to reload the remote whitelist without rebooting the router? I've been restarting the script via telnet to no avail.
     
  64. srouquette

    srouquette Network Guru Member

    @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).

    Do the test:
    Code:
    kill -SIGUSR1 $(pidof pixelserv)
    pidof pixelserv
    
    It will print the PID.



    @Mojonba:
    /tmp/ADBLOCK.sh --force
     
  65. Bender Bending Rodriguez

    Bender Bending Rodriguez Networkin' Nut Member

    I can assure you that this command kills the pixelserv process.


    Code:
    pidof pixelserv
    would simply print the PID


    Code:
    kill -SIGUSR1 $(pidof pixelserv)
    pidof pixelserv
    Would yield no output. The previous kill command would leave the pidof command with no running pixelserv process ID to print...
     
  66. Mojonba

    Mojonba Network Guru Member

    I reloaded the script fine but now Im getting an error which appears even after a reboot. Here's a copy of the log, I took out what I thought was irrelevant.

    Code:
    Feb 13 09:45:25 unknown daemon.info pixelserv[627]: /tmp/pixelserv V27 compiled: Dec 12 2010 22:57:42 from pixelserv27.c
    Feb 13 09:45:25 unknown daemon.notice pixelserv[630]: Listening on  192.168.101.2:80
    Feb 13 09:45:31 unknown user.notice root: ADBLOCK: http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml
    Feb 13 09:45:33 unknown user.notice root: ADBLOCK: http://mirror1.malwaredomains.com/files/justdomains
    Feb 13 09:45:34 unknown user.notice root: ADBLOCK: http://www.malwaredomainlist.com/hostslist/hosts.txt
    Feb 13 09:45:47 unknown user.notice root: ADBLOCK: http://www.mvps.org/winhelp2002/hosts.txt
    Feb 13 09:45:47 unknown user.notice root: ADBLOCK: whitelist http://users.onelinkpr.net/~jvilla/tomato/whitelist.txt
    Feb 13 09:46:20 unknown user.notice root: ADBLOCK: 29294 entries
    Feb 13 09:46:20 unknown user.notice root: ADBLOCK: sorting hosts...
    Feb 13 09:48:59 unknown user.notice root: ADBLOCK: hosts sorted.
    Feb 13 09:48:59 unknown user.notice root: ADBLOCK: 21594 entries
    Feb 13 09:49:04 unknown daemon.info dnsmasq[100]: exiting on receipt of SIGTERM
    Feb 13 09:49:06 unknown daemon.info dnsmasq[804]: started, version 2.55 cachesize 150
    Feb 13 09:49:06 unknown daemon.info dnsmasq[804]: compile time options: no-IPv6 GNU-getopt no-RTC no-DBus no-I18N DHCP no-scripts no-TFTP
    Feb 13 09:49:06 unknown daemon.info dnsmasq-dhcp[804]: DHCP, IP range 192.168.101.110 -- 192.168.101.149, lease time 1d
    Feb 13 09:49:06 unknown user.notice root: ADBLOCK ERROR: restarting dnsmasq...
    
    Edit: Solved. Script didnot like a domain in the whitelist. Any idead of how can I whitelist "ad.doubleclick.net/adj/imdb2.consumer.video/"?
     
  67. srouquette

    srouquette Network Guru Member

    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.

    edit:
    here is a screenshot.
    http://imgur.com/bGRt5
    And in tomato's log:
    Code:
    Feb 13 15:38:31 unknown daemon.info pixelserv[472]: 3669 requests, 523 errors, 0 bad, 1924 gif, 1222 txt replies
     
  68. Bender Bending Rodriguez

    Bender Bending Rodriguez Networkin' Nut Member

    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.
     
  69. Mojonba

    Mojonba Network Guru Member

    @bender

    Make sure you are using pixelserv.oldT renamed to pixelserv with your vanilla Tomato 1.28. Mine is/was running without issues on vanilla Tomato 1.28 WRT54G v2.0.
     
  70. rhester72

    rhester72 Network Guru Member

    Bear in mind that recent versions of pixelserv changed how signalling works.

    Rodney
     
  71. CyQuesT

    CyQuesT LI Guru Member

    Hello,

    with the ALL-U-NEED Ad Blocking v3.9c my Jdownloader dont work.
     
  72. Toink

    Toink Network Guru Member

    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....
     
  73. CyQuesT

    CyQuesT LI Guru Member

  74. IK12

    IK12 Networkin' Nut Member

    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

    does anyone know why this is? and how do i fix this?
     
  75. srouquette

    srouquette Network Guru Member

    are you sure adblock is working on your router ?
    because when I try to visit http://rd.clickshift.com, adblock blocks it.
     
  76. IK12

    IK12 Networkin' Nut Member

    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):confused:

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

    Attached Files:

    • 1.JPG
      1.JPG
      File size:
      16.9 KB
      Views:
      50
  77. mstombs

    mstombs Network Guru Member

    You are getting the Tomato router httpd not pixelserv - something is wrong with your config - what IP address is pixelserv listening on, what is your router IP?
     
  78. IK12

    IK12 Networkin' Nut Member

    USEPIXELSERV="Y"
    PXL_IP=192.168.129.11
    PXL_EXE="/mmc/pixelserv"
    PXL_URL=""

    is what i have. i have the SD card mod. (with the slodki's version)
    router ip is 192.168.129.10
    nothing is using .11 as far as i a aware

    Edit: I don't know what was wrong, but re-flashing the firmware with a 30-30-30 reset (as described in the dd-wrt forums) fixed the problem
     
  79. Kye-U

    Kye-U Addicted to LI Member

    Great thread and script :)

    I'm running into a problem:

    Code:
    user.notice root: ADBLOCK ERROR: cannot start pixelserv
    When I try to run pixelserv (via Putty), I get this error:
    Code:
    Bus error
    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).
     
  80. lancethepants

    lancethepants Network Guru Member

    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.
     
  81. bkmo

    bkmo LI Guru Member

    If I run /tmp/ADBLOCK.sh from the terminal I get these 2 lines at the beginning of the output:

    [: ==: binary operator expected
    [: ==: binary operator expected

    the number of these errors correspond to the number of "GETS" , I have 2 lists selected

    I am also left with a /tmp/tmpe file which is the http://www.mvps.org/winhelp2002/ list

    Adblock is blocking, but I am curious if one of the lists or something is not working.

    Thanks
     
  82. srouquette

    srouquette Network Guru Member

    did you edit something ?
    can you paste here what you edited ?
     
  83. bkmo

    bkmo LI Guru Member

    I will copy/paste from your first post again and see if it was something I did. I will report back.
     
  84. bkmo

    bkmo LI Guru Member

    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?
     
  85. bkmo

    bkmo LI Guru Member

    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
     
  86. Magister

    Magister Networkin' Nut Member

    Thanks guy, works perfectly on my WRT-160N v3 running TomatoUSB v1.28.9054 MIPSR2-beta K26 vpn3.6

    I enabled 6 lists (I have 32MB of RAM) and also pixelserv on a local http server.

    20:05:47 [...] 125526 entries
    [sorting]
    20:09:58 [...] 64327 entries

    It worked first try:):biggrin::wink:
     
  87. Magister

    Magister Networkin' Nut Member

    Can I pre-optimize some lists using a script like this (on another machine)

    #!/bin/sh
    GEN=$1
    TMP="/tmp/blablabla"
    awk -F '.' 'BEGIN{ORS=""}{for(i=NF;i>0;i--)print $i"#";print "\n"}' $GEN|sort|
    awk -F '#' 'BEGIN{ORS="";d = "%"}{if(index($0,d)!=1){d=$0;print $--NF;
    for(i=--NF;i>0;i--)print "."$i;print "\n"}}' > $TMP
    mv $TMP $GEN

    I tried but it gives me:
    awk: (FILENAME=- FNR=1) fatal: NF set to negative value
    :confused:

    EDIT: it worked, I forgot the TRIM... I found lists to block pr0n and stuff like this, mainly to protect kids here :)
    Thanks again for this great script, and to TomatoUSB :)
     
  88. veekay8

    veekay8 Addicted to LI Member

    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?
     
  89. srouquette

    srouquette Network Guru Member

    I run this script on Ubuntu then upload the list on a website, and download it on the router (by setting only one address like you said), so yes, it's possible.
     
  90. randyoo

    randyoo Addicted to LI Member

    Kernel "Oops", and suggestion:

    I just wanted to share my experience, and make a suggestion:

    Running this script on my WRT54GL was giving me a kernel "oops" at the very end of the script, and causing my router to reboot. Log:

    Code:
    Apr  7 00:05:36 ROUTER user.notice root: ADBLOCK: hosts sorted.
    Apr  7 00:05:36 ROUTER user.notice root: ADBLOCK: 21361 entries
    Apr  7 00:05:38 ROUTER daemon.info dnsmasq[144]: exiting on receipt of SIGTERM
    Apr  7 00:05:39 ROUTER user.alert kernel: Data bus error, epc == 8004518c, ra == 800452e4
    Apr  7 00:05:39 ROUTER user.warn kernel: Oops in traps.c::do_be, line 398:
    Apr  7 00:05:39 ROUTER user.warn kernel: $0 : 00000000 10009c00 00000000 afb1001c 80c0e000 00000001 80147d88 80d85ee0
    Apr  7 00:05:39 ROUTER user.warn kernel: $8 : 00000000 00000004 00000400 ffffffe0 809f2c5c fffffff7 0000000a ffffffff
    Apr  7 00:05:39 ROUTER user.warn kernel: $16: 80d85ee0 80d85ee0 00000001 00000000 80d85ee0 00000000 0000000e 00000004
    Apr  7 00:05:39 ROUTER user.warn kernel: $24: 00000018 2aae6350                   80d84000 80d85e58 00000000 800452e4
    Apr  7 00:05:39 ROUTER user.warn kernel: Hi : 00000000
    Apr  7 00:05:39 ROUTER user.warn kernel: Lo : 00000000
    
    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?

    Thanks @srouquette for the work you've done and shared.
     
  91. srouquette

    srouquette Network Guru Member

    it makes sense. did you try it on your router ?
     
  92. randyoo

    randyoo Addicted to LI Member

    nice

    At the time I suggested that, I hadn't. I found the base-64 encoded portion intimidating... silly me! :)

    I've just tried on my router, and confirmed that it works. Here's the relevant portion of the code (there are 4 places where I added the 'nice' command):

    Code:
    OPT() {
    if [[ "$OPTIMISE" == "Y" ]]; then
    logger ADBLOCK: sorting hosts...
    if [[ "$USEHOSTS" == "Y" ]]; then
    nice -n 19 sort -u -o $TMP $GEN
    else
    nice -n 19 awk -F '.' 'BEGIN{ORS=""}{for(i=NF;i>0;i--)print $i"#";print "\n"}' $GEN|nice -n 19 sort|
    nice -n 19 awk -F '#' 'BEGIN{ORS="";d = "%"}{if(index($0,d)!=1){d=$0;print $--NF;
    for(i=--NF;i>0;i--)print "."$i;print "\n"}}' > $TMP
    fi
    logger ADBLOCK: hosts sorted.
    fi
    mv -f $TMP $GEN
    }
     
  93. randyoo

    randyoo Addicted to LI Member

    bug?

    I noticed that pixelserv is alternately running and dying with each launch of the script.

    This code doesn't make any sense to me:
    Code:
    if [[ "$(pidof pixelserv)" == "" ]]; then $PXL_EXE $PXL_IP; sleep 1 ; else  kill -SIGUSR1 $(pidof pixelserv); fi
    if [[ "$(pidof pixelserv)" == "" ]]; then
    logger ADBLOCK ERROR: cannot start pixelserv
    
    In English: If pixelserv isn't running, then run it. Otherwise, if it is running, kill it. Now, if pixelserv isn't running, give up and log an error.

    I did this:
    Code:
    if [[ "$(pidof pixelserv)" == "" ]]; then $PXL_EXE $PXL_IP; sleep 1; else  kill -SIGUSR1 $(pidof pixelserv);$PXL_EXE $PXL_IP; sleep 1; fi
    if [[ "$(pidof pixelserv)" == "" ]]; then
    logger ADBLOCK ERROR: cannot start pixelserv
    
    (If pixelserv isn't running, launch it. If it is running, kill it and re-launch. If it still isn't running, log an error.)

    Now it seems to work as expected, but I still can't understand why there would be an "else" condition in the above code, period.
     
  94. srouquette

    srouquette Network Guru Member

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

    I updated the original script, thank you :)
     
  95. randyoo

    randyoo Addicted to LI Member

    Dunno...

    -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:

    Thanks again for sharing the script.
     
  96. AtTheAsylum

    AtTheAsylum LI Guru Member

    Hi all,

    First up, using Tomato 1.28, Ad Blocking 4.0 and Pixelserv v27.

    I'm having issues setting up pixelserv. I Keep getting the message "daemon.err pixelserv[808]: Abort: Address already in use".

    Fiddled around a bit and the only way I could get it to work was to change the following:

    Code:
    ifconfig br0:0 $PXL_IP
    if [[ "$(pidof pixelserv)" == "" ]]; then $PXL_EXE $PXL_IP; sleep 1 ; else  kill -SIGUSR1 $(pidof pixelserv); fi
    if [[ "$(pidof pixelserv)" == "" ]]; then
    logger ADBLOCK ERROR: cannot start pixelserv
    else
    eval "NIP=$PXL_IP"
    fi
    To:

    Code:
    ifconfig br0:0 $PXL_IP
    if [[ "$(pidof pixelserv)" == "" ]]; then $PXL_EXE $PXL_IP -n br0; sleep 1 ; else  kill -SIGUSR1 $(pidof pixelserv); fi
    if [[ "$(pidof pixelserv)" == "" ]]; then
    logger ADBLOCK ERROR: cannot start pixelserv
    else
    eval "NIP=$PXL_IP"
    fi
    That is, I had to specify the interface when starting pixelserv.

    Any ideas on why I need to do this?

    Thanks :)
     
  97. srouquette

    srouquette Network Guru Member

    no ideas :)
    we'll have to wait for a reply from mstombs.
     
  98. Magister

    Magister Networkin' Nut Member

    AFAIK in the original Tomato, port 80 was binded to all interfaces by default, so pixelserv was not able to bind it.

    In TomatoUSB (and variant) it was corrected to be binded only on the interface you want (LAN and/or WAN).
     
  99. TucknDar

    TucknDar LI Guru Member

    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.
     
  100. randyoo

    randyoo Addicted to LI Member

    nice: not found

    It looks like the Viktek build is missing the "nice" command. Or maybe it just isn't in the PATH shell variable?

    I'm running "Tomato Firmware v1.28.7619 -Toastman-USB ND Std", and don't have that issue.

    Can you SSH into the router and run "ls /bin" (without the quotation marks, of course), and see if "nice" is listed there?
     

Share This Page