my package of the day – htop as an alternative top

„top“ is one of those programs, that are used quite often but actually nobody talks about. It just does its job: showing statistics about memory, cache and cpu consumption, listing processes and so on. Actually top provides you some more features like batch mode and the ability to kill processes, but it’s all quite low level – e.g. you have to type the process id (pid) of process you want to kill.

So, though an applications like top makes sense on the console, a more sophisticated one would be great, extending the basic top functionality with enhancements to it’s usage. This tool already exists: It’s the ncurses based „htop“ and we’ll have a closer look at it now.

For the beginning: Install „htop“ by running „aptitude install htop“, Synaptic or the package manager of your choice. As you can see, htop is quite colorful, which is, of course, a matter of taste. In my opinion, colors make sense, when the they mean something or provide better readability. So let’s check the output in brief:

htop1.png

At the upper left corner you see statistics about the usage of cpu cores (in my case there are two of them, marked „1“ and „2“), memory and swap statistics, while on the right side, you have the common uptime/load stats. The interesting part is the usage of colors in cpu/ram/swap bars. If you are new to htop you have to look the colors up at least once. Therefore just stroke „h“ („F1“ should work, too, but Gnome might get in your way) and you’ll see a nice explanation in the help:

htop2.png

Quite interesting is the distribution between green and red in the cpu stats, as a high kernel load often means something goes wrong (with the hardware i/o for instance). In the memory bar the real used ram is marked green – blue and orance actually could be cleared by the kernel if necessary. (People are often confused that their ram seems to be full, when calling a tool like/htop though they are not running that many programs. It’s important to understand, that the memory is also used for buffering/caching and that this memory can often be used by „real“ data later on).

So what’s the next htop feature? Use your mouse, if you like! You can test it by clicking on „Help“ on the menu bar at the bottom. Maybe while clicking around a bit you already noticed that you can also click on processes and mark them. What for? Well, htop enables you to kill processes quit easy, as you don’t have to type a process id, write a pattern or something, you just can mark them with a mouse or cursor and either click on „Kill“ in the menu or stroke the „F9“ or „k“ key. „htop“ will let you choose from a list of signals afterwards:

htop3.png

Of course you cannot kill processes that belong to your user when htop does not run as root (i.e. with „sudo“). „htop“ marks processes that belong to user it is run by with a brighter process id:

htop4.png

Sadfully this also means, that running htop as root/sudo, marks processes that belong to non-root with a darker grey. But hey, that’s a nice missing feature for patch, isn’t it?

If you like to become an advanced htop user, you can check the „Setup“ menu (click it or press the „F2“ or „S“ key). You will see a menu for configuring the output of htop, enabling you to switch off and on the display of certain information:

htop5.png

Of course you can also sort the process list (click „Sort“ or press „F6“) which give you a list of possible sort parameters:

htop6.png

In spite of this, you can switch to a process tree display and sort it by pressing one of the keys showed below:

htop7.png

So let me give you a last nice gimmick and then end for today: You can try to attach „strace“ to a running process by marking the process typing „s“. If you don’t know, what strace is, don’t bother, if you do, you will probably like this feature pretty much.

I hope you got the clue about using htop, which is a really neat, full featured console top replacement that is even worth to be used when running X as it supports mouse usage and brings everything you need while still having a small footprint. If you have alternatives, you like mention, feel free to drop them as a comment.

my (not yet) package of the day – circular application menu

(Not yet a package, but still interesting enough to tell and hey: bleeding edge.) Circular Application Menu for Gnome is a Google Code hosted project providing a different access method to your Gnome menu. Actually all it does, is displaying the menu as circles:

hauptmenuecircular.png

Installation

But as it is different, it is somehow attractive and therefore let’s give it a try. Building „circular application menu“ is quite easy. You just have to install some libraries, subversion and essential build stuff, check out the current repository and compile it. Huh? Try this:

$ sudo aptitude install subversion build-essential \
libgnome-desktop-dev libgnome-menu-dev
$ svn checkout \
http://circular-application-menu.googlecode.com/svn/trunk/ \
circular-application-menu
$ cd circular-application-menu
$ make

Running

If no severe error occurred, you are already able to run „circular application menu“ it via ‚./circular-application-menu‘ now. Ignore error messages on the console as long as it comes up. Strange feeling to use it, isn’t it? I haven’t decided, if I really like it or not, until now.

If you like you can now install it to the system via make install, though I am fine with running it from the build directory, which I moved to „~/opt/circular/“. As it is pre-alpha-something, I just don’t want the code be mixed up with my distribution binaries.

Customizing

If you want to go one step further, install the Avant Window Navigator („$ sudo aptitude install avant-window-navigator“), the OS X style application panel, which just moved from Google Code to Launchpad (points taken!) and add an icon for circular menu to it by doing a right-click=>settings=>Launchers=>Add. Now you can start all normal applications by calling Circular Menues from the AvantGo launcher. Definitely an eye catcher:

Circular Application Menu combined with Avant Window Navigator
(click to enlarge)

Pitfalls

There are, of course, a couple of pitfalls. For instance, when running circular application menu on top of a dark or even black application, you cannot see it’s borders:

bildschirmfoto-1.png

Also, you currently don’t have the possibility to customize the launcher at all.

Nevertheless: circular application menu for Gnome is a nice desktop gimmick. I am sure, it will be packaged soon (will I?) and go to the community repositories of most GNU/Linux distributions.

First BBJ – Berlin Bug Jam – with MOTU Daniel Holbach on Monday, 16th of June at c-base Berlin

Ubuntu Berlin ist proud to present you the first BBJ: A „Berlin Bug Jam“ with Ubuntu MOTU Daniel Holbach, who will rock the place, for sure. Don’t know what a „Bug Jam“ is? Well, imagine it as a gettogether for working on bugs in a team. That does not mean, you have to be a developer: Everybody is welcome, who can do things from testing bug reports, triaging, patching or just wants to see how it all works. So this will rather be an „event“ than a lecture/workshop and provide you with a lot of fun and knowledge. If you want to see a detailed description of a bug jam, check the wiki page.On the BBJ, we will try to persuade to join the 5-A-Day project, motivating people to continuously enhance the Ubuntu Distribution and helping you to spread the word (and yes, to compete if you like) by trying to work on five bugs every day. Let’s see, if we succeed…

Feel free to bring your notebook along. We have power and free wifi, of course.

Event: 1. Berlin Bug Jam (BBJ) with Daniel Holbach
Location: c-base Berlin, Rungestr. 20
Date: 16th of June
Time: 18:00

Please note: If you want to support the Global Ubuntu Bug Jam, which is taking place from 8th to 10th of August,
this is a perfect possibility for you to gather some hands on
experiences. Of course, Ubuntu Berlin, will bring up a great lineup and
event for the Global Bug Jam. We are already working on it.

my package of the day: less (yes, less)

Let me tell you something about „less“: You are probably underrating it for no reason. Of course you know „less“ is always there and it does it’s job – showing files while being able to scroll backward – and some even use it instead of „tail“. But, hey, let’s examine some of the command line options to get more out of less:

-M: this option extends the prompt on the bottom. By default less in most cases just shows the name of the file it is showing, with „-M“ turned on, it also shows how many lines the files has, which lines it is currently showing and how far (in percent) you have gone. No killer feature, but nice to have.

-i: this option causes searches to ignore cases. A search for „pattern“ therefore also finds „PaTTerN“. You like this, don’t you? You like this even more, as this search still enables you to switch case sensitive search on by searching for a pattern containing at least one uppercase letter. A search for „Pattern“ for instance would still be case sensitive. If you even want to prevent this, you could use „-I“ which totally ignores cases.

-r: Sometimes getting warnings about binary characters? With „-r“ you tell less to display raw characters. This can help you when displaying files containing color codes. It is said that log files from Rails contain these types of code.

-c: Just a gimmick to redraw the screen more clearly by beginning from the top line instead of scrolling. This might result in a slightly increased data transfer rate when using ssh but can improve usability.

-a: This causes less to skip found search patterns when pressing „n“ not from item to item but from page to page. You might know the pain when searching for a pattern that comes up more than once on a page and you start hammering „n“ getting confused on what you have already seen and what not. This options just skips at least the current page before displaying the next found pattern while still marking all patterns of course.

-f: This can help you in conjunction with „-r“ to force the display of raw characters without being questioned again.

Confused about the sequence of the options? Don’t be:

$ less -Mircaf

is something you just learn or create an alias for.

This one, to sum up the options, will display an extended prompt, ignores cases in searches, while being able to switch them on, skip found search patterns at least per page, display raw characters like color codes without asking and redraws the screen as good as possible.

Another feature that should be mentioned is the „follow file“ mode that some of you might know. It is similar to tail as it shows you the content of a file that gets appended while viewing. You turn this mode on by pressing „F“ (uppercase F). The advantage over tail is that you can interrupt the mode by pressing ctrl-c and scroll back though still being able to return to follow by pressing „F“.

Not so familiar is the fact that you also can jump into the follow mode from the command line:

$ less +F

starts the follow mode immediatly. Of course typing „+F“ on the command line is not sophisticated as typing „tail“ but you can create an alias for it like „ltail“ or whatever you like.

As a summary:

$ alias eless="less -Mircaf"
$ alias ltail="less +F"

gives you two new commands. „eless“ as an extended less provides you with the described features. „ltail“ simulates „tail“ but enables you to jump back to the normal less by pressing ctrl-c.

Instead of creating an alias for „less -Mircaf“ you could also use the environment variable „LESS“:

$ export LESS="-Mircaf"

A credit goes to mnemonikk, who was just too lazy to blog this.

Please note: As less is still being developped, command line options might slightly change. For instance in newer version „-R“ instead of „-rf“ might lead to the same result. Just try it or check the version of less you are running („less –version“) against the official less changelog.

Ubuntu landed on Berlin metro system

The guys from „Berliner Fenster“, a company responsible for the content of the television system installed inside underground vehicles (more than 3.700 displays) were so kind (thank you!) providing us with a spot for our release party this Saturday for free. So just on time with the release starting from today there are small spots viewable by an audience of about 1.5 million people per day according to their web site.

Don’t trust me? See this:

and this:

And come over on Saturday, the 26th of April to our release party. Lectures, demonstrations, freshly burned cds, a live Samba band, a button machine and Daniel Holbach as Drum’n’Bass dj and of course dozens of helpful and open source minded people are waiting for you. Entrance is free.

Daniel Holbach going to rock the turntables at Ubuntu Hardy Heron release party

I already told you about our shiny Ubuntu Hardy Heron release party on the 26th of April at the sunken starship c-base right here in Berlin, haven’t I? While the schedule is already a must-come: seven talks/presentations, not only from community members but also from friends like the Free Software Foundation Europe, a live Samba band, the chance to hang around directly at the river bank of the Spree while having free wifi turned on, I am proud to announce that our dj team just got doubled: This time Ubuntu developer and MOTU Daniel Holbach himself will bring his turntables and show us what his interpretation of a drum’n’bass dj set is. He’d just say „rock on“ and so are we. If you want to give his mixtapes a try, just check out the very category at his blog.

Hope to see you Berlin folks this Saturday (German folks even – just enter a train, car or whatever). Feel free to contact me directly there, I am always happy to see new faces.

Why I won’t install Ubuntu on my OLPC XO (for now)

As you might have noticed, a couple of days ago I finally received my OLPC XO. Of course installing an Ubuntu flavor was one of my major tasks for the first time, but…

… after booting the XO for the first time there is something like a cultural shock: The XO gui „Sugar“ is totally different from what you might have used before. After recovering from that clash you start getting a clue what the small white-green device with the „bunny ears“ called wifi antennas is about. It is about local communities, learning collaboration and creativity. So there is a huge difference between using an EEE Pc and using a XO. The EEE PC came with a Linux gui (Xandros flavor) that was just not what I wanted and as the EEE is actually nothing more than a small and cheap version of a common notebook, installing Ubuntu (yes, even the normal Hardy desktop version) seemed rational and indeed works like a charm.

The XO is different from that: It’s ability to share most applications, the strange network and neighborhood views, the display (that is definitely worse than EEE’s when using color mode but unbeatable when using the greyscale mode in sunlight), the strong wifi antennas invite you to play around with a different approach to work. There are even limitations that enforce not switching back to „normal“: The quite limited ram (256Mb) and Sugar’s limit for only running a specific number of applications invite you to concentrate and focus. Of course you suffer a bit from being forced to use „yum“ on the console when installing applications that are actually not meant to be installed or don’t integrate into Sugar. They are not „Activities“ as Sugar-applications are called. (Besides: „Activity“ is a nice naming convention in my eyes.)

So what about Ubuntu? It’s not only about running it on the XO. You prolly know projects like „It runs doom“ (yes, the OLPC runs doom but somehow you feel wrong about it) trying to run specific software on as many devices as possible. We know Ubuntu will run and it already does. But the task is to take the challenge of providing something different, something focused. There is a blueprint already that gives hints on what is to do: Ubuntu for the One Laptop Per Child Project. It outlines the necessity of providing collaboration software, mesh network support and more of those things you don’t think about in the first when reaching for your notebook. At the end of the day this gives you the possibility to reach an audience you’d never dare to dream of before. So keep on hacking the XO and don’t stop after launching *buntu on it. We can do more.

EEE updated to hardy

Well, it got „boring“: After Gutsy worked smoothly for weeks on my Asus EEE Pc with desktop effects, some tweaks for hotkeys, overclocking and stuff I tried to run an update to the latest Hardy Heron Ubuntu version.

After having followed my own small Howto as preparation for the upgrade I noticed that I really got low on disk space. As I just installed the normal Ubuntu Desktop and few additional apps I had only about 28 percent of the four gigabyte which would be just not enough for an version upgrade. So as a work around I used a sd card and mounted it as /var/cache/apt/archives so that the hundreds of packages could be stored there during upgrade.

The upgrade (via „update-manager -d“) went without any disturbances but took about two hours including the complete download process. After reboot I noticed two major issues: Wired and wireless network were down (an uncomfortable combination 😉 ).

Wired network: The fix for the wired network network is the most silly thing I had ever done and after having found the hint for it on a web page I first thought that this *must* be a fools day joke but it was not: You have to plug off power and remove the battery for some seconds. Afterwards wired network is up and running. Yes, trust me.

Wireless network: The fix for the wireless network was nearly as easy (but not as funny) – just a wget/untar/make/make install of a patched driver copy of madwifi:

sudo apt-get install build-essential 
wget http://snapshots.madwifi.org/special/madwifi-nr-r3366+ar5007.tar.gz
tar xzf madwifi-nr-r3366+ar5007.tar.gz
cd madwifi-nr-r3366+ar5007
make clean && make
sudo make install
sudo reboot

So if you thought about upgrading your EEE: Do it. It’s time to find and report bugs for the thingie – in your own interest and as a nice way of contributing to the open source community. Just wondering where to file a bug about needing to remove the battery :)

Invitation to Ubuntu Hardy Heron Release Party in Berlin on 26th of April 2008

Here it comes: Though the release party of the „Ubuntu Berlin“ user group will be mainly in German we also invite all non native German speaking visitors to attend us. Here is the official English invitation (thanks to ninin for the work on the translation):

Ubuntu „Hardy Heron“ release party on April 26th at 4:00 pm at the c-base in Berlin

Ubuntu 8.04 „Hardy Heron“ is arriving. To celebrate the new release of the popular free GNU/Linux distribution Ubuntu the local user group Ubuntu-Berlin will organize a party. The event will take place on the 26th of April in the rooms of the culture project c-base and starts at 4:00 pm. Admission is free.

There will be a programme of short talks (about 20 minutes each) in relaxed atmosphere. Several features and applications which are integrated into the new Ubuntu version are presented by users, for example the optional 3D-Desktop. Furthermore there will be contributions of associated organisations like the „Free Software Foundation Europe“ (FSFE) and the „Förderverein für eine Freie Informationelle Infrastruktur“ (FFII). A „burning station“ provides visitors with Hardy CDs at cost price of one Euro. For anyone who wants to try out Hardy straight away there will be the possibility to do so on one of the computers there. There will be many experienced users around, who will answer questions.

Flyer for Hardy Heron Release Party
(please note the year 😉 )

Apart from the official programme, the event offers the possibility to get started with the world of free software and to get in touch with like-minded users. Musical entertainment comes from a variety of Bands and DJs who will also play free music. Beverages and snacks are available at the bar at moderate prices. Laptops can be connected to a free Wifi net (visitors could bring a power strip, switch and cable).

Who is „Ubuntu Berlin“?

„Ubuntu Berlin“ is a free group of interested Ubuntu-Linux users. The group sees itself as a local communication platform und organises regular user meetings and release parties. The group has no own legal form but it keeps loose contact with the registered association „Ubuntu Deutschland e.V.“ which supports selected activities.

Place, time and access route

Date: 26th of April 2008
Time: doors open 4:00 pm, open end
Place: c-base, Rungestraße 20 in Berlin Mitte, S+U Jannowitzbrücke
Route: https://wiki.c-base.org/coredump/AnfahrtsSkizze

Contact

E-Mail: [email protected]
WWW: http://www.ubuntu-berlin.de/

Having a Hardy day – Ten steps helping you not to have a hard time upgrading

So just before the first beta I finally updated my production machine to Hardy after feeling bad about not giving enough effort in testing for the last weeks. In one short sentence: It worked! In a longer sentence: It worked quite well, but…

If you plan to update your machine by calling „update-manager -d“ on Gutsy or actually any other Ubuntu upgrade you might have a better time with the update by taking the following then steps before:

  1. Remove all applications you installed for testing purposes but don’t use them. It’s a nice feeling to have a mostly cleaned machine. Removing applications before an update reduces download time, the space needed and dependency calculations as well as the risk of a dependency failure. So just drop all those only once clicked applications, games and even libraries. Take some time for this, it will save you time later. Trust me.
  2. Check that you have enough space left on your device. Hundreds of packages are being downloaded in one step, therefore you should have enough disk space for this. Keep this in mind.
  3. Compiled software by your own? Installed external .deb-files? If possible: Uninstall them, you can later reinstall them if they are not provided by Ubuntu+1.
  4. Added software repositories to /etc/apt/sources.list (or Synaptec?). Disable them for now.
  5. Switched to a server close to you? For an update to an alpha or beta version it might be better to switch back to the main repository server as you are getting probably urgently needed updates faster (correct me if this is wrong).
  6. Of course: Back up, back up, back up. Decide, if a backup of your home directory fits your needs or you also want the rest of your partitions.
  7. Bring enough time: A full upgrade might take two hours and more, depending on your ram, cpu power, network speed and amount of installed applications. Don’t think an upgrade runs automatically – it will ask you several questions during package upgrades and therefore awaits your attention. Make the day your upgrade day or at least the afternoon your upgrade afternoon. A cup of tea might help.
  8. Check for already known caveats that you might take care of. Normally the most important ones are collected on the wiki page to the current alpha/beta release like this one.
  9. Make yourself clear what „alpha“ an „beta“ mean: Take them as warnings and only take the risk of an upgrade if you are not under time pressure for a project (like writing an essay, developing an application or anything with a deadline close to your upgrade day).
  10. Check if you have the possibility to have a second computer around enabling you for checking against discussion boards, wikis and other ressources of useful information. In case of an emergency it is crucial to be online in way because often really simple tricks can save your day.

After these steps, feel free to give „update-manager -d“ a try. Take notes of things that look strange and check launchpad bug tracker if they are already reported. Now it is up to you to help making Ubuntu a better distribution and Hardy a really success.

Good luck!

p.s.: And if you want an example of things that *can* go wrong: After upgrade I noticed my wireless connection was down as the device was missing (no eth1 anymore). After searching the web I found out that the package „linux-ubuntu-modules-2.6.24-12-386“ was not installed though it should have been. An „aptitude install linux-ubuntu-modules-2.6.24-12-386“ over a wired connection solved the problem.