Difference between revisions of "Ad-blocking"

From Amahi Wiki
Jump to: navigation, search
Line 11: Line 11:
 
<!--Please remove or place comment accordingly-->
 
<!--Please remove or place comment accordingly-->
 
<!--Your text bellow this line-->
 
<!--Your text bellow this line-->
 +
<b><i>This section will document how to run your HDA as a network wide ad-blocking tool, utilising DNS redirects and a small pixel server.<br /></i></b>
  
Outline for using the HDA as a network-wide ad-blocking tool:
 
  
This is a work in progress and currently only shows the very basic step-by step to doing this.
 
  
  
 
= Fedora 19 =
 
= Fedora 19 =
  
Create a new virtual interface with new IP *issues with Fedora 19 keeping it's config*
+
Precusors - You'll need net-tools installed to use ifconfig
 +
yum install net-tools
  
Bind Apache to the original IP /etc/httpd/conf/
+
==Get Ad List==
  
Download Pixelserv and modify to use the new virtual IP
+
==Change DNSMasq config==
  
Setup Pixelserv to load at boot as a service
+
==Bind Apache to main IP address==
 +
 
 +
==Pixel Server==
 +
* You need to download Pixelserv to the HDA:
 +
wget <nowiki>http://proxytunnel.sourceforge.net/files/pixelserv.pl.txt</nowiki>
 +
 
 +
* Move and rename the Pixelserv binary:
 +
mv pixelserv.pl.txt /usr/local/bin/pixelserv
 +
 
 +
* Edit pixelserv using a file editing program of your choice
 +
nano pixelserv
 +
 
 +
* Change the IP address to a free one of your choice (eg. 192.168.1.99)
 +
$sock = new IO::Socket::INET (  LocalHost => '0.0.0.0',
 +
change to
 +
$sock = new IO::Socket::INET (  LocalHost => '192.168.1.99',
 +
 
 +
* Change permissions
 +
chmod 755 /usr/local/pixelserv
 +
 +
* Create file /etc/init.d/pixelserv
 +
nano /etc/init.d/pixelserv
 +
and copy the following to it:
 +
<br /><b>Note: Change the IP addresses, and you will need net-tools installed on the system as a precursor</b>
 +
#! /bin/sh
 +
# /etc/init.d/pixelserv
 +
#
 +
 +
# Carry out specific functions when asked to by the system
 +
case "$1" in
 +
    start)
 +
      echo "Creating Interface "
 +
      ifconfig p2p1:0 192.168.1.99
 +
      echo "Starting pixelserv "
 +
      /usr/local/bin/pixelserv &
 +
      ;;
 +
    stop)
 +
      echo "Stopping script pixelserv"
 +
      pkill -9 pixelserv &
 +
      echo "Killing Interface "
 +
      ifconfig p2p1:0 down
 +
      ;;
 +
    *)
 +
      echo "Usage: /etc/init.d/pixelserv {start|stop}"
 +
      exit 1
 +
      ;;
 +
esac
 +
exit 0
  
Create script to download an advert block-list
 
  
Create DNSMasq config that redirects ad-list hosts to Pixelserv IP address
 
  
 
Enjoy ad-free network on ALL devices!
 
Enjoy ad-free network on ALL devices!
 +
  
  

Revision as of 17:05, 24 June 2015


Msgbox-WOPr.png Work In Progress
This article is currently undergoing major expansion or restructuring. You are welcome to assist by editing it as well. If this article has not been edited in several days, please remove this template.


This section will document how to run your HDA as a network wide ad-blocking tool, utilising DNS redirects and a small pixel server.



Fedora 19

Precusors - You'll need net-tools installed to use ifconfig

yum install net-tools

Get Ad List

Change DNSMasq config

Bind Apache to main IP address

Pixel Server

  • You need to download Pixelserv to the HDA:
wget http://proxytunnel.sourceforge.net/files/pixelserv.pl.txt 
  • Move and rename the Pixelserv binary:
mv pixelserv.pl.txt /usr/local/bin/pixelserv
  • Edit pixelserv using a file editing program of your choice
nano pixelserv
  • Change the IP address to a free one of your choice (eg. 192.168.1.99)
$sock = new IO::Socket::INET (  LocalHost => '0.0.0.0',

change to

$sock = new IO::Socket::INET (  LocalHost => '192.168.1.99',
  • Change permissions
chmod 755 /usr/local/pixelserv 

  • Create file /etc/init.d/pixelserv
nano /etc/init.d/pixelserv

and copy the following to it:
Note: Change the IP addresses, and you will need net-tools installed on the system as a precursor

#! /bin/sh
# /etc/init.d/pixelserv
#

# Carry out specific functions when asked to by the system
case "$1" in
   start)
     echo "Creating Interface "
     ifconfig p2p1:0 192.168.1.99
     echo "Starting pixelserv "
     /usr/local/bin/pixelserv &
     ;;
   stop)
     echo "Stopping script pixelserv"
     pkill -9 pixelserv &
     echo "Killing Interface "
     ifconfig p2p1:0 down
     ;;
   *)
     echo "Usage: /etc/init.d/pixelserv {start|stop}"
     exit 1
     ;;
esac
exit 0


Enjoy ad-free network on ALL devices!