Archive for category Uncategorized

LCOD – 5.26.10 – Compare 2 directories

md5sum * | md5sum

This will return an md5sum which will look something like
9277826461d2cb19731f6201c6b2c6b3 -

Run it in 2 directories, if the sums of the sums match, the files are identical.
If not, you may want to rsync between them with something like
rsync-avz -e ssh localdir/ user@remotehost:/remotedir/
or
rsync-avz -e ssh user@remotehost:/remotedir/ localdir/

, , , , ,

No Comments

LCOD – 4.8.05 – Getting rid of Ads/spyware with Squid proxy

Ok, this one is kind of a 3 step process, and I’m not going to put excessive details here about anything, I’ll link to sites that have already done that for us all!

The basic idea is to setup a squid proxy server, and have it use the hosts file that blocks lots of advertising, tracking and malware type sites. Also, I’ll post a quick howto setup a thttpd webserver with a simple page so your redirected ad sites show blank images instead of ugly 404 errors or squid cache errors.

First, setup squid on your Linux box or router. You can “emerge squid, apt-get install squid, yum install squid”, or just follow the instructions and manually install it. Now squid can be on your desktop linux box and you manually set other users on your network to connect to the web using your proxy, or squid can be set up on your linux/freebsd firewall and force users to use it, or to use iptables to do it transparently.

A good quick howto on confiruring squid is here

http://www.linuxhomenetworking.com/linux-adv/squid.htm

Note that in squid you MUST setup an acl (access control list) or you will get permission denied. You do NOT have to force squid users to put in a user/password but you can if you like, all of this is covered in that quick howto.

Next, go grab the hosts file from here

http://www.mvps.org/winhelp2002/

They update this pretty frequently, so this is something you may want to do monthly to keep the latest losers off of your network. Briefly what this is going to do is redirect all traffic to known bad people to your local box. What we’ll do is install this on your squid box, and then squid will look for a local webserver, which we’ll put up default pages & errors that make ads that get redirected look like blank spots instead of ugly errors.
So, grab the zip file, unzip it, and you’ll have a file called HOSTS, now you can use your favorite text editor (vi?) and copy everything in it to your /etc/hosts file, or you can just type cat HOSTS >> /etc/hosts
Make SURE you do 2 greater than signs (>>) and NOT 1 greater than sign (>) since that would overwrite your hosts file. Now, sometimes this gets the Windows style new lines into your /etc/hosts file, and sometimes it doesn’t, anyone know why? please post a reply with an explanation.

So now you have squid setup, and thanks to the /etc/hosts file on the squid server having lots of bad people redirected to 127.0.0.1, you’re seeing lots of http 404 errors or squid cache errors. If you’re seeing 404 errors you have a webserver running on the squid box, if you don’t want to be running a webserver and didn’t mean to install it you can probably go /etc/init.d/apache(2)? stop or /etc/init.d/httpd stop and then go find your runlevel startup dir (/etc/rc5.d or /etc/rc3.d, or on gentoo rc-update del apache2 default) and remove the link to your webserver, if you didn’t want to be running one.

Now, if you have apache/your own webserver and you don’t want to disable it you could go figure out how to setup custom 404 error pages and put up the page I’ll make below and be done. Or, if you don’t mind seeing the errors instead of ads you could be done. But I like to keep the pages I’m surfing looking good, so I run a small web server with some simple html files that are blank, here’s what you do..

First install thttpd

http://www.acme.com/software/thttpd/

or (emerge thttpd, yum install thttpd, apt-get install thttpd)
find the default directory for thttpd to serve files, grab this file and save it as index.html in that directory

http://www.submarinefund.com/lcod/files/blank.index.html

also grab this 1×1 pixel transparent gif image and put it in the same dir

http://www.submarinefund.com/lcod/files/1.gif

Now in the same directory, mkdir errors, cp index.html errors/err404.html, and cp 1.gif errors/

Fire up thttpd (/etc/init.d/thttpd start) and all your ad supported webpages should have nice blank spots all over them

You can also feel good that you’re not getting nailed with tracking cookies from big brother monitoring companies

, , , ,

No Comments

LCOD – 10.23.04 – DVD rippers / DivX/XviD re-encoders

I’ve always used dvdrip to rip DVD’s to AVI
http://www.exit1.org/dvdrip/

I stream them to my ps2 using BroadQ (now gone!)

http://www.broadq.com/

It works with 1 minor, annoying, problem. BroadQ doesn’t support lots of resolutions that are in use out there, so while I can watch my DVD archive, I can’t watch things like sample videos I download off the net and stuff… so I’m installing ripmake, which looks like an awesome tool to handle the job of re-encoding files easily and painlessly…

http://www.lallafa.de/bp/ripmake.html

, , ,

No Comments