Autotest Notifications in Ubuntu with Mumbles
7 10 2008Autotest 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:
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.
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
Comments : 1 Comment »
Tags : autotest, Linux, rails, Ruby, Ubuntu
Categories : Linux, Ruby, Ubuntu, rails
History Meme
18 04 2008This 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.
Comments : No Comments »
Categories : Linux
Interesting Linux Trends
1 01 2008Just 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.
Then I decided to compare Ubuntu to the other popular operating systems: Windows and Mac OS X.
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.
Comments : 1 Comment »
Categories : Linux, Ubuntu
Ubuntu 7.10 New Features Look Good
28 09 2007The 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:
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.
Comments : No Comments »
Categories : Linux, Ubuntu
Install Java On Ubuntu
21 09 2007It 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:
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):
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:
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.
Comments : 7 Comments »
Categories : Java, Linux, Ubuntu
Linux Mint: A Great Distro
28 06 2007I 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:
The Linux Mint development team also writes some very useful tools to make the distribution a breeze to use:
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.
Comments : No Comments »
Categories : Linux
Dell Now Sells Ubuntu Desktops
25 05 2007Dell 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.
Comments : No Comments »
Categories : Linux











