• Home
  • About Me
  • Musings
  • Programming
  • Computers
  • Open Source
  • Society
  • Books
  • Design
  • Movies
  • Ubuntu Panel Missing!

    When I logged into the machine today, I was shocked to see no panel appearing on the ubuntu desktop. I thought the computer has hung. But when I right clicked the desktop, I got the regular pop-up menu and was able to change desktop wallpapers.

    Here is what I did to get the panel back. With the desktop without the panel and not remembering any of the shortcuts, it was quiet difficult.

    First, I created a launcher for Terminal. Right Click on any area on the desktop and then choose ‘Create Launcher’. Choose any name and then in the command text box, type in

    terminal

    This should create a terminal launcher. That done, double click to open a terminal session. Enter the following command,

    killall gnome-panel

    Then right click on the desktop to create another launcher. This time in the command text box, type in

    gnome-panel

    This creates a gnome-panel launcher. Double click and viola! you have the Panel.

    What does it mean to be Free?

    Here is a nice video on what we mean, when we say Free…

    Rake Migrate – Aborted!

    Trying out a sample application using rails, I faced a problem, getting the database tables created (migrated) using ‘rake’. Running the command

    1
    
    rake migrate

    threw the following error

    1
    2
    3
    4
    5
    
    (in /home/rajesh/Programming/rails/todolist)
    rake aborted!
    Don't know how to build task 'migrate'
     
    (See full trace by running task with --trace)

    The search on internet forums only said that ‘rake migrate’ should do the job, but to no avail.

    The actual command to get the tables created is

    1
    
    rake db:migrate

    Hope this helps!

    Installing LAMP in Ubuntu

    Following are the steps to get Apache, MySQL and PHP installed on a Ubuntu system.

    Installing Apache:

    In the terminal window issue the following command

    1
    
    sudo apt-get install apache2

    To test if Apache has installed successfully, open a browser and browse to http://localhost. A message “It works” will be displayed.

    Installing PHP

    In the terminal window issue the following command

    1
    
    sudo apt-get install php5 libapache2-mod-php5

    Once the installation is complete, to get php working, restart apache server by issuing the following command

    1
    
    sudo /etc/init.d/apache2 restart

    To test that PHP has been successfully installed, quickly create a test PHP script

    1
    
    sudo gedit /var/www/test.php

    In the gedit window, type a script and save the file

    Open up a browser window and open the test.php file created. The PHP application environment information will be displayed.

    Installing MySQL

    In the terminal, run the following command

    1
    
    sudo apt-get install mysql-server

    That should get mysql installed. You will be prompted for a ‘root’ db user password. Enter it.
    To test mysql, in the terminal issue,

    1
    
    mysql -u root -p

    Enter the root user password for mysql server. You will be launched into the mysql prompt.

    Installing phpMyAdmin

    To install phpMyAdmin, issue the following command at the terminal

    1
    
    sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

    To test phpmyadmin, open a browser and navigate to http://localhost/phpmyadmin.
    Thats it!

    Free!

    Free, I have broken free, free from proprietary software in my personal life.

    I have decided to use only software that are free. Making that move wasn’t that easy, got to leave the comfort of Windows and MS Office, the one’s I have been used to since I started using computers. I have not broken free from the entire MS world of software, coz I make my living coding in C#, I have a Express Edition of Visual Studio for the learning that is needed to keep me hands-on up-to-date on the technology.

    For office suite, I have resorted to OpenOffice 3. It does the job well for me. Chrome for a browser and NetBeans IDE for development is all I need. It is a nice feel to be just using free software, at least I know I have not stolen other’s money. I respect another software engineer, for his work.

    Here is a nice quote, from the famous film, The Shawshank Redemption where Morgan Freeman says,

    “Some birds aren’t meant to be caged, their feathers are just too bright, and when they fly away… the part of you that knows it was a sin to lock them up does rejoice…” – The Shawshank Redemption.

    I feel I’m one of those birds which is not supposed to be caged, and I have grown one feather that is going to help me in my flight..

    Rails: Error with MySQL in welcome screen

    After installing rails, to test it, I created a rails application using the following command at the command prompt.

    1
    
    rails -d mysql todolist

    Pointing to http://localhost:3000 displayed the expected Welcome message.

     

    Welcome Message

    Welcome Message

    But then clicking on the About your application’s environment displayed a error message like below.

     

    Error in Rails

    Error in Rails

    That’s the least thing I expected. Digging into the development.log file located in the project log directory, displayed the actual error message, “Client does not support authentication protocol requested by server; consider upgrading MySQL client”.

    Looking into the web for help, the problem with the way rails (as a client) was trying to access MySQL server. Rails uses a old password hashing used in MySQL 4.1, and the current version that I am running is MySQL 5.0. This had caused the error. The fix is running the following script in mysql prompt.

    1
    
    mysql> SET PASSWORD FOR 'railsuser'@'host' = OLD_PASSWORD('password');

    That fixes it and you would get the following screen.

    Success message

    Success message

    Rails Installation

    Installing Rails needs a lot of patience. The command is simple “gem install rails”. But it is a resource hungry and a time consuming installation.

    I started the installation at 00:00:00 HRS and it is 03:22:23 HRS now and the installation is still going on.

    And look at the memory footprint of the ruby program that is installing rails.

    Mem footprint

    Mem footprint

    And here is the Performance Statistics:
    Performance Stats

    Why is an installation taking such a long time?

    Configuring ThunderBird 2.0 for Gmail App Account

    After fiddling around for half an hour, here is how I got to configure Thunderbird as client for Gmail App Account.

    1. Enable IMAP in Gmail App Mail Settings.

    2. In Thunderbird, select Tools -> Account Settings.

    3. Select Add New Account.

    4. In the New Account Setup dialog, Select Email Account. Click on Next.

    5. Set Your Name and Email Address in the Next Step. Click on Next.

    6. In the Server Information, Select the type of incoming server as IMAP.

    7. Enter the incoming server name as imap.googlemail.com (for outside US and imap.gmail.com for US).

    8. Enter the outgoing server name as smtp.googlemail.com (for outside US and smtp.gmail.com for US). Click on Next.

    9. Enter the Incoming User name as your email address (user@domain). I used raasukutty@raasukutty.com.

    10. Enter the Outgoing User name as your email address. (e.g. raasukutty@raasukutty.com).

    11. In the Account Settings Window displayed (Tools -> Account Settings), for the Server Settings, verify that the port number is 993.

    12. In the Outgoing Server, set Port Number as 587, and for Use Secure connection, set TLS.

    13. Now click on the Inbox. You will be asked for the password. And that completes it.

    How to open, extract and use RAR files in Ubuntu

    Archive Manager in Gnome does not support .rar files by default.

    To use .rar files in Ubuntu/Debian, type the following lines in the terminal.

    1
    2
    
    sudo apt-get install rar
    sudo ln -fs /usr/bin/rar /usr/bin/unrar

    Then use the Archive Manager to compress and uncompress RAR files.

    Continuous Integration with CruiseControl.Net

    I had challenges in understanding the documentation for installing and configuring CruiseControl.Net with StarTeam as the souce control in a Vista system running IIS 7. Finally I have successfully set up cruise control to work. I am listing the steps to get it working.

    Step 1:Grab a copy of CruiseControl.Net from here. Run the setup. As a part of the install, the setup installs the ccnet server and a webdashboard.

    Step 2:Once installed, to get the webdashboard up and running, fire your browser and type. http://localhost/ccnet (this is the default virtual directory on install. This points to the $InstallFolder/webdashboard folder in your build server. If the system is running IIS5 or 6, then you will see a CruiseControl.Net page, in IIS7, an 500 error is thrown. To resolve this issue, proceed to Step 3, if no issue was encountered, proceed to Step 4.

    Step 3:Run the followin command as an administrator. Note: Here ccnet is the virtual directory which points to the physical location of webdashboard in the system.

    %SystemRoot%\system32\inetsrv\appcmd migrate config "Default Web Site/ccnet"

    Once the command is run, then just restart iis and browse to http://localhost/ccnet. It should show the CruiseControl.Net dashboard.

    Step 4:Next step is to configure the ccnet server. Open the ccnet.config file located in the ‘server’ folder of the install directory to edit.

    Project Section:

    Define the project section. The project name can be any identifier not necessarily your project name. This will be used by CruiseControl.Net to recognize your project.

    Source Control Section

    In my case, the source control was StarTeam. Various properties like login credentials, project etc, are to be set.

    Executable:Path to the ‘stcmd.exe’ the Star Team command line utility.

    Project:The name of the Project as defined in Star Team, that has to be extracted.

    UserName, Password, Host, Port:Star Team Server connection setttings.

    Path:Path from which files have to extracted from StarTeam. Example: Consider the Project root folder in StarTeam is “Test”. Let the project and solution files lie in the hierarchy “Test\TestProject\MyProject”. To pull the project files and solution from this location, specify “Test” for project and “TestProject\MyProject” for path.

    Override Folder Working Directory:Path to which the files from Star Team are to be checked out for the build. If not specified, the original working folder specified in the StarTeam will be used to extract the files.

    Auto Get Source:Specifying this to ‘true’ will allow CruiseControl.Net to automatically check out files from StarTeam

    fileHistoryRegEx:I had to make a change to the Date regular expression, as my regional settings was configured to English(India), wherein DateTime is specified as DD-MM-YYYY HH:MI:SS (IST). I had to change this, since I got a Format invalid:System.DateTime exception during the run.

    TimeOut:Specify the timeout for StarTeam polling.

    Following is the complete listing of the starteam configuration block.

    StarTeam

    StarTeam

    MSBuild section

    I used MsBuild for the build task. Following section explains the properties involved to get the MsBuild setup for CruiseControl.Net.

    Executable:Path to the ‘MsBuild.exe’ file in the system.

    Working Directory:Location of the files to be built. i.e., Location to where the StarTeam extracted the files that need to be built.

    Project File:The .proj file or the .sln file that needs to be built.

    Build Args:Specifies additional arguments passed to the msbuild.exe.

    Targets:Actions to be done. Here I wanted Clean’ and then ‘Build’ done on the Solution.

    Timeout:Time after which error message will be displayed if there happens to be a failure to invoke the build.

    Logger:Location of the logger assembly that will be used to produce the build result.

    Following is the complete listing of the msbuild configuration block.

    MS Build

    MS Build

    Triggers Section

    Triggers section specifies the time and condition when the build of the project had to be invoked. During intital setup for testing, set the buildCondition to “ForceBuild” (forces a build), and once the testing is done, change it to “IfModificationExists”(does a build only when a modification is detected).

    Following is the complete listing of the Triggers configuration block.

    Triggers

    Triggers

    Step 5:Run the ccnet.exe application located in the ‘server’ folder of the CruiseControl.Net install location. The code will be pulled from the StarTeam to the location specified and the build should proceed. The results of the build are stored in the $InstallFolder\ProjectName\Artifacts\ms-build.xml file.

    Hope this helps.