Autotest Notifications in Ubuntu with Mumbles

7 10 2008

Autotest is a nice utility that automatically run your rails tests whenever you make a change to one of your source files. It is part of the ZenTest package from Ryan Davis.

It would be nice if you could be notified of the test results without having to switch to the terminal window running AutoTest. Some Mac users already found a way to do this using Growl. However, that only works if you have a Mac, and I don’t have one, so I figured out a way to do something similar in Ubuntu. Let’s get going.

Step 1: Install Mumbles

Mumbles is a ‘plugin-driven, modern notification system for Gnome’. It is very similar to Growl and even speaks the Growl protocol if you want to receive growl notifications on your Ubuntu/Linux desktop. Installing Mumbles is a breeze thanks to the deb package that you can download here.

Once installed, you can start Mumbles by going to Applications -> Accessories –> Mumbles. You will then see the Mumbles icon Gnome panel applet, as shown in the picture below:

Mumbles Icon in Gnome Panel Applet

Mumbles Icon in Gnome Panel Applet

You can right-click on the Mumbles icon, and edit the preferences. In particular, you can change the theme of your notifications. I like the mumbles-round theme.

Mumble Preferences

Mumble Preferences

If you do not want Mumbles to show up in your Gnome Panel applet, you can start it from a shell using the ‘mumbles -d’ command.

If you want Mumbles to be automatically started when you login, go to System –> Preferences –> Session. On the startup tab, add mumbles with the ‘mumbles’ command.

Step 2: Test Mumbles Installation

Mumble ships with a ‘mumbles-send’ utility. To test it out, type the following in your shell: mumbles-send --help As you can see, mumbles-send takes in a title and an optional message. Let’s try it out now: mumbles-send 'Testing Title' 'This is a test of mumble-send' You should see the notification in the top right of the screen:

Step 3: Installing AutoTest

Autotest is part of the ZenTest Ruby gem. To install it, run: sudo gem install ZenTest That’s about it. Now go to the RAILS_ROOT directory of your application, and run: autotest Autotest should start running your tests.

Step 4: Adding Autotest hooks to Mumbles

To have Autotest results show up as Mumbles notifications, create a file called .autotest and save it in your $HOME directory. Copy the following content into that file:

module Autotest::Mumbles
  def self.mumbles title, msg
    system "mumbles-send \"#{title}\" \"#{msg}\""
  end

  Autotest.add_hook :red do |at|
    errors = at.files_to_test.map { |k, v| "#{k}:\n #{v.join("\n ")}"}.join("\n\n")
    mumbles "TESTS FAILED", errors
  end

  Autotest.add_hook :green do |at|
    #res = at.results[/\d+ tests.*$/]
    res = at.results.scan(/Finished.*failures/m).to_s.gsub(/\e\[32m/,'')
    mumbles "TESTS PASSED", res
  end
end

Step 5: Verify everything is running smoothly

At this point, you should be done. Go back to your RAILS_ROOT directory and start autotest. It should now report whether the tests PASSED or FAILED via Mumbles, as shown below:

I hope this helped! Enjoy your Mumbles Autotest notifications





History Meme

18 04 2008

This meme has been going around so I’m just following along…

$ history | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head

106 c
100 l
61 cd
42 ls
28 b
26 sudo
24 cat
15 xrandr
11 ./dual_monitor.sh
9 e

A lot of these are aliases. c is my alias for clear, l for ‘ls -ltr’, b (as in back) for ‘cd ..’, e for ‘emacs’…

I spent some time recently setting up dual-monitors on my Ubuntu laptop which is why xrandr is there along with the dual_monitor.sh script. It works like a charm now. I’ll blog about my setup soon.





Interesting Linux Trends

1 01 2008

Just out of curiosity, I checked out Google Trends to compare some of the most popular Linux distributions, based on distrowatch.com. My findings were rather interesting: a stagnant or slightly downward slope for most popular distributions except for Ubuntu which has a very fast growth.

Linux Trends

Then I decided to compare Ubuntu to the other popular operating systems: Windows and Mac OS X.

Linux vs Windows vs Mac

Some interesting observations:

1) Linux popularity seems to be decreasing, based on the distros downward trends and the fact that the term linux itself is going down. However, Ubuntu is gaining popularity really fast.

2) Windows is by far the most popular operating systems, but it’s popularity is decreasing while Mac OS X and Ubuntu are gaining steam.

Of course, this should be taken with a grain of salt because this is far from a scientific study, but like we say back home, there is never smoke without a fire.





Ubuntu 7.10 New Features Look Good

28 09 2007

The Ubuntu community released the first beta of Ubuntu 7.10 today and the list of features is looking good.

I’m so excited about the following features:

Fully automatic printer installation NTFS writing (so happy about that one!!) Improved Power consumption with linux kernel upgrade (my laptop will love this)

Check out the list of features and if you have never tried Ubuntu yet, give it a try. When the final version of 7.10 comes out, it should be very very sweet.





Install Java On Ubuntu

21 09 2007

It is so easy to install Java on Ubuntu now. On Ubuntu 7.04 (Feisty Fawn), follow these steps:

1) Make sure you have the right repositories on your sources.list file.

Edit your sources.list file the following way:

sudo gedit /etc/apt/sources.list

or if you are not using gnome (e.g. you are logged in through ssh):

sudo nano /etc/apt/sources.list

If the following lines are not already there, add them:

deb http://us.archive.ubuntu.com/ubuntu feisty main restricted
deb http://us.archive.ubuntu.com/ubuntu feisty universe multiverse

Save the file (in nano use Control-O to save and then Control-X to exit).
Now you need to tell the package manager to update it’s database:

sudo apt-get update

2) Install Java using apt-get

I currently have both Java 5 and Java 6 installed on my machine and it’s very easy to switch between the two. Java 6 has some nice goodies such as JSR-223 and better jconsole that I like to use.

For Java 5:

sudo apt-get install sun-java5-jre sun-java5-jdk sun-java5-plugin

For Java 6:

sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin

There are other packages that you might be interested in:

sun-java6-demo sun-java6-doc sun-java6-source

3) Verify installation

Verify that you have the correct version of java running:

java -version

For example, on my machine (yes, I call it tiwouj):

Ubuntu Java Version

To see a list of the java versions that you have installed, you can use the following command (it’s a letter L at the end of the command):

update-java-alternatives -l

Here is my list:

Ubuntu Java List

This should show you a list of all the java alternatives you have installed. java-gcj is the free version of Java from the GNU project and comes installed by default with Ubuntu so you should see it. To switch to a different version, use the following command:

sudo update-java-alternatives -s <version-desired>

e.g:

sudo update-java-alternatives -s java-1.5.0-sun

Make sure it worked:

java -version

That’s it! How easy was that? You have to love apt-get.





Linux Mint: A Great Distro

28 06 2007

I got introduced to Linux Mint about 8 months ago while searching for a new distro on DistroWatch. I had already installed Ubuntu on my home desktop and really liked the package manager from Debian so I wanted to stick to a Debian or Ubuntu based distribution. So I gave Linux Mint a try, attracted to their proposal to make audio/video work out of the box.

8 months later… I’m glad I made the choice. Linux Mint has evolved a lot in these 8 Months. The first version I was using was called Barbara and they have since then released Bea, Bianca, and Cassandra. I am still using Bianca (I need to upgrade asap!).

The folks behind Linux Mint work hard to differentiate the distro from others. Rather than merely packaging different software like a lot of other distros, these folks have been working hard to write new tools and improve their community. I feel like they are pulling all the right strings and other distributions should follow their example.

On the community side, they of course have the basic: a good website, a good forum, and a wiki. However, they differentiated themselves from other distributions by adding the following:

A Newsletter published on their wiki a few times a month. This is great for folks who do not have time to go to the forum to learn what is new with the distro. One can simply read the newsletter when it comes out to see what is up with their favorite distro. Professional Support: if you want professional support, you can pay for it monthly or simply pay $5 if you have once incident. Great idea. You can buy a hosting package from Linux Mint for $30 a month. The Linux Mint Software Portal where one can install new software simply by browsing the portal and clicking. A magazine, mintMag, distributed via PDF. A soon to come podcast.

The Linux Mint development team also writes some very useful tools to make the distribution a breeze to use:

mintDesktop:utility to make your desktop a better place. mintWifi:a utility to quickly get your wifi working using Ndiswrapper. mint3D: “Mint3D is a configuration tool which will be included in Bianca. It’s purpose is to detect your graphic card, see what driver you’re using and if your 3d acceleration is enabled.. and depending on all of that, to either set up Xgl or AIGLX for you.. or to tell you that you can’t have 3D effects.” –clem Add-on CD: an add-on CD so that a user can download additional packages even if they do not have an internet connection. mintSpace:this is an idea that has not been implemented yet but it would be a great addition. I can’t wait for them to release it. Here is the description from clem: “Basically, you would have yet another folder in your Home… which would be a direct link to an online storage place on linuxmint.com. You could drag and drop files and documents in it and the FTP transfers would be done transparently.” -clem mintConfig: a utility to help you configure Linux Mint (a control center). mintDisk: a utility that automatically mounts NTFS partitions when you login. mintMenu: an improved menu. Remastersys: a script to create a livecd/dvd from a working Linux Mint install.

While none of these efforts are truly revolutionary, but I find it to be a very dynamic distro that is doing a lot of things right. If you want to switch from Windows to Linux, I would highly suggest using Linux Mint. It is easy to use, based on Ubuntu (so lost of information online when you encounter difficulties), and very appealing aesthetically.





Dell Now Sells Ubuntu Desktops

25 05 2007

Dell started selling desktops & laptops with Ubuntu. I am so excited about this. You can save up to $80 on a laptop if you get the Ubuntu version instead of the Windows Vista version on Dell.com. So finally, consumers no longer have to pay the Microsoft Tax.









You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser