Categories
linux nonsense

Moving towards ‘inbox zero’

Over time my inbox grows larger and larger…. and eventually it starts to take ages to sync/navigate around – 15,000+ messages in an inbox can’t help.

Categories
linux

Script to fix NFS (Debian Squeeze + Backports bits)

I have a NFS server running Debian Squeeze. Additionally it’s using the 3.2.x kernel from backports, and the nfs-kernel-server from backports too. Sometimes NFS breaks, and gives helpful messages like : mount.nfs: connection timed out or just: Stale NFS handle on clients.   While I’m confident that my /etc/exports and other configuration files are correct, […]

Categories
linux

Virtualbox 4.2 VM autostart on Debian Squeeze & Wheezy

One new feature of VirtualBox 4.2 is that it has support for auto-starting vm’s on bootup of the host server (via init etc). This means I can remove my hackish ‘su – vbox -c “VBoxHeadless –startvm VMName &”‘ additions in /etc/rc.local, and the VM’s will also hopefully be terminated gracefully on shutdown. The docs/guides online […]

Categories
linux

fsck paranoid?

Some random hints : Ensure the final field / column in /etc/fstab is non-zero for other filesystems you have mounted; if it’s 0 then fsck will never run on them. fsck -Cccy /dev/blah1 does a read-write (non-destructive test). Works well on SSDs 🙂 Example from /etc/fstab: /dev/md0  /mount/point ext3 defaults 0 2 When looking at […]

Categories
linux

Sponge – Shell command

Today, my sed kung-foo seemed to be lacking, so I ended up having to split the sed command over a zillion lines… Normally I’d do something like : sed ‘s/foo/bar/g’ tmp.txt > tmp2.txt sed ‘s/fo2/blah/g’ tmp2.txt > tmp3.txt But this obviously gets painful after a time, a different approach would be to use sponge where […]

Categories
linux performance

Checking varnish configuration syntax

If you’ve updated your varnish server’s configuration, there doesn’t seem to be an equivalent of ‘apachectl configtest’ for it, but you can do : varnishd -C -f /etc/varnish/default.vcl If everything is correct, varnish will then dump out the generated configuration. Otherwise you’ll get an error message pointing you to a specific line number.

Categories
linux

yum changelog (Want to know what you’re about to upgrade on CentOS/RHEL?)

Want to see what changes you’re about to apply when doing a ‘yum update’ ? Similar-ish to how ‘apt-listchanges’ works… On CentOS 5.6, try : yum install yum-changelog python-dateutil Note, python-dateutil seems to be an unmarked dependency – i.e. you get an error message like : “Dateutil module not available, so can’t parse dates” when […]

Categories
Uncategorized

Getting a kvm serial console with grub2

I’ve a few kvm guest servers, which I’ve been accessing using vnc – but this is a bit of a pain (getting port forwarding setup etc). Host and guests run Debian Squeeze with Grub2 installed/in use. So, here’s how to do the ‘virsh console ‘ thing … Edit /etc/default/grub, specify GRUB_TERMINAL=console GRUB_SERIAL_COMMAND=”serial –unit=0 –speed=115200 –word=8 […]

Categories
Uncategorized

Varnish + Zope – Multiple zope instances behind a single varnish cache

I run multiple Zope instances on one server. Each Zope instance listens on a different port (localhost:100xx). Historically I’ve just used Apache as a front end which forwards requests to the Zope instance. Unfortunately there are periods of the year when one site gets a deluge of requests (for example; when hosting a school site, […]