Category Archives: Linux

My take on Ubuntu Unity

With the release of Ubuntu 11.04 (Natty Narwhal), Canonical changed the default user interface from Gnome to Ubuntu Unity. Being a long time Gnome fan and advocate, I admit I was initially surprised and a little upset with the idea. I was really hoping to see Gnome Shell (Gnome3) in Natty, but I guess they had their reasons not to include it and also to use a completely different desktop. Regardless, I couldn’t help but be interested in Unity. It is Gnome Shell -ish and I am a fan of change, as long as it improves my experience and doesn’t get in the way of what I am doing or over-simplify things.

Ubuntu Unity is really designed for netbooks — where screen real estate is at a premium. Unity drops the bottom task bar and replaces it with a dock/launcher on the left of the screen — basically the OS X dock. The top bar also gets a more OS X-y style, with an app menu/finder button, main menu of the currently focussed application, and notification/calendar/date/time area. It doesn’t really feel too much like an OS X clone, but it has a lot of similarities.

I have been using Unity for about three weeks exclusively at work and at home. Today I had to switch back to “Ubuntu Classic” i.e. stock Gnome 2 on my work PC, and here is why…

  • No panel applets
    • I wrote a little applet that gives you a menu that lists our PostgreSQL servers (15+), which opens a new Gnome Terminal and psql’s in to the right server with the right settings. Its really handy for my job and I really missed it and didn’t want to re-implement it.
    • The cpu/memory/disk usage applets help me keep a stable system especially when my software is misbehaving.
  • Grouping all windows in a single application makes it really hard to quickly jump to the right window. It makes maneuvering between windows at the level of multitasking I use more painful. With dual monitors it’s even worse.

I still may keep Unity on my home laptop because I don’t do as much multitasking and do find the layout more useful for home/casual use.

There are a few more annoyances in Unity that I ended up finding workarounds for:

  • It was not easy to configure the Unity dock/launcher. You can use CompizConfig Settings Manager under the Ubuntu Unity Plugin
  • By default, only select notifications show up in the notification area. This is broken. Here is how to fix it.
  • Gnome Do is much faster at launching applications and I have really grown to like and depend on it. You can fix it by changing the “key to show the launcher” in CompizConfig to something like <Shift><Super> instead of the default <Super>. The default <Super> keybinding overrides any keybinding using the <Super> key, thus <Super><Space> for Gnome Do.

Overall, I like Ubuntu Unity, but it over-simplifies the desktop too much for high-demand use cases.


A short KDE4 review from a long-time loyal Gnome user

This week I spent a short amount of time in KDE4. I have never been a regular KDE user, always hardcore Gnome, but every once in a while I like to check in with KDE to see what’s going on. It was really easy to setup in Ubuntu, just “sudo apt-get install kubuntu-desktop”.

Here is what I liked:

  • Awesome eye candy — It looks stunning.
  • Plasma — The new Plasma stuff does more than just look good, it seems like a great architecture for Desktop components.
  • Main Menu — Good design, intuitive.

Here are the reasons which sent me back to Gnome:

  • The biggest reason was that in general I am more used to the Gnome world.
  • I don’t like the KDE software suite that much, i.e. I prefer (or am more used to) the applications in Gnome like Gnome Terminal, Pidgin, etc.
  • The main menu was difficult to navigate backwards from sub-menus.
  • I love Gnome Do.
  • I am weirded out how all KDE apps are called KSomething.
  • I have a gnome panel applet that I wrote and use at work all the time. It lets me quickly jump to an sql terminal to a database. It would be a good test for writing a Plasma widget, but I didn’t have time.
So, in general, I like the direction KDE is going. They’re really pushing the technology with things like Plasma. I may check KDE4 out again for a more long-term stint. But I’m still, and will probably always be, a Gnome guy.

SSH data transfer trick

I’m surprised I haven’t figured this trick out yet, but I was kindof forced to when I got a new hard drive for my laptop, didn’t want to reinstall Linux, and didn’t have a lot of options. The only place I could back it up was on my local server. A usb-attached hard drive would probably be best, but I only had a network, so I needed to get the data to my server. Rsync might have worked, but I expect it would have taken a very long time. The best option would be to transfer a gzip’ed archive but I couldn’t save it locally then scp it. So I had to direct the output of tar/gz directly to the network. I’ve done a lot of things with ssh, but not this. What I found was the way scp handles stdin and stdout.

If you pass a command as a final argument to ssh it will execute the command remotely, but pipe stdin from the local terminal to the remote command and stdout from the remote command to the local terminal. So all I had to was execute a remote command to save stdin to a file on the remote system. This can be done via the command:

$ tar -cz . | ssh user@host "cat > file.tar.gz"

The tar -cz . says “create a gzip compressed archive of the current directory.” The | (pipe) says “take the output of the tar command and pipe it to the ssh command.” The ssh user@host “cat > file.tar.gz” command says “ssh to host as user and execute the command ‘cat > file.tar.gz'”. In cat > file.tar.gz, the cat command is there to properly catch and redirect the output and says “take my stdin and output it to stdout” and the > file.tar.gz says “direct the output of cat to the file file.tar.gz”.

The tar command gets us the gzip’d archive, the ssh command lets us pipe the output to a remote command, cat gives us a command that ssh can execute that takes the command input (the output of the tar command) and output that to a file.

Then once I have the backup and setup the new hard drive in my laptop I can restore the data using the command:

$ ssh user@host "cat file.tar.gz" | tar -xz

This does the same thing in reverse. It sshs to host as user and runs the command cat file.tar.gz which reads the file.tar.gz and outputs it to stdout. Then we capture that output and pipe it through tar, locally, which gunzips/untars the data to the current directory.

I could have also mounted a remote directory on my server using something like nfs, but I didn’t feel like taking the time to set that up.

This is a really neat example of stream manipulation in Linux. Hopefully you can learn something from it.

Note that I did all this from an Ubuntu Live CD so I wasn’t actively using my old hard drive (mounted readonly with mount -o ro /dev/sda3 /mnt/sda3) when I was backing up the data and so I could setup my new hard drive. The only other thing I had to do after I restored the data was to reconfigure grub, /etc/fstab, and /etc/ with the new UUID’s for the hard drive. I first had to use /dev/sdaX instead of UUID’s to be able to boot and find the UUID (I couldn’t find the UUID in the Ubuntu 7.10 live cd, I’m guessing because it was a little old, and I also didn’t feel like downloading and burning 8.10). Then I could configure the new UUIDs and reboot and all was good. Let me know if you would like more details on the UUID part.