Ad-blocking on DD-WRT

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... 14, 15, 16, 17  Next
Author Message
Yamaraj
DD-WRT User


Joined: 25 Jan 2017
Posts: 95

PostPosted: Fri Jul 27, 2018 6:10    Post subject: Reply with quote
ROLLING UPDATE: 20180727a1 LATEST
1. Fixed domains ending with punctuation marks.
2. Code cleanup.

ROLLING UPDATE: 20180726a1
1. OFFLINE mode should be fixed.
2. No segfault on DD-WRT v3.0-r36400M kongac (BusyBox v1.29.1) anymore. If it still segfaults on your router, see my last post and replace sort with awk.


How to update if you are on 20180315 or later:
SSH into router
cd /jffs/dnsmasq
./adbhostgen.sh -u

If you are still using an older version, download https://raw.githubusercontent.com/m-parashar/adbhostgen/master/adbhostgen.sh into /jffs/dnsmasq and chmod +x it before running.

File bug reports, dead links, format errors.

_________________

Router
Netgear R8500: DD-WRT v3.0-r36840M kongac (09/03/18) / SFE: quarkysg - r34080-linux-4.4.105

Scripts
Ad-blocking on DD-WRT -- Github
Sponsor
Darias
DD-WRT Novice


Joined: 17 Sep 2016
Posts: 3

PostPosted: Fri Jul 27, 2018 8:41    Post subject: Reply with quote
before run: awk -v "IP=$ADHOLEIP" '{sub(/\r$/,""); print IP" "$0}'
we would add : FNSED |
set FNSED:
Code:
alias FNSED="sed -r 's|:.*$||; s|[[:blank:]]||; s|^[^.]+$||; s|\.$||; s|\.co.*ies$|.com|; s|\.com.*orn$|.com|; s|.*tporn$||; s|.*html$||'"

To fix invalid domain
--------------------------------------------------------------
Remove Duplicate Lines with "sort | uniq" not good: I'm using this regex to find duplicate lines : ^(.*?)$\s+?^(?=.*^\1$)
--------------------------------------------------------------
Using current folder to run scripts.
Code:
export MPDIR="$(cd "$(dirname "${0}")" && pwd)"
export TMPDIR="${MPDIR}/tmp"
if [ -d "$T4m" ]
then
   rm -rf ${MPDIR};echo "Creating: $MPDIR";mkdir ${MPDIR};
else
   echo "Creating: $MPDIR";mkdir ${MPDIR};
fi

TMPFILE="/tmp/mpupdate" => TMPFILE="${TMPDIR}/mpupdate"
Replace
Code:
rm -f $tmphosts
rm -f $tmpdomains
rm -f tmpbl
rm -f tmpwl
with
Code:
rm -rf ${TMPDIR};

--------------------------------------------------------------
I rewrited your scripts
https://adzhosts.hizo.fr/hosts/adzhosts-android.txt isn't working now
it change to https://adzhosts.eu/hosts/adzhosts-android.txt



dl.sh.txt
 Description:
ReBuild by Darias

Download
 Filename:  dl.sh.txt
 Filesize:  10.26 KB
 Downloaded:  281 Time(s)

mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1404
Location: Canada

PostPosted: Wed Aug 01, 2018 14:58    Post subject: Reply with quote
Yamaraj wrote:
ROLLING UPDATE: 20180727a1 LATEST
1. Fixed domains ending with punctuation marks.
2. Code cleanup.

ROLLING UPDATE: 20180726a1
1. OFFLINE mode should be fixed.
2. No segfault on DD-WRT v3.0-r36400M kongac (BusyBox v1.29.1) anymore. If it still segfaults on your router, see my last post and replace sort with awk.


How to update if you are on 20180315 or later:
SSH into router
cd /jffs/dnsmasq
./adbhostgen.sh -u

If you are still using an older version, download https://raw.githubusercontent.com/m-parashar/adbhostgen/master/adbhostgen.sh into /jffs/dnsmasq and chmod +x it before running.

File bug reports, dead links, format errors.


I updated to 36410M and had to update adbhostgen and all is good. Thanks for all your work!

_________________
Home Network on Telus PureFibre - Wired GigaBit Backbone
2x R7800 - Gateway WiFi 3xVPN - KONGAT 39855M
E3000 - Gateway Wired IPTV - DDWRT r35531 Mega
WHR-HP-G54 - Internal Routing - DDWRT r35531 std-special

______________________
Off Site 1

R7000 - Gateway & WiFi & VPN - KONGAC 39855M
WRT610Nv1 - Repeater Bridge - DDWRT r33679 Mega K2.4

__________________________
Off Site 2

R7000 - Gateway & WiFi - KONGAC 39855M
4x E3000 - Gateway & 3xWDS Wired IPTV - DDWRT r35531 Mega
E2000 - IPTV PVR Blocker - DDWRT r35531 Mega

__________________
YAMon 3.4 | Ad-Blocking for DD-WRT | DNSCrypt-Proxy V2
Manuvaidya
DD-WRT Novice


Joined: 02 Sep 2018
Posts: 1

PostPosted: Sun Sep 02, 2018 21:27    Post subject: Reply with quote
Hi Yamaraj, i have installed your script successfully on R7000 with Kongs latest Testbuild.
But i am still seeing YOutube Ads and i dont know how to add more Black lists or how to block the Youtube ads.
Can you guide me pls ? i am not only seeing the Youtube ads but also the Popups during the Video Playback. its very irritating, i had not seen such things when i used ublock in browser. but with your script i cant efficiently block the Youtube ads.

Am i missing something ?
lumanga
DD-WRT Novice


Joined: 26 Aug 2018
Posts: 7

PostPosted: Mon Sep 03, 2018 13:35    Post subject: Reply with quote
Hi All,
3 questions regarding this AD-Block installation:

1) I'm using the r36079. Is it completely working the latest version of this script with my release?

2) On TP-LINK WR1043 and r36079, is enouth the "power" of the hardware to manage MAX. two tablet connected?

3) Can I use the USB pen drive a s/jffs/ partitions?
Thanks in advance!
Yamaraj
DD-WRT User


Joined: 25 Jan 2017
Posts: 95

PostPosted: Thu Sep 06, 2018 15:31    Post subject: Reply with quote
Darias wrote:
before run: awk -v "IP=$ADHOLEIP" '{sub(/\r$/,""); print IP" "$0}'
we would add : FNSED |
set FNSED:
Code:
alias FNSED="sed -r 's|:.*$||; s|[[:blank:]]||; s|^[^.]+$||; s|\.$||; s|\.co.*ies$|.com|; s|\.com.*orn$|.com|; s|.*tporn$||; s|.*html$||'"

To fix invalid domain
--------------------------------------------------------------
Remove Duplicate Lines with "sort | uniq" not good: I'm using this regex to find duplicate lines : ^(.*?)$\s+?^(?=.*^\1$)
--------------------------------------------------------------
Using current folder to run scripts.
Code:
export MPDIR="$(cd "$(dirname "${0}")" && pwd)"
export TMPDIR="${MPDIR}/tmp"
if [ -d "$T4m" ]
then
   rm -rf ${MPDIR};echo "Creating: $MPDIR";mkdir ${MPDIR};
else
   echo "Creating: $MPDIR";mkdir ${MPDIR};
fi

TMPFILE="/tmp/mpupdate" => TMPFILE="${TMPDIR}/mpupdate"
Replace
Code:
rm -f $tmphosts
rm -f $tmpdomains
rm -f tmpbl
rm -f tmpwl
with
Code:
rm -rf ${TMPDIR};

--------------------------------------------------------------
I rewrited your scripts
https://adzhosts.hizo.fr/hosts/adzhosts-android.txt isn't working now
it change to https://adzhosts.eu/hosts/adzhosts-android.txt


Last update incorporated improved parsing and filtering. I'll look at your suggestions and make changes if necessary. Thank you!

_________________

Router
Netgear R8500: DD-WRT v3.0-r36840M kongac (09/03/18) / SFE: quarkysg - r34080-linux-4.4.105

Scripts
Ad-blocking on DD-WRT -- Github
Yamaraj
DD-WRT User


Joined: 25 Jan 2017
Posts: 95

PostPosted: Thu Sep 06, 2018 15:44    Post subject: Reply with quote
lumanga wrote:
Hi All,
3 questions regarding this AD-Block installation:

1) I'm using the r36079. Is it completely working the latest version of this script with my release?

2) On TP-LINK WR1043 and r36079, is enouth the "power" of the hardware to manage MAX. two tablet connected?

3) Can I use the USB pen drive a s/jffs/ partitions?
Thanks in advance!


1. The only version that did not play nice with the script was 36325M. It should work, give it a try.

2. Since the script downloads and processes megabytes of lists, I recommend a fast enough router with at least 128MB RAM.

Here's a screenshot of R8500 running the latest Kong build and this script with VPN and other services.



3. Yes, absolutely. I use a mini pendrive for /jffs myself.

_________________

Router
Netgear R8500: DD-WRT v3.0-r36840M kongac (09/03/18) / SFE: quarkysg - r34080-linux-4.4.105

Scripts
Ad-blocking on DD-WRT -- Github
Yamaraj
DD-WRT User


Joined: 25 Jan 2017
Posts: 95

PostPosted: Thu Sep 06, 2018 15:56    Post subject: Reply with quote
Manuvaidya wrote:
Hi Yamaraj, i have installed your script successfully on R7000 with Kongs latest Testbuild.
But i am still seeing YOutube Ads and i dont know how to add more Black lists or how to block the Youtube ads.
Can you guide me pls ? i am not only seeing the Youtube ads but also the Popups during the Video Playback. its very irritating, i had not seen such things when i used ublock in browser. but with your script i cant efficiently block the Youtube ads.

Am i missing something ?

Since this script blocks ads at domain level, services that stream ads from the same servers as their media cannot be blocked effectively. Case in point: YouTube. You might also need a canvas/JS level ad blocker like uBlock Origin to tackle /some/ ads that work their way around domain level blockers.

This script still blocks about 98% of ads on my systems, including ads in apps and games, which is enough considering not all browsers or mobile devices support ad blockers.

_________________

Router
Netgear R8500: DD-WRT v3.0-r36840M kongac (09/03/18) / SFE: quarkysg - r34080-linux-4.4.105

Scripts
Ad-blocking on DD-WRT -- Github
nihilt_
DD-WRT Novice


Joined: 25 Jun 2017
Posts: 6

PostPosted: Wed Sep 12, 2018 22:36    Post subject: Reply with quote
Great work @Yamaraj.

I'm having issues with HBO GO, I tried whitelisting domains using DNSthingy without success, including additional domains to mywhitelist from here https://github.com/EFForg/privacybadger/issues/2026

Kong's build r36840M BLITZ=1

d3hz53nx0dymf8.cloudfront.net
dev.visualwebsiteoptimizer.com
assets.adobedtm.com
individualization.adobe.com
fls.doubleclick.net
8032352.fls.doubleclick.net
8019195.fls.doubleclick.net
6356875.fls.doubleclick.net
globalapi.hbogola.com
connect.facebook.net
hbolag.d2.sc.omtrdc.net
www.facebook.com
www.gstatic.com
brapi.hbogola.com
l3edvimpbbp03.secure.footprint.net
platform.twitter.com
syndication.twitter.com
adservice.google.com
staticxx.facebook.com
tve.hbopaseo.com
livepassdl.conviva.com
push.hbopaseo.com
gwd.lphbs.com
ajax.googleapis.com
redirector.gvt1.com
tags.bkrtx.com
stags.bluekai.com
tags.bluekai.com
hbolag.hb.omtrdc.net
l3edvpsbbp04.secure.footprint.net
analytics.twitter.com
lic.drmtoday.com
hbo.tt.omtrdc.net
cdn.krxd.net
br.hbogola.com
Moose
DD-WRT Novice


Joined: 03 May 2008
Posts: 4

PostPosted: Sun Sep 16, 2018 18:54    Post subject: Ad-blocking on DD-WRT Reply with quote
@Yamaraj,
Thank you for all your hard work on Ad-blocking on DD-WRT. I was hoping you could help me out with my issue of trying to get this installed on my router. I have a NETGEAR Nighthawk X10 AD7200 router with Kong DD-WRT v3.0-r36020M std (05/25/1Cool installed on it. I have a 2 GB USB Drive connected to this router formatted and partitioned in Linux like you mentioned; /jffs (1-2GB), swap (256-512MB), and optionally /opt (1-2GB). I used a windows program to do this formatting because I am running Windows 10 on my laptop. My question is to you is how do I transfer and install the files below from a windows system to this Linux USB drive like you state below in the forum.
1b. Download and extract adbhostgen.7z or adbhostgen.tar.gz into /jffs/dnsmasq directory.

2. Run "./adbhostgen.sh" in /jffs/dnsmasq without quotes.

3. Use --update or -u command line option to update to the latest version. [only available since 20180315]

I am not knowledgeable in Linux so I’m not sure how to accomplish these commands in a windows command I hope you will be able to help me out when you get a chance.

Thank you
mꝎse
Yamaraj
DD-WRT User


Joined: 25 Jan 2017
Posts: 95

PostPosted: Mon Sep 17, 2018 5:10    Post subject: Re: Ad-blocking on DD-WRT Reply with quote
Moose wrote:
@Yamaraj,
Thank you for all your hard work on Ad-blocking on DD-WRT. I was hoping you could help me out with my issue of trying to get this installed on my router. I have a NETGEAR Nighthawk X10 AD7200 router with Kong DD-WRT v3.0-r36020M std (05/25/18) installed on it. I have a 2 GB USB Drive connected to this router formatted and partitioned in Linux like you mentioned; /jffs (1-2GB), swap (256-512MB), and optionally /opt (1-2GB). I used a windows program to do this formatting because I am running Windows 10 on my laptop. My question is to you is how do I transfer and install the files below from a windows system to this Linux USB drive like you state below in the forum.
1b. Download and extract adbhostgen.7z or adbhostgen.tar.gz into /jffs/dnsmasq directory.

2. Run "./adbhostgen.sh" in /jffs/dnsmasq without quotes.

3. Use --update or -u command line option to update to the latest version. [only available since 20180315]

I am not knowledgeable in Linux so I’m not sure how to accomplish these commands in a windows command I hope you will be able to help me out when you get a chance.

Thank you
mꝎse


You'll need PuTTY or MobaXTerm if you are using Windows, to access your router via SSH. Once you are in:

1. Create directory /jffs/dnsmasq by typing "mkdir /jffs/dnsmasq" without quotes in terminal.
2. Change to /jffs/dnsmasq: cd /jffs/dnsmasq
3. Type this and hit ENTER:
Code:
curl -f -s -k https://raw.githubusercontent.com/m-parashar/adbhostgen/master/adbhostgen.sh > adbhostgen.sh
chmod +x adbhostgen.sh

It should download and save the script in /jffs/dnsmasq
4. Run the script by typing "./adbhostgen.sh" in terminal, without the quotes. Make sure you are in /jffs/dnsmasq directory.

If everything goes well, you'll have all the required files autogenerated in the directory for the script to work. Follow the rest of the instructions.

_________________

Router
Netgear R8500: DD-WRT v3.0-r36840M kongac (09/03/18) / SFE: quarkysg - r34080-linux-4.4.105

Scripts
Ad-blocking on DD-WRT -- Github
Wickiman
DD-WRT Novice


Joined: 11 Jun 2015
Posts: 31
Location: Germany/Mexico/China

PostPosted: Mon Sep 17, 2018 12:31    Post subject: Re: Ad-blocking on DD-WRT Reply with quote
Moose wrote:
@Yamaraj,
Thank you for all your hard work on Ad-blocking on DD-WRT. I was hoping you could help me out with my issue of trying to get this installed on my router. I have a NETGEAR Nighthawk X10 AD7200 router with Kong DD-WRT v3.0-r36020M std (05/25/1Cool installed on it. I have a 2 GB USB Drive connected to this router formatted and partitioned in Linux like you mentioned; /jffs (1-2GB), swap (256-512MB), and optionally /opt (1-2GB). I used a windows program to do this formatting because I am running Windows 10 on my laptop. My question is to you is how do I transfer and install the files below from a windows system to this Linux USB drive like you state below in the forum.
1b. Download and extract adbhostgen.7z or adbhostgen.tar.gz into /jffs/dnsmasq directory.

2. Run "./adbhostgen.sh" in /jffs/dnsmasq without quotes.

3. Use --update or -u command line option to update to the latest version. [only available since 20180315]

I am not knowledgeable in Linux so I’m not sure how to accomplish these commands in a windows command I hope you will be able to help me out when you get a chance.

Thank you
mꝎse


Hello Moose,

since you haven't had much contact with Linux I suggest you might use WinSCP to access your router and transfer the downloaded adbhostgen.sh.
It is simular to a FTP program or explorer.

www.winscp.net

Later you need putty to run the script.

Wickiman

_________________
Netgear AC1900/R7000 DD-WRT v3.0-r37015M (09/23/18 ) kongac
Moose
DD-WRT Novice


Joined: 03 May 2008
Posts: 4

PostPosted: Mon Sep 17, 2018 13:24    Post subject: Ad-blocking on DD-WRT Reply with quote
Thank you Yamaraj and Wickiman. I have used PuTTY and WinSCP in the past I just wasn't sure how to find the USB Drive connected to my router with it being formatted in Linux. I wasn't sure of the path. When I used the jffs folder directly on the memory in the router I didn't have a problem just couldn't find it when it was connected by USB. Does it matter if the USB Drive is formatted in Linux, NTFS or Fat32? Mine is right now in Linux but would change it if one of the others would be better. Thanks for all the help as soon as I get home from work I will give it a shot.

mOOse
Wickiman
DD-WRT Novice


Joined: 11 Jun 2015
Posts: 31
Location: Germany/Mexico/China

PostPosted: Tue Sep 18, 2018 3:09    Post subject: Reply with quote
Hello Moose,

I suggest you read the first post of Yamaraj and follow the link how to format and partition the USB stick.

The UUID you get after the USB is mounted must be filled into the jffs and opt field.

Wickiman

_________________
Netgear AC1900/R7000 DD-WRT v3.0-r37015M (09/23/18 ) kongac
Moose
DD-WRT Novice


Joined: 03 May 2008
Posts: 4

PostPosted: Tue Sep 18, 2018 21:43    Post subject: Reply with quote
Wickiman wrote:
Hello Moose,

I suggest you read the first post of Yamaraj and follow the link how to format and partition the USB stick.

The UUID you get after the USB is mounted must be filled into the jffs and opt field.

Wickiman


Wickiman,

I had everything set up exactly like the first post and I also had my USB Drive formatted exactly like the first post except it was formatted in ext3 and not ext2. I formatted it in ext2 and everything worked as advertised. Thank you Wickiman and Yamaraj for bearing with me and getting this to work.

mOOse
Goto page Previous  1, 2, 3 ... 14, 15, 16, 17  Next Display posts from previous:    Page 15 of 17
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum