Screencast: Install Google Wave Server

29 07 2009

In this screencast, I show you how to install the reference server implementation of the Google Wave Protocol, which was released by Google recently. To learn more about Google Wave, visit wave.google.com.

Install Google Wave Server Video

The audio on the Vimeo version of the video is not as good as the original Video which you can download here:

Note: This is my first attempt at creating a screencast so excuse the mumbling and incomplete sentences. I’ll get better with practice :-)

Resources:

Wave Protocol Wiki

make-cert.sh script

OpenFire

Wave Protocol

Google Wave

I recorded the screencast on my Ubuntu laptop, using the same setup as Remi.





Install monit from source on Ubuntu

5 05 2009

The Ubuntu package for monit is way out of date on Hardy (8.04 LTS): the package is at version 4.8.1 when the latest version of monit is 5.0.1. Even the Jaunty package is only at version 4.10. There are additional features such as remote mail servers that you cannot use on 4.8.1. Another issue with using the old monit package on Ubuntu is that it is out of sync with the monit documentation.

This post will show you how you can install monit from the latest source on Ubuntu Hardy.

First, we’ll use a dirty trick to obtain some Ubuntu init scripts for monit: we’ll install monit using apt-get and then remove it. In the process, the monit init scripts will not be deleted and we will be able to use them with our fresh install of monit from source.

sudo apt-get install monit

After installing, make sure that the following files are present: /etc/init.d/monit, /etc/default/monit and /etc/monit/monitrc (that’s the whole reason why we are installing monit from the package after all. Once we’ve got that file, we can simply remove the package:

sudo apt-get remove monit

Cool now we have an init script and our config files. We will modify them later to work with our new monit install

Before downloading the monit source, let’s install a few dependencies

sudo apt-get install libssl-dev bison flex

Now, get the latest monit package from their download page and untar it:

wget http://mmonit.com/monit/dist/monit-5.0.1.tar.gz
tar xzvf monit-5.0.1.tar.gz
cd monit-5.0.1

OK. You are not ready to build and install the source

./configure

Watch the output and if everything went smoothly, then:

make
sudo make install

At this point you should have the latest and greatest version of monit installed. Let’s verify that:

monit -V

It should print:

This is monit version 5.0.1
Copyright (C) 2000-2009 by Tildeslash Ltd. All Rights Reserved.

Almost there, we just need to make a couple of small changes to the init script. Find the following lines in /etc/init.d/monit (should be way on top):

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/monit

… and replace them with:

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DAEMON=/usr/local/bin/monit

Now open up /etc/default/monit and find startup=0. Replace that with startup=1 and save the file.

You can now modify your config file located at /etc/monit/monitrc as you see fit. Once you are done, verify that the config file is OK:

sudo monit -c /etc/monit/monitrc -t

If the syntax of your file is ok, you are ready to start monit:

sudo /etc/init.d/monit start

That’s It I hope this helped!





Ubuntu Notifications using libnotify-bin

23 11 2008

Did you ever need to have one of your shell script notify you of something? Do you want to learn a quick way to do this in Ubuntu? Then read this.

I wrote a script that backs-up all my files to Amazon S3 using jets3t‘s synchronise tool. It works very well for me. Last week, my laptop got busted: I was upgrading to Ubuntu 8.10 and it overheated and shut down at a bad time (in the middle of the install). I couldn’t boot it after that. Luckily, I had backed up all my files to S3, so I was able to reinstall Ubuntu 8.10 from scratch and recover all my backed-up files. 3 hours later, I was up and running running Ubuntu 8.10 with all my files recovered.

However the point of this post is about notifications from a shell script. See, when I synchronise my files with S3 it takes some time and I would like to get alerted when everything is done backing up, so I needed a way to do that from my bash script.

Here is a quick way to do it on Ubuntu:

  1. Install libnotify-bin:
  2. sudo aptitude install libnotify-bin

  3. Learn how to use notify-send:
  4. notify-send --help

  5. In your scripts, just use it like this:
  6. notify-send 'title of notification' 'body of notification'

Your notification will now show up on your desktop like this:

notify-send

There you go, pretty simple, but very useful in your scripts.





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








Follow

Get every new post delivered to your Inbox.