Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(’The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

July 14, 2008

Installing Grails in Ubuntu GNU/Linux Using Package Manager

Filed under: GNU/Linux, Groovy/Grails, Ubuntu — tabrez @ 3:21 pm

In my previous post I talked about setting up Grails development environment in GNU/Linux distributions by manually downloading the packages and configuring the environment variables. The main advantage of this method is that you can work with the latest versions of the Groovy and Grails packages available, and in fact, you can work with more than one version of these software at the same time: just point your environment variables to different locations. The procedure is also more or less independent of a particular GNU/Linux distribution.

An easier, alternative way to install Groovy and Grails packages is to use the package management system of your favourite GNU/Linux distribution. The trade-off is that you have to accept the version of the packages that are available in your distribution’s repositories(apt-get) or you may have to compromise with the stability of your system(dpkg). Below I am documenting the procedure to install Grails development environment using package manager tools in Ubuntu 8.04(Hardy Heron).

  1. Installing Sun JDK 6 in Ubuntu 8.04 Using apt-get/aptitude

    In Debian/Ubuntu based operating systems installing new packages is as simple as running aptitude command with the package name.

    # sudo aptitude install sun-java6-jdk

    You also need to set JAVA_HOME environment variable in your preferred profile file(/etc/profile, $HOME/.profile or /etc/environment):

    JAVA_HOME=/usr/lib/jvm/java-6-sun

    Refer to the first step of previous post in my Grails series if you need more help.

    1. Installing Groovy in Ubuntu 8.04 Using apt-get/aptitude

      To install Groovy and its dependency packages, run the following command in a command shell:

      # sudo aptitude install groovy

      You can also install Groovy from Synaptic Package Manager, simply search for package name called “groovy” in it. But have a look at the version number!

      Synaptic Package Manager shows an old version of Groovy package in Ubuntu 8.04 package repository

      See what I mean? The latest stable version of Groovy is 1.5.6 though I would recommend using the 1.6 beta 1.

    2. Installing Groovy in Ubuntu 8.04 Using GDebi

      If you don’t mind picking up a deb file from a third-party source, Groovy download page has Debian/Ubuntu packages for both 1.5.6 stable version and 1.6 beta 1 version.

      Groovy latest stable version for Debian/Ubuntu family of GNU/Linux distributions available as a deb package.

      When you download the Ubuntu deb binary from this page Ubuntu will automatically open it using GDebi and install it for you.

      Download the Groovy deb package from its download page and install it with GDebi application.

    3. Installing Groovy in Ubuntu 8.04 Using dpkg

      You can also save the deb file on your computer and install it from the command shell using the dpkg tool:

      # sudo dpkg -i <name-of-the-downloaded-deb-file>
    1. Installing Grails in Ubuntu 8.04 Using apt-get/aptitude

      Unfortunately there is no Grails package in Ubuntu official repositories yet. You can try any unofficial repositories for Grails available on the Internet but only if you trust them. An old repository meant for installing Grails 1.0 RC2 on Ubuntu Gutsy was posted on Ubuntu Forums by prach. Have a look at it just as an example, I don’t recommend actually using it. I don’t know of a similar repository for more recent versions of Grails. So better option will be to install the latest deb package of Grails using GDebi or dpkg tools; see the next step.

    2. Installing Grails in Ubuntu 8.04 Using GDebi

      You can follow the above procedure(Step 2(b)) used for Groovy to install Grails too, by downloading its deb package from Grails’s download page.

      Download the Groovy deb package from its download page and install it with GDebi application.

      Then choose to open the package with GDebi installer.

      Download the Grails deb package from its download page and install it with GDebi application.

    3. Installing Grails in Ubuntu 8.04 Using dpkg

      You can also save the deb file on your computer and install it from the command shell using the dpkg tool:

      # sudo dpkg -i <name-of-the-downloaded-deb-file>
  2. You can now go to the post where I show how to create a basic “Hello, World” Grails application to test your Grails configuration. (You can ignore the first step of that post.)

Summary:
To summarize, you can install Sun JDK, Groovy and Grails packages in Debian/Ubuntu family of distributions using simple commands, like this:

# sudo aptitude install sun-java6-jdk
# sudo echo ‘JAVA_HOME=/usr/lib/jvm/java-6-sun’ >> /etc/profile
# wget http://dist.codehaus.org/groovy/distributions/installers/deb/groovy-1.6-beta-1.deb
# sudo dpkg -i groovy-1.6-beta-1.deb
# wget http://ant-deb-task.googlecode.com/files/grails_1.0.3-1_all.deb
# sudo dpkg -i grails_1.0.3-1_all.deb

You can use similar commands/tools for other GNU/Linux distributions, like yum in Fedora, yast in openSUSE, emerge in Gentoo, etc. All the above download links point to the latest versions at the time of this writing, so remember to change them appropriately when updated versions are released.


If you want to receive future posts by email, enter your email address here:

Related Posts:

  • Setting Up Development Environment For Grails on GNU/Linux
  • Creating “Hello World” Web Application Using the Grails Framework
  • Setting Up Development Environment For Grails on Windows Vista/XP
  • Setting Up Rails Development Environment on Ubuntu GNU/Linux
  • Installing Complete LAMP Stack on Ubuntu 6.10(Edgy Eft)
  • Installing C#/Mono(.NET)/MonoDevelop/XSP in Ubuntu Gutsy Gibbon(7.10)
  • ‘wget -c’ Bug in Download Script Generated by Synaptic in Ubuntu 7.10(Feisty Fawn)

  • July 10, 2008

    Setting Up Development Environment For Grails on GNU/Linux

    Filed under: GNU/Linux, Groovy/Grails, Java, Web — tabrez @ 2:32 pm

    In couple of my previous posts, I have explained how to install Grails and required packages to get a Grails development environment on the Windows platform. Continuing the Grails series, the current post explains how to set up a development environment for Grails web application framework on a GNU/Linux distribution. An alternative easier but less flexible method is noted to at the bottom of the post.

    To setup Grails development environment on your GNU/Linux box, you first need to install Java SDK and Groovy packages.

    1. Install Sun Java SDK 6 according to the instructions for your GNU/Linux distribution.

      1. For example, in Ubuntu you can install it like this:
        • Make sure that the multiverse respository is enabled. Go to System -> Adminstration -> Synaptic Package Manager.
        • In Synaptic Package Manager, go to Settings -> Repositories.
        • Enable the multiverse repository if not already enabled.
          Enable multiverse and universe repositories in Ubuntu GNU/Linux to see all installable packages.
        • Click the Close button. Click Reload button on the toolbar to reload the package list.
        • In Synaptic Package Manager, search for the “jdk” package(use Edit -> Search or Search button on the toolbar).
          Search for Sun JDK 6 package in Synaptic Package Manager in Ubuntu GNU/Linux.
          Scroll down the result list until you find Sun JDK 6 package, then right-click on it and select “Mark for installation.”
          Mark Sun JDK 6 package in Synaptic Package Manager for installation.
          Click the Apply button on the toolbar to install the Sun JDK package.

        You can also install it from the command line in one simple step:

        # sudo aptitude install sun-java6-jdk

        You can similarly use ‘emerge’ command in Gentoo, ‘yum’ command in Fedora GNU/Linux distributions. You can also simply download the compressed Sun JDK 6 binary archive for GNU/Linux, uncompress it in the home directory and set its bin directory in the PATH environment variables. For more information, read Sun’s JDK 6 installation notes for GNU/Linux(Yes, it’s ugly).

      2. To confirm that Java is installed and available in the system path, run the following commands:
        tabrez@tabrez-ubuntu-vm:~$ java -version ; javac -version
        java version “1.6.0_06″
        javac 1.6.0_06
      3. Create a new system environment variable in your profile file (e.g. $HOME/.profile or /etc/.profile or /etc/environment - whatever you prefer the most) called JAVA_HOME and set it to your Java SDK installation directory path.

        export JAVA_HOME=/usr/lib/jvm/java-6-sun/

        Run the source command to apply the profile changes to the environment immediately without needing a session or OS restart.

        # source $HOME/.profile
        # echo $JAVA_HOME
        /usr/lib/jvm/java-6-sun/
    2. Download and configure Groovy package.

      Download the stable version of Groovy package.
      Download the compressed archive package of Groovy from its download page to your home directory and uncompress it.

      #cd $HOME
      # wget http://dist.groovy.codehaus.org/distributions/groovy-binary-1.5.6.zip
      # unzip groovy-binary-1.0.2.zip
      # mv groovy-binary-1.0.2 grails

      (Remember to download the latest stable version available on the Groovy download page.)

      Create GROOVY_HOME environment variable in your profile file(just like you created the JAVA_HOME variable) and set it to the directory where you have uncompressed the Groovy package. Add Groovy’s bin directory to the PATH environment variable

      export GROOVY_HOME=/home/tabrez/groovy/
      export PATH=$PATH:$GROOVY_HOME/bin

      Check the version of Groovy.

      # groovy -v
      Groovy Version: 1.5.6 JVM: 10.0-b22
    3. Download and configure Grails package.

      Download the stable version of Grails package.
      Download the compressed archive package of Grails from its download page to your home directory and uncompress it.

      #cd ~
      # wget http://dist.codehaus.org/grails/grails-bin-1.0.3.zip
      # unzip grails-bin-1.0.3.zip
      # mv grails-bin-1.0.3 grails

      (Remember to download the latest stable version available on the Grails download page. You can also download the compressed tar version(.tar.gz) if you don’t have the unzip command installed on your distribution.)

      Create GRAILS_HOME environment variable and set it to the directory where you have uncompressed the Grails package(just like you created the JAVA_HOME variable). Add Grails’s bin directory to the PATH environment variable.

      export GRAILS_HOME=/home/tabrez/grails/
      export PATH=$PATH:$GROOVY_HOME/bin:$GRAILS_HOME/bin

      Make the grails command executable and check the version of Grails.

      # cd $HOME
      # chmod +x grails/bin/grails
      # grails -v
      Welcome to Grails 1.0.2 - http://grails.org/
    4. Testing the Grails Development Environment on GNU/Linux.

      Now go to the post that explains how to create a Grails “Hello, World” web application to test if your Grails development environment is properly setup. It is for the Windows platform but I think that you should be able to adapt it to other platforms too. If you get into any problems, check if all the environment variables are properly set.
      Make sure that you have setup the JAVA_HOME, GROOVY_HOME, GRAILS_HOME environment variables correctly to get working Grails development environment.
      You can also post the error messages that you are getting somewhere on the Internet and provide the link to it in the comment section below.

    5. Next: Alternative easy way to set up Grails development environment using package managers

      There is also an easy way to setup Grails development environment using the package managers of different GNU/Linux distributions. Like installing Groovy and Grails packages in Ubuntu using the apt-get command. This easy model has certain limitations though like support only for old versions of Java, Groovy and/or Grails. I will discuss more about it in the next post. Done.


    If you want to receive future posts by email, enter your email address here:

    Related Posts:

  • Creating “Hello World” Web Application Using the Grails Framework
  • Installing Grails in Ubuntu GNU/Linux Using Package Manager
  • Setting Up Development Environment For Grails on Windows Vista/XP
  • Setting Up Rails Development Environment on Ubuntu GNU/Linux
  • C++ Development Environment on Windows using Eclipse Ganymede and Nuwen MinGW
  • Wascana is Eclipse Based Standalone C++ IDE for MS Windows
  • Setting Up C++ Development Environment on Windows with EasyEclipse and MinGW

  • July 4, 2008

    Free Software Community Catching Up to Social Networking Trend

    Filed under: GNU/Linux, General, Web — tabrez @ 8:37 pm

    The Free software community has never lagged too behind in any technological development field leaving it completely to the closed platform and service providers to rule the market. The first good GPL software that I came across many months ago targeting the social networking domain was Elgg. I liked it, yes, but more importantly, it confirmed the fact that, it may happen late, but the open source community will sure catch up with the new technology domains eventually if they show the potential to become popular and useful.

    Another Free software product that I came across today was Laconi.ca and it powers the microblogging service called Identi.ca.

    Identi.ca is a microblogging service. Users post short (140 character) notices which are broadcast to their friends and fans using the Web, RSS, or instant messages.

    So Identi.ca is a microblogging service like Twitter, Jaiku and Plurk. Yes, yet another micro blogging service you may say. But is there anything new? From Identi.ca’s FAQ:

    Our main goal is to provide a fair and transparent service that preserves users’ autonomy. In particular, all the software used for Identi.ca is Free Software, and all the data is available under the Creative Commons Attribution 3.0 license, making it Open Data.

    The software also implements the OpenMicroBlogging protocol, meaning that you can have friends on other microblogging services that can receive your notices.

    This is huge. The support for OpenID based login itself had impressed me in no time. Then the whole service runs powered by Free software. It uses the OpenMicroBlogging protocol which means that the other similar services can easily interact with it and the users don’t have to create different accounts with different services leading to isolated communities. (And we have to recourse to poor integration alternatives like Ping.FM and HelloTxt.com).

    The service is in its infancy still, so use it only if you want to get a feel of it or submit bug and feature requests to help improve the product. Look at the roadmap to and tell me if you are impressed or not. To host it on your own server/domain, you can download laconi.ca source code from its darcs repository(a tar ball is also available). To see an example of laconi.ca being hosted on a private server, go to Foozik.

    [ I was not able to login to Foozik.com using my OpenID account though. I wonder if it was intentionally disabled or if there was a glitch in the service. Russell Beattie, the guy who installed Laconi.ca on Foozik.com, also explains why the current architecture of laconica/identi.ca is not scalable. (Also reproves Twitter.com) ]

    Another open source social networking software written using Ruby on Rails framework is RailsSpace, which was originally created as part of the book RailsSpace: Building a Social Networking Website with Ruby on Rails. [ Sidenote: Excellent write-up on how to upgrade Rails applications to Rails 2.1 version: A Rails 2.1 case study: upgrading the Insoshi social networking platform ]

    Elgg is another open source social networking web application software that is closer to Facebook in functionality than Twitter. You are supposed to download it and install it on your server. Lot of educational institutes are reportedly using this software.

    Mugshot is RedHat’s hosted social networking service. I don’t know how easy it is to get its source code and install it on a private server.

    Didn’t satisfy your palate yet? Check the list of 10 open source social networking[1] software on Mashable.com. So see you at Identi.ca, let’s turn the heat on!

    [1] term used in the broadest sense of its meaning


    If you want to receive future posts by email, enter your email address here:

    Related Posts:

  • Posting to Identi.ca From Ubuntu 8.04 Using Gwibber Client
  • PC World’s Humorous Piece On Microsoft, Google, Yahoo’s Beta Services
  • SixApart’s Vox Is Blogging With Community Feel
  • About
  • Get Free GNU/Linux(Fedora, SUSE etc) CDs Delivered Anywhere Around The World
  • What do you plan to do on the Software Freedom Day(Sep 15th)?
  • Host Your Projects On Internet Using Google Project Hosting

  • June 19, 2008

    Wordpress Upgrading Experience With Automatic Upgrade Plugin

    Filed under: GNU/Linux — tabrez @ 9:28 pm

    Finally took the bite and tried out the upgrading process of my Wordpress blog using the Wordpress automatic upgrade plugin. Tried it directly with my main blog with not even a single test run before this.

    Wordpress Automatic Upgrade allows a user to automatically upgrade the wordpress installation to the latest one provided by wordpress.org using the 5 steps provided in the wordpress upgrade instructions.
    The whole process was relatively smooth and void of many surprises. I wish that the output messages from each test were accumulated together and displayed somewhere(a right sidebar?) so that it gives some structure to the upgrade progress and also keeps links to important downloads always visible.

    The place the plugin broke-down was when re-activating all the plugins once the upgrade process was complete. I got the error message asking me if I am sure repeat the action. It never budged even an inch from there, so I quit it and activated all my plugins one by one manually for almost fifteen frustrating minutes. Reason? Wordpress doesn’t only takes its own time but also refreshes the whole page for every plugin activation. Why not do the operation asynchronously? At least the location on the page where I am working will not be lost this way, saving me the constant scrolling.

    My one complain with the Wordpress Automatic plugin is that it doesn’t allow my own Wordpress archive to be uploaded and used instead of the “latest” version automatically downloaded from Wordpress.org. It’s a good default value for those who can’t be bothered but I would definitely like to use a Subversion Wordpress package for my blog. I have been using the svn install method for over an year and it makes the minor upgrades such a breeze that I got totally used to it. And in one fluid motion, automatic upgrade plugin replaced my svn install with the normal one before I could realise what I was going to lose.

    I also realised that there is only “Deactivate All Plugins” link on the “Plugins” page where as I would like to see a “Remember Currently Active Plugins and Then Deactivate All Plugins” option so that we can restore the previously active ones with a single click.


    If you want to receive future posts by email, enter your email address here:

    Related Posts:

  • Upgrading to Wordpress 2.3 with Zero Downtime!
  • My First Wordpress 2.3 Update Notification and Subversion Upgrade
  • How I Upgraded to Wordpress 2.3 on Live Blog With Zero Downtime
  • Wordpress Plugin and Theme Cheatsheets
  • What is New in Wordpress 2.3 (Beta 1/2)?
  • Why I Moved My Blog From Wordpress.com
  • Ubuntu 6.10 Annoyance: `failed to initialize HAL` error

  • November 21, 2007

    Accessing GNU/Linux & Windows Desktop Remotely From Nokia N800 Using VNC Viewer

    Filed under: GNU/Linux, N800 — tabrez @ 6:27 pm

    It’s easy to control the desktop of your computer from a Nokia N800 Internet tablet. If the computer is running a GNU/Linux distribution, you can run a VNC server on that computer and then connect to it from N800 through an application like VNC Viewer. You can do the same if the computer is running either Windows or Mac OS operating system too, but they also support their own native remoting protocols - Windows supports RDP protocol and Mac supports ADP protocol - which are generally, though not in all cases, considered to be better options over VNC. You can learn more about the differences between VNC and other native protocols like RDP and ADP over the Internet.

    If you decide that you want to use RDP to connect to a Windows machine, then read How to Access the Windows Desktop Remotely From Nokia N800 Using rDesktop.

    Here is the summary of what we have to do in order to get VNC working: 1) install a VNC Server on the computer running Windows or GNU/Linux OS; 2) install VNC Viewer application on Nokia N800 Internet tablet; and 3) configure/run VNC Server and VNC Viewer to connect them together. So let’s get started.

    Installing and configuring VNC Server on a Windows Computer

    You can download and install any VNC server available for the Windows platform but I am going to use TightVNC server as the example here.

    Our first step is to download the TightVNC server from its website. Either a) download the “setup.exe” version and install it by running it and going through the installation wizard, or b) simply download the “zip” version highlighted in the screenshot below, extract it in a directory and run “WinVNC.exe” from the extracted directory.

    Download TightVNC Server for Windows

    In the properties window that is shown when you run it, erase whatever is present in the password text fields and enter your own password (twice) in them, and then click OK. Make sure that you remember this password!

    Run TightVNC Server on Windows

    That completes the server side configuration.

    Installing and configuring VNC Server on a GNU/Linux Computer

    Most GNU/Linux distributions come with a VNC server pre-installed so this step is not required in most of the cases. If you are using the GNOME desktop, go to System -> Preferences -> Remote Desktop. In the opened dialog box, select the settings as shown in the screenshot below. Remember the password that you enter in this dialog box.

    Configure Remote Desktop on GNOME in GNU/Linux

    If you are using the KDE desktop, go to KDE (start button) -> Internet -> Krfb Desktop Sharing. You basically need to search for Krfb Desktop Application in whichever menu your distribution might have placed it. Click “Configure” and select the settings as shown in the screenshot below:

    Configure Remote Desktop on KDE in GNU/Linux

    If the above mentioned VNC Servers are not available on your GNU/Linux system, you can search your package manager or search one for your distribution over the web and install the one that you like. TightVNC server is one example that can be installed on almost all the platforms.

    Installing VNC Viewer on Nokia N800

    If the Maemo Extras repository is already added in your repository settings, you can install VNC Viewer from the Application Manager. If not(or you don’t know what repositories are), go to the website of VNC Viewer(from N800’s web browser) and click on the Single-click install file link for your tablet version(N770 or N800).

    Install VNC Viewer client on Nokia N770/N800

    It should then be downloaded and installed on your tablet(answer OK/Yes whenever you are prompted to).

    Connecting to your computer remotely from Nokia N800

    The first thing we need to do now is to find out the IP address of your computer. Open a terminal/command prompt and run “ifconfig” as root on GNU/Linux or “ipconfig” on a Windows machine. On Fedora you may have to run “/sbin/ifconfig”. Example output on a Gentoo machine:
    Note IP address on GNU/Linux or Windows machine

    Note the IP address of your computer from the above output. You can run the VNC Viewer application from the Extras application menu.

    Run VNC Viewer on Nokia N770/N800 from Extras application menu

    When you run it, it will ask you for the IP address of the computer you want to connect to. Enter the IP address as shown in the following screenshot(substitute the IP address of your computer):

    Enter IP address of remote machine in VNC Viewer client on Nokia N770/N800

    The format used to to connect to a GNU/Linux system is IP-Address:Display-number as shown in the screenshot i.e. 192.168.2.10:0; 0 is the display number here(the VNC Server will show you this display number; see the “Remote Desktop Preferences” screenshot above). To connect to a Windows machine, just enter the IP address like “192.168.2.10″(without the quotes). If all goes well you should be seeing the desktop of your computer displayed within the window of VNC Viewer on your tablet:

    Desktop of Ubuntu displayed on Nokia N770/N800 in VNC Viewer client

    Well done! Here are more examples of how the desktop of a computer looks on the N800 tablet:
    Ubuntu on N800 in fullscreen mode
    Gentoo on N800
    Windows on N800
    Kubuntu on N770

    Additional Notes

    When accessing the desktop of your computer from Nokia N800, you do not have the access to N800’s on-screen keyboard. You can use the the keyboard of your PC if yours is a wireless one, but obviously it needs to be in the range of your PC to work. If you have a bluetooth keyboard that you have paired with N800, then it’s party time for you!

    VNC access is usually slow on Windows systems(that’s why we use RDP). You can take several steps to make the experience more satisfactory:

    1. Disable the background image on your XP/Vista machine or just configure VNC server to disable the background image whenever someone remotely connects to it.
    2. Configure TightVNC server to refresh only the window under focus or window under the mouse.
    3. Experiment with other VNC servers. Examples are RealVNC, UltraVNC.
    4. I have heard from my friends that installing DFMirage on their XP machines made the experience better. I couldn’t test it as it is not yet totally supported on Vista operating system. In an email response, DemoForge’s CEO informed me that the next version due in a week or so will support both 32-bit and 64-bit Vista editions.

    Now you can control the file downloads, select the music to play, or whatever that you would like to manage remotely, from the comforts of your bed/sofa. There is a lot more that you can achieve through VNC remoting but I hope this primer will help in getting you started.


    If you want to receive future posts by email, enter your email address here:

    Related Posts:

  • Connecting To Nokia N800 From a Computer Using VNC
  • Accessing the Windows Desktop Remotely From Nokia N800 Using rDesktop
  • Different Ways of Taking Screenshots in Nokia N800
  • Microsoft’s Mobile PC Newsletter Features Linux-enabled Nokia N800
  • Accessing UPnP Streamed Media in Nokia N800 using MediaStreamer
  • Woohoo! Nokia N810 Internet Tablet is Here!
  • MH Shot Tool Can Now Take Delayed Screenshots of Nokia N800

  • Next Page »

    Copyright (c) 2006, 2007 Tabrez Iqbal.
    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


    Powered by WordPress
    This website is hosted by Dreamhost