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





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.








Follow

Get every new post delivered to your Inbox.