Varnish caching - passing a hostname

I'm using varnish to cache a REST service that's slow enough to cause me grief in development.

Out of the box it assumes you are caching your own server and that the client is already using the right host header.

To specify that it should use a host header to match the backend I'm using a config like

backend default {
        set backend.host = "www.example.com";
        set backend.port = "80";

}


sub vcl_recv {
        set req.http.host = "www.example.com";
}

Read more

Resizing an ext3 filesystem on LVM

When I installed my system I wasn't quite happy with the way the installer divided my hard disk - but at the time I was in a hurry...

I have since found that repeated loading of databases during development used up all available space in /var and debug files were filling /tmp

So I had to figure out how to resize them.

 

Thanks to 

http://blog.dhampir.no/content/resizing-an-ext3-filesystem-on-an-lvm

Read more

ssh port forwarding

Every now and again I find I have ssh access to one server - which has access to somewhere I need to get to - but I want direct access (eg to forward an X session)

ssh -L 2222:otherserver:22 server

ssh -X -p 2222 localhost

an now I'm logged into othersever with forwarded X

Read more

Drush "tput: No value for $TERM and no -T specified"

The drush script which provides comman line acceess to drupal functionality emits an error message when run as a cron job

tput: No value for $TERM and no -T specified

# If it is not exported determine and export the number of columns.
if [ -z $COLUMNS ]; then
  export COLUMNS=$(tput cols)
fi

I presume drush uses this information to calculate layout of output.

However when running as a cron job COLUMNS is not set and tput gives the above error.

Read more

Upgrading Debian Etch to Lenny

Debian Etch has been serving me well for a few years with wonderfully easy and infrequent maintenance.

However it's at the end of its life

http://www.debian.org/News/2010/20100121

So I've upgraded to Lenny following these instructions

http://www.debian.org/releases/lenny/i386/release-notes/ch-upgrading.en....

It was remarkably painless

One small problem with the mail system.

Errors were encountered while processing:
exim4-config
imapproxy
exim4-base
exim4-daemon-light
courier-imap
at
bsd-mailx
courier-imap-ssl
mailx

Read more

Amazon MP3 Downloads for Linux

It's great that Amazon actually offer a version of thier MP3 downloader for Linux - just a shame that it doesn't work for many distributions.

Fortunately clamz is available 

It's a great little command line utility with a very forgetable name.

Read more

Hard Drive Testing using smartmontools

Test the hard drive with

smartctl -t long /dev/hd?

This may take hours to run and will do so as a background process.

Once complete run the following to see results

smartctl -l selftest /dev/hd?

Read more

Getting Calibre working on Debian Lenny

I recently bought a Sony e-reader, the main Linux package to support this is calibre but I found that it wouldn't automatically sync my ebooks.

 The FAQ says 

 "The linux kernel can export two version of SYSFS, one of which is deprecated."

Apparently Debian Lenny exports the deprecated version and you have to recompile the kernel to undo this.

Read more

Installing Lame on Debian

Debian has a very strict policy on free and legal software. This helps keep everyone honest, but sometimes a pragmatic approach is called for. MP3 is a file format that is patent encumbered - but also in universal use.

I could use the supplied Ogg Vorbis tools but then my music wouldn't work everywhere I want it to.

So I want to install Lame which is only available in source.

http://sourceforge.net/projects/lame/files/

Download and extract

Read more

Configuring WIFI with Debian

I've just installed Debian Lenny and generally am impressed with how well things are auto detected and configured - so much easier than a few years ago - and in many ways easier than a Windows install where you have to constantly find 3rd party drivers to get things working.

 However getting wifi running was a bit trickier (largely because of FCC regulations  affecting licenses and default settings).

This document got me most of the way

http://wiki.debian.org/iwlwifi

Additional lines in /etc/.network/interfaces

Read more