Define first page header/footer in Word 2011 for Mac

It took me quite a while to find the corresponding options in Word 2011 to make the first page header/footer behave differently than the others. But I found it at the end by sheer luck after having it circumvented through another option. And no, there’s no ribbon bar option like in Word 2010… πŸ˜‰

In the Menubar go to: Format -> Document
There select the Layout tab.
Select Different first page.

That’s all folks! πŸ˜‰


It’s even easier: When you double-click to edit the header, the header/footer ribbon appears. And there you can make the same choice as above by selecting Different first page.


Firefox 4.0b7 – revert three finger swipe behaviour back to page up/down

I didn’t notice the change at first because although firefox is my main browser, I was using Chrome/Safari quite a bit in the last couple of weeks, and there’s no three finger swipe for page up or down. How is one supposed to read Engadget without page scrolling? *rolleyes*

But luckily that change was documented and can be reverted easily! Go to about:config in your awesomebar and search for browser.gesture.swipe. Change the values for

  • browser.gesture.swipe.up to cmd_scrollTop
  • browser.gesture.swipe.down to cmd_scrollBottom

and keep on swiping! πŸ˜‰
That’s all folks…


Recursively list directories in php

For a project I needed all directories listed from a given root directory. After searching around the net and finding a lot of old posts handling that with scandir(), is_dir() and stuff, I decided to write my own recursive implementation. I went quite well but after some time (it was quite late I must confess) my head started to “spin me right round, baby, right round like a record baby, right round round round”. πŸ˜‰ But luckily for me, google was very nice at the end because all I needed was some SPL magic (and PHP 5.3 of course):

static public function listAllDirectories() {
	$dirs = new RecursiveIteratorIterator(
	        new RecursiveDirectoryIterator(ROOTDIR),
	foreach ($dirs as $value) {
		if ($value->isDir()) {
			$result[] = substr($value, strlen(ROOTDIR) + 1);
	return $result;

All we do is recursively iterate (with a RecursiveIteratorIterator()) through a RecursiveDirectoryIterator. Because also files are listed this way I had to check for directories with isDir() and save all occurences, stripped from the given root directory and the last apending ‘/’. That’s all folks, the final list looks like this: foo, foo/bar, foo/bar/1, bar, bar/foo, …


Append apache to www user on Mac OS X 10.6

As a vivid user of Gentoo Prefix I normally don’t mind getting my hands dirty. πŸ˜‰
But from time to time, when I install or update apache, I forget to change Gentoo’s default “apache” user to OS X’s “www”. And then I wonder why apache does not start anymore. 😦

But thanks to a colleague of mine and dscl, the Directory Service (aka Apple’s LDAP implementation) command line utility integrated in 10.6, this will come to an end:

# Add apache to the system default web-server user
sudo dscl . -append /Users/www RecordName apache

# And don't forget the group
sudo dscl . -append /Groups/www RecordName apache

# It succeeds without feedback, so better check it ^^
sudo dscl . -read /Users/www
sudo dscl . -read /Groups/www

Awesome! Now I don’t have to alter httpd.conf, watch dispatch-conf closely after upgrading apache or alter some obscure webapp-config files anymore because they can’t find the apache user! πŸ˜‰


  • man(8) dscl

How to resize LVM logical volumes with ext4 as filesystem

Ever been in the situation where you needed to save some important files to a server and your greeted with “Not enough space left on device”-kind messages? No? Well, as that happened too often too me for my liking, I decided to do it right this time when I set up my home server and use logical volume manager (LVM) straight from the start. So basically, all I had to do was to shrink a filesystem that had free space in it and its partition (logical volume (LV) to be precisely) afterwards and then to resize the logical volume/filesystem where I needed the space.

As all the necessary tools are available normally on a system with LVM support, I could dive right in: Follow me…

Add uptime to Ubuntu Server 10.04 MotD

Imho, uptime is as important as the usual information provided by the default motd:
System load, Memory usage, Swap usage, Processes, Users logged in.

To have it included create the following file and save it as /etc/update-motd.d/60-uptime-info:


# Appends the uptime to the motd

echo -n "  Uptime: "

On your next login uptime will be seamlessly integrated in the motd. πŸ˜‰

Upgrade Ubuntu 10.04 (Lucid) Server Kernel to 2.6.35

I really wanted to stay on the LTS side of life lucid, but Linux 2.6.35 got release two days ago and damned, it brings some good stuff with it, above all “Transparent spreading of incoming network traffic load across CPUs” and some power improvements. Perfect for an environmental-friendly low-power home server… πŸ˜‰

The installation procedure is as simple as well-known[1]:

sudo add-apt-repository ppa:kernel-ppa/ppa
sudo apt-get update
sudo apt-get install linux-lts-backport-maverick

And that’s that…
As usual, GRUB2 gets updated at the end, so a reboot is all that is between you and this shiny new kernel full of awesomeness.

Fixed the package name to reflect the package name change. πŸ˜‰

No need for the ppa anymore, the package is in the main lucid/lucid-updates repository.
All there is left to install it is

sudo apt-get install linux-image-server-lts-backport-maverick

Back to post: add-apt-repository is not installed by default on lucid, you find it in the python-software-properties package.