Monitoring resources

Every linux user is familiar with (h)top to monitor processes for cpu usage. Its spin-off tools are a lot less commonly known: iotop for monitoring io,iftop for monitoring network traffic, ftop for file monitoring.. (am I missing any other?).

Another interesting one, particularly if you’re on a mobile device, is powertop for monitoring power consumption. I remember when Intel announced its work on a smaller energy footprint for Intel devices back in 2007 but forgot about it since my kernel didn’t support it yet anyway. 🙂

Although the research was focused on Intel hardware, it is quite useful for other cpu’s like AMD. In that case, powertop is not able to calculate the power usage, but it can still show the number of wake-ups per second per process and how much time is spent in each power state.

Repair grub after windows install

Last week I installed Windows 7 RC (which still works these days, btw) on my brother’s computer so he could practice Autodesk Inventor at home. Since Windows stubbornly still denies the existence of any other OS, it consequently wipes the MBR and installs its own boot loader. Bottom line, we need to reinstall the GRUB boot loader.

There are several ways to do that, but since my brother uses openSUSE, I will use the openSUSE install dvd:

  • Boot from the install dvd
  • Select “Rescue system”. This will give you a console. (I also tried the automatic repair option, but that somehow did not work..)
  • log in with root. no password is asked.

From here on, it is not openSUSE specific anymore:

  • Run “grub”. It starts scanning your disks and after some time you should get a grub> prompt.
  • (Optional) Find the partition where grub is installed:
    grub> find /boot/grub/stage1
  • Set grub’s root partition (example: first harddisk, first partition):
    grub> root (hd0,0)
  • Execute grub installation into MBR:
    grub> setup (hd0)
  • If you would have wanted to install into a specific partition instead of the MBR, simply specify the partition instead:
    grub> setup (hd0,0)

You can find all this info and more in the grub manual.

Flushing the dns cache

As we all know, under windows we can flush the DNS cache with

ipconfig /flushdns

But what is the linux equivalent command? It is so obvious, yet I somehow keep forgetting it. 🙂
Under linux, the standard way to have a daemon reload its configuration, is sending a SIGHUP signal. In case of the name service cache daemon (nscd), this implies flushing its cache!
So you could use the following command to flush the DNS cache if you’re using nscd:

pkill -1 nscd

Digicorder getting TiVo like features?!

When you live in Belgium, being ripped off for broadband internet and telephony is your inevitable fate. It’s like there is some conspiracy to keep Belgian people away from the information highway. However, it seems after decade(s) of suppression, there is a little light at the end of the tunnel. 🙂 This month brings interesting news, especially if you’re a Telenet customer.

First of all, my data limit gets doubled next month and even tripled in July. Second, they finally got rid of the silly mail box size (50MB), although the silly web space without php/mysql stays. 😉

Third, and that’s why I started this post actually, is the possibility to program your digicorder (digital PVR) from wherever you are using a website (Dutch announcement)! I’ve always wanted that. 🙂 I won’t go into details why the digicorder still sucks big time (and once more, Java and “slow” seem to go together, painful coincidence? ;)), still, I welcome any improvement. 🙂 Way to go Telenet!

Extract audio from AV container service menu for KDE4

Nowadays, we live in a KDE4 world for real, so it’s time to update my “dump audio from video file” service menu 😉 It should work both in Konqueror and Dolphin.

Create a file with the following contents and put it in one of your service directories (which you can find out by running “kde4-config –path services” , typically you will have something like $HOME/.kde4/share/kde4/services )


[Desktop Entry]
Type=Service
Encoding=UTF-8
ServiceTypes=KonqPopupMenu/Plugin,video/*
Actions=extractaudio

[Desktop Action extractaudio]
Name=Extract audio
Name[en-GB]=Extract audio
Exec=mplayer -dumpaudio %u -dumpfile %u.dump
Icon=speaker

Time Machine for Linux: Back In Time

Recently, I watched a vid about Apple’s Time Machine and was quite impressed. For the first time in ages, I was considering to try out MacosX, after all, you have to give them credit: they just keep innovating as no other computer company. The plan was quickly abandoned though, when I discovered it wouldn’t run on my newly bought AMD monster-machine (post about that in queue ;)).

Anyhow, I searched some alternatives and somehow nothing as user-friendly showed up.. Until today I stumbled upon the solution by accident while I was checking out LinuxJournal’s tech tips! Quite interesting/entertaining stuff there btw. 🙂 I’m talking about about Back In Time and considering the Ubuntu dev, it even has a KDE4 gui, yay! 🙂

Check out the LJ screencast and the LifeHacker article.

Best. Plugin. Ever.

I was trying to watch a vid on a website which was quicktime only. Since I’ve had some trouble a few days ago to play a wmv file on a windows media only site, I decided to give the firefox mplayer plugin a try. I had heard of it before but never found a compelling reason to install it. Until now. It just plays _everything_! I can’t believe how I could live so long without it. 🙂 Or maybe because 99% of the web’s vids are flash? 😉 (which works, of course)

Here is the supported formats list:
Window Media: wmv, avi, asf, wav and asx
QuickTime: mov and smil
MPEG Video and Audio: mpeg and mp3
Ogg Vorbis: ogg
AutoDesk FLI: fli and flc
Vivo: vivo
Real Player: ram and rm

Opera 10 send mail problem

I just discovered I had a mail in my outbox I sent last week. It turned out one of my email accounts was not properly migrated from Opera 9.
I ran Wireshark and it seemed Opera was sending a wrong parameter with the EHLO command (which queries an ESMTP server for its capabilities). It sent EHLO smtpserver instead of EHLO myhostname. Of course the server replied this could not be the case since he was that host himself. =)
So I grepped the accounts.ini file to see where that information could come from. It turned out there was a fqdn property present containing the smtp server name which was not present anymore in a newly created account (yet it seemed to attach some value to it, apparently). So I simply deleted the fqdn property and all was solved. 🙂
Keep in mind, I am upgrading the same opera profile since Opera 7 so I guess my particular upgrade scenario has received less attention. 😉