![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Outdated Tutorials & Tips Outdated Tutorials & Tips |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
5 Cups of Ubuntu
![]() |
PeerGuardian is a free and open source IP address blocking software programs capable of blocking incoming and outgoing addresses. The application uses a blocklist of IP addresses to filter the computers of several organisations, including the RIAA and MPAA while using filesharing networks such as FastTrack and BitTorrent. The system is also capable of blocking advertising, spyware, government and educational ranges, depending upon user preferences.
More at WikiPedia. PeerGuardian is not a firewall. It filters your incoming/outgoing connections. It is usefull when on P2P networks because it blocks the RIAA, MPAA and other evile empires from seeing you. This helps because they can not collect evidence against you and will help in filtering the bogus seeded files they litter the P2P networks with. Okey, lets get started. Download and install PeerGuardian. There is a .DEB package and source code posted on their SoureForge site. This HOWTO will use the DEB. http://sourceforge.net/project/showf...kage_id=148849 Code:
sudo dpkg -i peerguardnf-1.5beta.i386.deb Code:
sudo mkdir /etc/peerguardian Code:
sudo cp peerguardian.sh /usr/local/bin
Code:
sudo chmod -c 755 /usr/local/bin/peerguardian.sh Code:
sudo gedit /usr/local/bin/peerguardian.sh Code:
# version for bluetack.co.uk lists! #!/bin/sh # Update new blocklists and start/stop/restart PeerGuardian # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # testdescription # #CONFIGURATION # Make sure PG_ETC points to the directory where # you want to put your downloaded blocklists. PG_ETC=/etc/peerguardian/ # Remove the lists you don't want to download and # use from BLOCKLISTS. BLOCKLISTS="level1" PG_CONF=/etc/PG.conf PG_LOG=/var/log/PG.log PG_LIST=/etc/p2p.p2b.p2p #The URL where the blocklists reside URL=http://www.bluetack.co.uk/config #The format of the lists to download SUFFIX=gz #The format after unpacking SUFFIX2=txt endscript () { date +"------------ "%F" "%X" "%Z" End PeerGuardian Script" exit $1 } date +"------------ "%F" "%X" "%Z" Begin PeerGuardian $1" case "$1" in 'start') cd "$PG_ETC" # check if blockfiles were updated: UPDATED="" for i in $BLOCKLISTS ; do TIMESTAMP=0 if [ -e $i.$SUFFIX ] ; then TIMESTAMP=`stat --format=%y $i.$SUFFIX` echo "File $i.$SUFFIX last updated $TIMESTAMP" TIMESTAMP=`stat --format=%Y $i.$SUFFIX` fi wget -N $URL/$i.$SUFFIX if [ `stat --format=%Y $i.$SUFFIX` -gt $TIMESTAMP ] ; then UPDATED=$i fi done # if none of the blockfiles were updated: if [ -z $UPDATED ] ; then echo "No blocklists needed updating." echo "Starting PeerGuardian" mv $PG_LOG $PG_LOG.backup peerguardnf -h -m -d -c "$PG_CONF" -l "$PG_LOG" endscript 0 fi # if any blockfiles were updated: for i in $BLOCKLISTS ; do gunzip -c $i.$SUFFIX > $i.$SUFFIX2 BLOCKLISTSCAT="$BLOCKLISTSCAT $i.$SUFFIX2" done cat $BLOCKLISTSCAT | peerguardnf -f merged.p2b.p2p for i in $BLOCKLISTS ; do rm $i.$SUFFIX2 done # uncomment below to unblock Yahoo! Mail and whatever # else needs unblocking here. Do this also in the # restart section. grep -v -i "yahoo\!" merged.p2b.p2p | grep -v -i "Microsoft" | grep -v "Google" > merged.p2b.p2p.tmp mv merged.p2b.p2p.tmp merged.p2b.p2p mv $PG_LIST $PG_LIST.backup mv merged.p2b.p2p $PG_LIST mv $PG_LOG $PG_LOG.backup echo "Starting PeerGuardian" peerguardnf -h -m -d -c "$PG_CONF" -l "$PG_LOG" endscript 0 ;; 'stop') echo "Stopping PeerGuardian" killall peerguardnf > /dev/null 2>&1 endscript 0 ;; 'restart') cd "$PG_ETC" # check if blockfiles were updated: UPDATED="" for i in $BLOCKLISTS ; do TIMESTAMP=0 if [ -e $i.$SUFFIX ] ; then TIMESTAMP=`stat --format=%y $i.$SUFFIX` echo "File $i.$SUFFIX last updated $TIMESTAMP" TIMESTAMP=`stat --format=%Y $i.$SUFFIX` fi wget -N $URL/$i.$SUFFIX if [ `stat --format=%Y $i.$SUFFIX` -gt $TIMESTAMP ] ; then UPDATED=$i fi done # if none of the blockfiles were updated: if [ -z $UPDATED ] ; then echo "No blocklists needed updating." echo "Stopping PeerGuardian" killall peerguardnf > /dev/null 2>&1 mv $PG_LOG $PG_LOG.backup sleep 4 echo "Starting PeerGuardian" peerguardnf -h -m -d -c "$PG_CONF" -l "$PG_LOG" endscript 0 fi # if any blockfiles were updated: for i in $BLOCKLISTS ; do gunzip -c $i.$SUFFIX > $i.$SUFFIX2 BLOCKLISTSCAT="$BLOCKLISTSCAT $i.$SUFFIX2" done cat $BLOCKLISTSCAT | peerguardnf -f merged.p2b.p2p for i in $BLOCKLISTS ; do rm $i.$SUFFIX2 done # uncomment below to unblock Yahoo! Mail and whatever # else needs unblocking here. Do this also in the # restart section. grep -v -i "yahoo\!" merged.p2b.p2p | grep -v -i "Microsoft" | grep -v "Google" > merged.p2b.p2p.tmp mv merged.p2b.p2p.tmp merged.p2b.p2p echo "Stopping PeerGuardian" killall peerguardnf > /dev/null 2>&1 mv $PG_LIST $PG_LIST.backup mv merged.p2b.p2p $PG_LIST mv $PG_LOG $PG_LOG.backup sleep 4 echo "Starting PeerGuardian" peerguardnf -h -m -d -c "$PG_CONF" -l "$PG_LOG" endscript 0 ;; *) echo "Usage: $0 { start | stop | restart }" ;; esac exit 0 Code:
sudo peerguardian.sh start
Code:
sudo peerguardian.sh restart
Code:
sudo peerguardian.sh stop
This following section is optional. If you want Peerguardian to run at startup and update the blocklists daily. Code:
ln -s /usr/local/bin/peerguardian.sh /etc/init.d/peerguardian.sh ln -s /etc/init.d/peerguardian.sh /etc/rc0.d/K20peerguardian.sh ln -s /etc/init.d/peerguardian.sh /etc/rc2.d/S95peerguardian.sh ln -s /etc/init.d/peerguardian.sh /etc/rc3.d/S95peerguardian.sh ln -s /etc/init.d/peerguardian.sh /etc/rc4.d/S95peerguardian.sh ln -s /etc/init.d/peerguardian.sh /etc/rc5.d/S95peerguardian.sh ln -s /etc/init.d/peerguardian.sh /etc/rc6.d/K20peerguardian.sh Code:
sudo gedit pg Code:
#!/bin/sh /usr/local/bin/peerguardian.sh restart Code:
sudo cp pg /etc/cron.daily Code:
sudo chmod -c 755 /etc/cron.daily/pg Everything will be logged in /var/log/PG.log This is the original source for this info. I just changed it a bit. |
|
|
|
|
|
#2 |
|
A Carafe of Ubuntu
![]() Join Date: Aug 2005
Location: North of the Artic
Beans: 89
Ubuntu Intrepid Ibex (testing)
|
Re: HOWTO: Peerguardian Installation and automatic updates
Thanks, I shall try this out.
_ounas
__________________
I forgot that love existed - Van Morrison |
|
|
|
|
|
#3 |
|
Quad Shot of Ubuntu
![]() Join Date: Jan 2005
Beans: 290
|
Re: HOWTO: Peerguardian Installation and automatic updates
Oh crap... I just completed a howto on this covering installation from source. In my defense, I didn't see this, and I did search.. but I realize now that when searching, I spelled guardian as "gaurdian" by mistake and thus only came up with 3 results. Ah well. Sorry. Maybe it won't be approved by the mods.
__________________
... |
|
|
|
|
|
#4 |
|
Way Too Much Ubuntu
![]() Join Date: Jun 2005
Beans: 230
|
Re: HOWTO: Peerguardian Installation and automatic updates
Never mind below, all is well, i had to start the script again and it worked fine.
hi, thanks for the howto, i've been looking for something like this. here's an error i get when i start peerguardian, at least i think it's an error, any help would be appreciated. root@wintermute:/home/ephman/Desktop# sudo peerguardian.sh start ------------ 2005-11-29 05:54:48 AM EST Begin PeerGuardian start --05:54:49-- http://www.bluetack.co.uk/config/level1.gz => `level1.gz' Resolving www.bluetack.co.uk... failed: Name or service not known. stat: cannot stat `level1.gz': No such file or directory /usr/local/bin/peerguardian.sh: line 57: [: -gt: unary operator expected No blocklists needed updating. Starting PeerGuardian mv: cannot stat `/var/log/PG.log': No such file or directory ------------ 2005-11-29 05:54:59 AM EST End PeerGuardian Script root@wintermute:/home/ephman/Desktop# thanks for the bandwidth, ephman Last edited by ephman; November 29th, 2005 at 07:16 AM.. |
|
|
|
|
|
#5 |
|
May the Ubuntu Be With You!
![]() Join Date: Apr 2005
Location: USA
My beans are hidden!
Ubuntu 9.10 Karmic Koala
|
Re: HOWTO: Peerguardian Installation and automatic updates
In this how to for "PeerGuardian 2" or "PeerGuardian Lite" or neither?
|
|
|
|
|
|
#6 |
|
5 Cups of Ubuntu
![]() Join Date: Oct 2005
Beans: 33
|
Re: HOWTO: Peerguardian Installation and automatic updates
I've installed it but I can still get on the riaa website?????
__________________
Micro$oft I fart in your general direction!!! |
|
|
|
|
|
#7 |
|
Way Too Much Ubuntu
![]() Join Date: Jun 2005
Beans: 230
|
Re: HOWTO: Peerguardian Installation and automatic updates
same here.
|
|
|
|
|
|
#8 | |
|
5 Cups of Ubuntu
![]() |
Re: HOWTO: Peerguardian Installation and automatic updates
Quote:
|
|
|
|
|
|
|
#9 | |
|
5 Cups of Ubuntu
![]() |
Re: HOWTO: Peerguardian Installation and automatic updates
Quote:
|
|
|
|
|
|
|
#10 |
|
Gee! These Aren't Roasted!
![]() Join Date: Aug 2005
Beans: 182
|
Re: HOWTO: Peerguardian Installation and automatic updates
Um... guys
Do a scan: http://scan.sygatetech.com/stealthscan.html Who here thinks there is a problem |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|