Substitute "Mac" newlines with unix ones

At work we have been struggling with bad newlines in php-pages created with dreamweaver on a Mac. The newlines screwed up grep results and was mainly just one big pain in the ***. This is a little note to my self about how to solve it.

This solution (parsed around by one of the guys at work, thanks Frank) should be carved in stone to be remember for eternity. The second best would be writing it on the Internet and I don’t have any stones not already written on at the moment:

tr '\r\n' '\n'  OUTPUTFILE

King Arthur

Yesterday I went to the movies with a friend of mine to see “King Arthur”. It had been a while since we last met. We went to the big movie theatre in Copenhage (Imperial) where we spend some time before the movie to catch up. I had a great time and the movie was good, not like Braveheart or Gladiator but okay entertainment no doubt.

Debian Sarge on IBM X40 howto - Part 7: Mouse track dot

I have experienced that my mouse isn’t working after a reboot a few times. I think it happens after a system update… and this morning I was hit again. When starting X the mouse pointer wouldn’t move.

After googleing around for a while I found out that the psmouse module wasn’t loaded. I compared an lsmod output I had found on the net with my own and discovered that the above module wasn’t loaded:

modprobe psmouse

Did the trick and even without reloading X.

Debian Sarge on IBM X40 howto - Part 6: Wireless (Take 2)

As I mentioned in an earlier post, I found out that I had been using a completly wrong driver for my wireless card. The juice for my card is a Multiband Atheros Driver for WiFi (MADWIFI). I found a Debian specific driver compile guide on their homepage.

It is a good guide but for Debian users with less tech-knowlegde and rutine it misses a few things IMHO. I have addressed the problems I ran into here.

A part from the packages mentioned in the guide I was missing shareutils (providing uudecode), lib6-dev and sysutils to follow the guide and avoiding error messages ofcource. The missing uudecode was beginning to give me grey hair (in an age of 24 that is not a good sign). The warning (error) message was hidden in the output code many lines before the make-file actually worte ‘Error’ and exited:

apt-get install sharutils lib6-dev sysutils

I’m using Debian pre-compiled kernels (at the writing time a 2.6.7-1) which tricked me a bit. I used the make-kpkg --append-to-version "-686" --revision 2.6.7-1 which is wrong!

Instead use (look in guide to know where and when):

make-kpkg --append-to-version "-1-686" --revision 2.6.7 --config old configure
make-kpkg --append-to-version "-1-686" --revision 2.6.7 --added-modules madwifi modules_image

Writing this post in my weblog on my laptop sitting in my bed without any wires connected at all - Now everything is forgiven and forgotten.

Debian Sarge on IBM X40 howto - Part 5: CPU frequency scaling

This was quite easy:

apt-get install cpufreqd
apt-get install gnome-cpufreq-applet

Finally add the applet to the GNOME panel.

Make sure that the acpi module is loaded in order to get cpufreqd to run, because without cpufreqd no frequency scaling will happen.

Now when ever you pull the power for your laptop the frequency will be scaled down to 66% until the system requires the recources. This can be cunfigured in /etv/cpufreqd.conf.