Ubuntu 8.04 + IBM T40 = No sound

If you upgraded your Ubuntu on an IBM T40 Laptop only to find out that there is no sound anymore, you’re not alone in this 😉

Follow the bug report for more information !

Edit 2008-05-11 : As of today I don’t have this problem anymore … update your machine if you haven’t yet !

Edit 2008-06-22 : Sound vanished again … I really need to look into this before this drives me crazy !!

Sound seems to come back and vanish unpredictably reboot after reboot …

Unix : shell tips

I ran into this into the following article, “Learn 10 good UNIX usage habits“. This article is mainly common sense, but there are interesting points, such as :

  • avoid piping when you can, in order to save performance (the classical construct grep | wc to count the lines is useless as most versions of grep can count with grep -c)
  • use awk to “grep” on a specific field of a line with “… | awk ‘$1 == “XXX”‘ which is cool and I never use
  • the find | xargs construct (I’d add “find -print0 | xargs -0”, useful if your find brings back filenames with a space inside …)

All in all it is worth a reading, if only to refresh your memory.

dsh : a distributed shell

clusterA common problem when you deal with a pool of servers (clusters or server farms, you name it) is to execute the same command line on each server. It is usual to solve this with a “for” construct such as :

for i in server1 server2 ; do ssh $i "uname -a"; done

But this is basically re-inventing the wheel everytime. Here comes Distributed Shell (DSH).
Continue reading dsh : a distributed shell

Linux : Clusters, Vitualization, High Availability, Load balancing

I’m back from a 3-day-training about clusters with Linux which was pretty exciting, and here are the main points which were covered :

  • Vitualization with Xen
  • Sharing data with GFS / GNBD
  • Clusters with RedHat Cluster Suite
  • Load Balancing with Linux Virtual Server (LVS)

Continue reading Linux : Clusters, Vitualization, High Availability, Load balancing

Perl : Convert time from Epoch to local time

watch

This little Perl one-liner can get handy when you need to translate “time in seconds since the Epoch” (for example in logs) to local time :
% perl -e 'print scalar(localtime(1202484725)), "\n";'
Fri Feb 8 16:32:05 2008
%

This was pretty useful today when browsing through Nagios event logs, where times are given in seconds from the Epoch.

By the way, the Epoch is defined as 00:00 UTC on January, 1st, 1970.

Linux : Using loop devices (eg : mounting an ISO file)

If you downloaded an ISO file and you want to mount it into your filesystem, you can proceed as follows :
spaghetti% sudo losetup /dev/loop0 cdrom.iso
spaghetti% sudo mount /dev/loop0 /mnt
spaghetti% ls /mnt
Autorun.inf setup.exe setup.ico
spaghetti%
[...]
spaghetti% sudo umount /mnt
spaghetti% sudo losetup -d /dev/loop0

This will use the feature known as “loop devices”, which lets you use a file as a device, and subsequently mount it as it would be one.

You can of course mount an ISO using loop devices, but there is more to it. You could for example mount a ciphered file containing an EXT2 filesystem.

Check out the man page for more details.

Perl : A module to play with a GSM mobile

As you might have read in my previous post about accessing your cell phone with the AT-commands under Linux.

If not, you might want to start there for a little context.

I finally wrote and released on CPAN a Perl module which will help to automate cell phone operations such as saving/restoring the phonebook or sending an SMS.

Examples are included in the documentation. I believe I made it easy to use, but let me know if I’m wrong 😀 .

Features will be added on demand (if possible of course 🙂 ).

The module is Device::Modem::GSM.