Ramblings of a techie

Archive for April, 2008

TCPProxy is one of the most beautiful tools I know of; it was nicely programmed, but above all; it has no bugs. None. We are routing millions of pageviews a day of hundreds of thousands of unique users through it and it has never let me down. It is fast, uses almost no CPU and is very very robust (I miss FTP support, but further it is totally perfect).

This unlike Apache (proxy pass) or Squid or the many other, less known, proxies I tried. Apache is especially crappy; proxy pass is riddled with bugs; under load it simply is unusable. And most of them are feature-heavy; too feature heavy; they are a pain to set up, but trivial things like not binding to 0.0.0.0 etc or simple config files they have not.

We have the necessity to route web traffic via different machines in different places and ofcourse I wanted to use tcpproxy for the task, but it has no x-forwarded-for and so we were pissing our users (with forums, blogs etc) off. So I decided to hack tcpproxy for this. And it works. Serving the millions of pages through it. With x-forwarded-for.

Are you lazy?Are you tired of installing the same shit across Linux servers?Are you sick of compiling the latest & greatest bag of mplayer/ffmpeg/lame on all your systems? Are you becoming suicidal when someone asks you to send you a ‘working out of the box version’?

You don’t need to be 🙂 Install once, run anywhere (on Linux ofcourse, but what else would you run anyway huh);

Install debootstrap;

apt-get install debootstrap

I personally find it nicest to have everything in a file (so you can easily copy one file and leave it at that);

First make a loopdevice (3 gb file);

dd if=/dev/zero of=/myETCH bs=1M count=3000

Set up kernel loopdevice if you didn’t;

insmod loop.o

Set up the loop device;

losetup /dev/loop0 /myETCH

Format the loopdevice with ext3;

mkfs.ext3 /dev/loop0mount /dev/loop0 /myETCH

then remove everything again;

umount /dev/loop0losetup -d /dev/loop0

Your loopdevice is now ready for use!

mount it with;

mount -t ext3 /myEtch /etchinstall -o loop=/dev/loop0

If you do not want a loopback device, simply run;

mkdir /etchinstall

After this you can proceed with installing Debian etch;

debootstrap etch /etchinstall

Wait for it to be done.

Then mount proc;

mount -t proc proc /etchinstall/proc

then you can chroot it;

chroot /etchinstall

And there you are; your own nice, contained version of Debian Etch.

Install whatever you want into it. Provide your friends with the loop file /myEtch when you want to have 100% the environment as you!