Linux for human beings

This is a post that should have been written few days back, On April 29th Ubuntu 10.04 – (Lucid Lynx) was released, and I was counting days till it did but couldn’t try it out because of the release work I was doing in my machine. Last weekend (even the work wasn’t quite over) my anxiousness couldn’t rest. I installed the new beast keeping my /home safe. To tell you the truth, the installation process was hardly “linux like”. There were no screens showing any commands executing, nor view of the terminal. What you see is a breath taking slide show (very much windows like, but much sweeter) trying to show off the beauty 😉 and market itself.

Ubuntu - 10.04 (Lucid Lynx)

Well I know many of you already have tried Lucid, and there is nothing new for me to mention, hence I thought of writing few words about Ubuntu’s slogan “Linux For Human Beings”. My history as a Linux user is not that ancient, even though I have used it side by side with a  Windows OS, I’ve never gone total Linux, There were reasons behind. {1} I was afraid it will all break down in the middle of something. {2} It looked like a dark cave with alot of never ending tunnels {3} It was hard for me to troubleshoot on my own (I was a novice). But thanks to Sandaruwan and the never ending virus problems, performance degradation with time in windows, I jumped in to the deep-end. Ever since am a happy man 😉

Before Ubuntu, I have tried Debian and Suse, but with Ubuntu I felt quite safe. There were number of reasons, among them, Canonical released frequent updates and bug fixes (mainly fixes related to hardware drivers). Ubuntu’s is doing major release twice a year with a considerable amount of improvements, and nevertheless its Virus free, ultra fast and very stable for a software development environment.

Being those my reasons, I believe Linux is the answer for many 3rd world countries, to obtain a high IT literacy rate. When Microsoft and other proprietary software vendors are investing in millions and billions to put a full-stop to software piracy (Which as a software engineer I encourage), and when personal computers are sold with these proprietary software pre installed (Ofcause not for free) with prices automatically goes sky high, resulting a normal user to look at a computer as if it is a Jet plane ;).

But for some (many) reason free and open source software is hidden to the normal user world. Of-cause there are few myths associated, One popular myth is that Open source and free software doesn’t come up to the standard of proprietary software, If we forget for an instance that I work for a 100% open source company 😉 , and look at Apache software foundation, where there are plenty of great products (Apache HTTP server, Tomcat, Maven, Synapse et al.), but normally the argument is “A normal user doesn’t care about the server space. What does free software offer for them ?, to listen to music, edit some photos, check email and browse internet” ? And as far as I see this is where Ubuntu places itself. I believe this is why it displays a pretty screen while its being installed and I think so far Ubuntu had done a great Job, and it is ready with a strong and shiny armour, to battle with any proprietary operating system and make it’s mark.

So if you are a normal user reading this article, try new Ubuntu, and when you are buying your next personal computer, ask you computer supplier to give the machine with Ubuntu. I promises you, you will save a hell a lot of money, and it will set you free. 🙂

Few productive days in a dreamy vacation

Well, not hoping to write about my dreamy vacation, so will just tip off the few productive days. 🙂 Yeah so i was doing some work for Archmage last few days, gave life to a dead project, played with joomla, wordpress and osCommerce.

After much research and hacking me and few of my friends at Archmage thought of using Joomla and WordPress as core CMSes for our web development tasks, to make the work more rapid and easy. So yeah am hacking and looking for plugins and modules that i can use on joomla. Since last two weeks i was working on a real estate project and an e-commerce one. i was looking for resources on them. so yeah if you are looking for something similar try Estate Agent Improved for real estate and Virtuemart for E-Commerce. both are nicely made, Joomla plugins. With a little bit of customization they can be used like a charm.

OH and yeah today i gave a new look to my blog. 🙂 last night i updated to WordPress 2.5.1 ( yeah I know FINALLY!! 🙂 ) Edit: I updated it again today (16th June) to WP 2.6 🙂 .  Many thanks goes to Andrayogi for a pretty neat template. Added some plugins, had some problems with the DIGG IT icon. My firebug started giving a javascript error “unterminated string literal” and finally found a fix.. well its simple just edit the plugin and add

digg_bodytext = '<?php echo trim(preg_replace('/s/', ' ', get_the_excerpt())); ?>';

instead of

digg_bodytext = '<?php get_the_excerpt(); ?>';

That will fix the error. yeah so the site looks pretty neat. am sure many over the net uses this theme. even tried some different colors and combinations but thought this is the best combination so kept it in original.

Soo yeah will write some thing with more value soon.

cheers !

Single Sign-On between Joomla (PHP) and a custom JSF / JSP login (JAVA)

Single sign-on (SSO) is a method of access control, that enables a user to authenticate once, and gain access to the resources of multiple software systems. Well in my case, the task i have given is to authenticate a user in a PHP and a JAVA (Web) system simultaneously.

My PHP web application is the well known Joomla CMS, and my JAVA web application is based on JSF and custom built. After some thinking and research I found several resources which are worth reading (JOSSO, OneSign ), but i couldn’t take any help from them, mostly those SSO frameworks are complex ( yeah 🙂 I couldn’t understand ) and aimed on a general pourpose and most of them are not for free.

So yeah I thought of doing some Hack to joomla and also make some changes in my Java web app’s authentication method. After talking with some of my geeky Friends (Sandaruwan and Anjana). I came up with two approaches. both are involved in handling the cookies manually up to certain extent.

The 1st approach is (Which i didn’t try and had to give up due to the reason that I am using JSF as the web application framework) to log-in to the Joomla site and after loged in to Joomla create a random named temp file in the server (possibly in /home/secrets with 777) with the user-name (if a valid log in) and set a cookie using set_cookie(“name”,$filename) and direct to a jsp page to do the java side authentication.

in this JSP, page read the secret file name from the cookie and read the file from the http server in-order to take the username of the loged-in user. By passing this to the authentication method of the java web app, the java side also can be authenticated.

yup it is pretty simple, but i had to give it up mainly because I use JSF. if I do the user authentication in the above way in the java side. I cannot add the user object to the FacesContext which will be used by my other java side components. so even though i log in. later on in other jsf pages my loged user cannot be found. (Shortly my java login process is not happening according to the JSF implementation procedures.) and secondly i had to give up this method because my Project manger didn’t like the idea of saving temp files in the server. 🙂

So the Second and the method which i have implemented is, automating the Joomla log-in process by making an http request to the http server from my JSF backing bean. and set the PHP cookie manually via Http Servlet response.

before i explain this method more broadly i have to mention about two nice tools which helped me to monitor the http requests and response.
Apache TCP Monitor
Live Http headers (FireFox ad-on)

Architecture

Implementation

There are two different scenarios.
1. User can visit teh home page of the joomla site 1st and the PHP Cookie is already set.
2. User visit the Java site PHP Cookie is not available.

Continue reading Single Sign-On between Joomla (PHP) and a custom JSF / JSP login (JAVA)

JEvents Hack – Integrating JEvents with Google calender

As i promised today I got some time to write about some PHP programming i did few weeks ago. I had to integrate Google calender with the Sensoria web site, so that the events published in the sensoria site will be automatically published in Sensoria’s public Google calender.

Sensoria Site is created using a famous CMS called Mambo, in Mambo one can install plug-ins for many usage for the customized site they are creating. In this case Sensoria was using Mambo Events Component or now available to download as JEvents in Joomla CMS.

What I did was a small code hack in the eventmanager.php file in com_eventmanager folder in the components directory of Mambo. Its was a pretty easy task, but i had problems while testing. I was behind a proxy and the Zend framework gave a huge trouble when connecting to Google Via an HTTPS connection. After some descutions on Google calender forums.. I found out that it is a bug in the Zend Farmework (Which i could not find a solution and didn’t bother or had time to spend on fixing it). So i had to test it in a live server.

Any how now its all working.. I will publish the code out here.. so anyone who wants to do the same.. please feel free to use it..

eventmanager.php

cheers !!

Accessrunner-based USB ADSL modems – Get it to work on Ubuntu Dapper/Edgy

This is one wide area that no clear online article is available as a help document. I my self had a huge problem in searching and making my modem to work with Edgy. When you google for the Conexant AccessRunner driver you get the driver file as sources from the sourceforge,
http://accessrunner.sourceforge.net/index.shtml
where you have to add those files to the kernel source tree and recompile the kernel creating a great deal of work. But yet luckily the new kernels (after 2.6.10) have this driver inbuilt (Ubuntu Dapper/edgy) so you don’t have to mess up recompiling the kernel.

Any how you have to manually add the firmware, otherwise the modem will not work. (The LEDs wont Blink) for this you have to do few things, things I gathered from many online forums/blogs and help guides.

you have to extract the CnxEtU.sys file from the CD which you got from the vendor of your modem, and have to place it in /lib/firmware directory to make the firmware working. The step by step guide as follows.

for this purpose since we do not have the extract command, we have to download the package that Nicholas Wheeler created. from http://revu.tauware.de/details.py?upid=2426 there are several files but what you have to take is cxacrufw_1.2.orig.tar.gz and cxacrufw_1.2-1.diff .

After downloading these two files unzip the .gz and copy the .diff file in to that folder, and being inside that folder through the terminal patch it using
patch < cxacrufw_1.2-1.diff

then type make and make install. now you mush be havening a command called cxacru-fw. now your ready to extract the firmware.

insert the CD you got from the modem vendor and using the terminal type the following commands.

cp /media/cdrom/driver/ADSL/Wan/CnxEtU.sys ~/

(the above path can be different according to your settings so adjust the folder path)

then

cxacru-fw ~/CnxEtU.sys ~/cxacru-fw.bin
sudo cp ~/cxacru-fw.bin /lib/firmware

Make sure that the firmware is installed as /lib/firmware/cxacru-fw.bin or else the LED wont light up.

restart your computer and thats it you must be seeing the modem is working fine with the LED lighten up. anyhow though you have attached the modem to the computer and if your ISP is providing you a PPPoE protocol you will still have problems connecting your modem to Internet

there are few sites I saw some details which i think will be useful so just visit till I post a topic on HOW TO configure PPPoE

http://www.tldp.org/HOWTO/DSL-HOWTO/configure.html#BRIDGEVSPPP

and if any one who knows on PPPoE please leave a comment….

Installing Gnome(cairo)-Dock

Today while i was surfing the net (digging new gadgets for my Gnome desktop) i saw some interesting screenshots of a universal dock something which is similar to the OSX making me hunt down this new feature to my desktop. i googled for “Gnome dock” and found a post in ubuntu forums where i followed the installation process and at last.. yes !! I got the DOCK but there were no application images seen in the DOCK. i solved this problem by editing the .svg files and the cairo-dock.c file. but the biggest problem i encountered was that when i added this to the sesion and restarted my X-server. I crashed or rather I didn’t see my desktop at all. (well for some wired reason it crashes only the desktop.) I think this happens when the Gnome session loads Beryl-manager, Beryl, Gdesklets and the cairo-dock at the same time it might get overloded and crashes the desktop.

Anyhow as a solution i delayed the loading process of each of these applications through a shell script. so on this post I will describe how to install cairo-dock and make it work hand to hand with beryl.

You can follow the instructions on the Ubuntu forum for the installation process. since it describes well I will write what is missing.

At the step 5 before download cairo-dock.tar.gz i signed up for the ubuntu forum.

At last after the installation process is done when you run cairo-dock it will appear in the bottom of your desktop with almost no images for the named applications. These application icons are saved as .SVG files in the cairo directory what you have to do is open each of these files and replace the link to the image with your application icon’s path.

xlink:href=”/usr/share/pixmaps/firefox.png
sodipodi:absref=”/usr/share/pixmaps/firefox.png

replace the highlighted link with your icon’s path and secondly you can add/remove applications from the dock by edition the cairo-dock.c file. there in the specified section you have to add the name of the .SVG file, name of the application and the command to launch that application and make it. this is the simple way to make the DOCK running with the applications you want in your desktop. If at the end when you add the DOCK to the session and restart and if then your Desktop crashes, simply write a shell script and save in /usr/bin/ and add that script to run on the beginning of the each session.

my scripted looked like this.

#!/bin/bash
beryl-manager
sleep 5
beryl
sleep 7
cd /opt/cairo-dock
./cairo-dock –no-glitz &

restart your X and you must be smoothly working !!! Enjoy…

Credits :

Sandaru1 & Kasun