Tuesday, June 23, 2009

Information Please

An article on Lifehacker featured an interesting utility called iotop, which gives a birds eye view of what your hard drive is up to. The commentors mentioned a couple of other interesting tools, although many seemed to be confused as to what iotop is measuring as opposed to some of the other utilities. I thought I'd do a quick write up about a few of these command line machine status reporters.



The most basic status tool is, of course, ps. In number of options, it competes with ls for most in the Linux manual! This is because it has 3 different command "modes" - UNIX, BSD and GNU versions, and all are usually mutually incompatible. ps gives you a basic snapshot of what programs are being run.



While ps is always around, the rest of these usually need special installation, although the next one, top, is almost always around. top adds more information but, most importantly, runs in a curses display, so it stays around and updates itself, giving you a constant view of what your CPU is up to. You can see it change dynamically as programs work your CPU harder. Use the 'h' key to display a help screen, giving you more sorting and display options.



View top in action


The most flexible version of ps is htop. This gives you even more information, more sorting options and an even better curses display. Again, use the 'h' command to get a full help display. I especially like htop for how it displays the complete command line.



View htop in action


iftop uses a top-like display to show you what is going on in your network (your interface). It displays the various network requests, who is making them and how much is coming and going on each. This is an especially useful command on a server, as you can see what your web server is working on, and keep useful totals.


View iftop in action



iotop again uses a top-like display to give you a real time, in-depth view of disk I/O. This is an especially useful diagnostic tool if you notice your hard disk is "thrashing" - ie, the red access light is doing a disco-like strobe effect and you're wondering who is doing all that hard drive dancing.



View iotop in action


saidar is another monitoring tool that shows a nice overview of everything going on in your computer. Useful information like CPU load, swap usage, disk space, and network traffic. Good quick clean overview.


View saidar in action


Next time, perhaps I'll take a look at some of the graphical system monitoring tools available for KDE and GNOME. If you have any other favorite terminal-based monitors, please mention them in the comments.




Wednesday, June 10, 2009

Screencasting the Creator

I'm trying out Nokia's fancy new Qt Creator IDE for developing Qt 4.5 applications. Looks pretty nice, even if Qt itself is a little fugly, given all the weird macros it uses to get its work done. Maybe this IDE will shield me from the worst of it?



Anyway, I'm going through the recommended book (C++ GUI Programming with Qt 4, Second Edition) on Safari and am finding it a bit of a chore. It is working with the older GUI design tool, Qt Designer, and not Qt Creator. As far as I can tell, there isn't much introduction material for Qt Creator. So I'll try and puzzle out the answer to some of the oddities and document them here.


So what I've done is create my very first screencast! I am using recordMyDesktop via its GUI interface qt-recordmydesktop, which works pretty well. I had the usual audio hassles, trying to figure out how to set up the mic for recording. I could never get it to use my USB headset, but luckily this lovely Plantronics USB headset comes with regular 3.5mm jacks that plug into a USB adapter, so by plugging the jacks into the back of the audio board, I could get it to record after trying various options in KMixer.


Coincidentally enough, the most recent issue of Linux Format magazine has a Roundup of screencasting tools. Their pick is the closed source DemoRecorder but it doesn't seem to offer anything that the free recordMyDesktop offers besides the ablity to save in multiple formats. recordMyDesktop only does Ogg Vorbis video, but all the upload sites convert it to Flash video anyway, so I don't really care.



I had a few problems getting the screencast to work. First off is a bug in Qt Creator, where if you rename the main widget, the compiler gets all weirded out. Took me a while to figure that one out. The workaround is to rename it from the Project creation dialog.



Then I was having problems getting the post-recording conversion to work. It would only do some of it, or not a complete audio track. Not sure what the work around was for that. I either got lucky finally or, by just leaving the computer alone until the process was done made it work. Finally, I got the 6 minute screencast to work.



I am using blip.tv to host the video. I've heard it does the best job at conversion and has the fewest restrictions on formats, as well as giving the most options for display. So, without further ado, is my very first screencast: