Wednesday, August 24, 2011

[Javascript] Newline Character or Break Line in Textarea Field

Hi Friends,

We put a textarea to a form. Submit the form. Edit the form. Everything works fine. Textarea seems to display everything alright. But what if we want to load the form using javascript for editing?

In this case, if the text in textarea has a newline character, Javascript will throw error. Since it will be coming like this.. if text area text is  "This is my msg.\nRavi" then to javascript it will appear like
var msg = "This is my msg.
Ravi";
Which is an error.. Javascript will not do anything further. I could not find any solid solution for this but here is what can be done. I was getting the data from java so..

<%
// In java the data is stored with Html escape for all special characters etc.
msg = msg.replaceAll("\n", "<br />"); 
%>

// In javascript get the msg and replace all <br> with \n
var tmsg = "<%=msg%>";
tmsg = replaceAll(tmsg, "<br />", "\n");
tmsg = unescape(tmsg); // needed to get all special characters

Now put this content anywhere you want. 
$(#textAreaMsg).html(tmsg);

And the replaceAll function is  
function replaceAll(txt, replace, with_this) {   return txt.replace(new RegExp(replace, 'g'),with_this); }
Thats it.:)

Monday, August 22, 2011

[MySQL] Users and Permissions : Grant all on..

To create a user in mysql use -
CREATE USER 'ravi'@'localhost' IDENTIFIED BY 'password';
To grant all permissions use -
GRANT ALL PRIVILEGES ON *.* TO 'ravi'@'localhost' WITH GRANT OPTION;
GRANT ALL ON *.* TO 'ravi'@'localhost' WITH GRANT OPTION; //also works
To grant selected permissions use -
GRANT SELECT,DELETE,UPDATE ON *.* TO 'ravi'@'localhost' WITH GRANT OPTION;

Reference : MySQL Reference

Enjoy :) 
 

Thursday, August 4, 2011

PDF Viewer : View PDF on Websites

Hi Friends,
Did you ever think of any apporach about viewing pdf files on website.. Its not difficult one. Just convert the pdf to image and display. I wondered how google worked and set up Google books, well you will have the answer. Click on this link. If the link is not working no issue. Whats in that is written in next lines.

The link which you just clicked is http://books.google.com/books?id=fcW1xl1BejUC&pg=PA308&img=1&zoom=3&hl=en&sig=ACfU3U0viP5hPVQFiFCyoDc4_zeXPmco-Q&w=685 which is nothing but a dynamic generated url to get the image from google servers. So, even Google is using the images. Answer of standard question "Why" is simple.. Browsers. They cant render parse and render pdf(AFAIK) but they can display images.
The same approach we followed when it came to think about a pdf viewer. There are some very powerful libraries are availabe which can convert any pdf to certain images formats without any error. Unfortunately most of them are not free.. To help open source in this area Apache provided PDFbox and Swinglabs provided PDF renderer. Both are very small and lightweight libraries which enable us to create/edit/convert pdfs.
Below code shows how we can convert pdf to images. But for basics, A pdf is actually a document with pages. And when I say convert to image its not like taking a screenshot but the content of pdf are drawn in a 2d image(At least pdfbox does).To know more about the API docs just download the libraries along with the documentation.
Convert using PDFBox-
    public GetSpecificPage(int pageNum, String pathFile, String pathPage) {
        try {
            PDDocument document = PDDocument.load(pathFile);
            List list = document.getDocumentCatalog().getAllPages();
            int count = document.getNumberOfPages();
            PDPage page = list.get(pageNum);
            int dpi = 75; // Dots per inch
            BufferedImage image = page.convertToImage(BufferedImage.TYPE_INT_RGB, dpi);
            File imageFile = new File("D:/tests/pdfbox/" + pageNum + "-dpi-" + dpi + ".png");
            ImageIO.write(image, "png", imageFile);
        } catch (Exception ex) {
            Logger.getLogger(GetSpecificPage.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

Well even using PDFBox this is not the only approach to extract something out.
            File f = new File("D:/tests/pdfbox/1.pdf");
            FileInputStream fis = null;
            fis = new FileInputStream(f);
            PDFParser parser = new PDFParser(fis);
            parser.parse();
            COSDocument cosDoc = parser.getDocument();
            PDDocument pdDoc = new PDDocument(cosDoc);
            Splitter splitter = new Splitter();
            List pages = splitter.split(pdDoc);
            for (int i = 0; i < pages.size(); i++) {
                PDDocument pageDoc = pages.get(i);
                String fileNameNew = "page_" + i + ".pdf";
                pageDoc.save("D:/tests/pdfs/" + fileNameNew);
                pageDoc.close();
            }
            fis.close();
            cosDoc.close();
            pdDoc.close();

And now with the PDF Renderer- Its bit different.
            File file = new File("D:/tests/pdfbox/1.pdf");
            RandomAccessFile raf = new RandomAccessFile(file, "r");
            FileChannel channel = raf.getChannel();
            ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
            PDFFile pdfFile = new PDFFile(buf);
            int num = pdfFile.getNumPages();
            for (int i = 0; i < 100; i++) {
                PDFPage page = pdfFile.getPage(i);

                //get the width and height for the doc at the default zoom
                int width = (int) page.getBBox().getWidth();
                int height = (int) page.getBBox().getHeight();

                Rectangle rect = new Rectangle(0, 0, width+(width%60), height+(height%60));
                int rotation = page.getRotation();
                Rectangle rect1 = rect;
                if (rotation == 90 || rotation == 270) {
                    rect1 = new Rectangle(0, 0, rect.height, rect.width);
                }

                //generate the image
                BufferedImage img = (BufferedImage) page.getImage(
                        rect.width, rect.height, //width & height
                        rect1, // clip rect
                        null, // null for the ImageObserver
                        true, // fill background with white
                        true // block until drawing is done
                        );

                ImageIO.write(img, "png", new File("D:/tests/pdf1/" + i + ".png"));
            }

Thats it in this. We explored just one small but powerful feature of both Libraries. To learn more just download and use.. Its simple.

Next step is to view the images on browser.. That's an easy task if you dont want to take care of security and performance. I believe a lot of free javascript libraries are available which can display. But if we need security and performance we need to take care of images which we are rendering on browser and caching + some other applicable mechanisms which can help with the performance. Anyways It completely depends on the user's choice on how to view them on Web. :D

Cheers!!!
Ravi Kumar Gupta

Wednesday, July 20, 2011

[Servers] Setup and provide basic Chat Server using Openfire

Hi Friends,
Openfire is an opensource, cross-platform chat server which uses XMPP (also called Jabber). It has a very simple installation procedure, easy to use web based Admin panel. In this post I will install openfire on Windows, configure it with LDAP, Use it with Web Chat Client Spark and Desktop Client Pidgin.

Openfire can be downloaded from http://www.igniterealtime.org/projects/openfire/ in form of executables containing JRE and just archives. Download and extract archive to a directory lets say D:/pFiles/openfire.


All the required documentation is available in documentation directory. To complete installation we need to setup
  1. Database
  2. LDAP Server (optional, but recommended)
For the database use one of these supported databases
  • MySQL
  • Oracle
  • Microsoft SQLServer
  • PostgreSQL
  • IBM DB2
  • HSQLDB
After database server installation create a database lets say openfire.
And for LDAP, please refer this post to setup OpenDS. Any LDAP can be installed and used.
Now when we have LDAP and Database ready, we are ready to setup Openfire.
Go to bin directory and run openfire.exe It will show that server is running and the address:port where admin console is running.














Now open browser and go to the link provided.. in this case http://127.0.0.1:9090 which will open the web-setup




Select the language and continue..


Select the server settings for our Openfire chat server.. provide the domain name which you want to choose. This domain will be used while login... for user ravi it ravi@rkg.test will be the login username.


We have an option to choose embedded database or use our own database server. Lets go for Standard connection.


Provide the correct details in the form and continue..


We can here select where we want to store the users data. I recommend LDAP since every organization has one LDAP and the same can be integrated and used easily. Remember that.. Users and groups are stored in the directory and treated as read-only. We can not modify anything using Admin console here.

Press continue to get form to fill the LDAP credentials and other details.





























We can also test connection settings using Test Settings Button.



Press Save and Continue to see user mappings. Change according to the LDAP you have. For my system I took all default so no need to change anything.


Same is the case for Group settings..


After filling all correct settings press Save and Continue. Next we should add one admin account to manage admin console. Add a user in next screen



If we add admin it will search and show users present in ldap as well.



Select user if present and then continue. Now login to the admin console using the link http://127.0.0.1:9090/index.jsp or whatever is applicable for your system.


Now the server is running and up. We can configure any client to connect to server and chat with other users. Popular desktop clients which can be used are Pidgin, trillian, empathy etc. For web client we can use SparkWeb.
Below are the steps to add account in pidgin. Click on Manage Accounts in Account in Menu.














Now add one more account..




















The account type will be xmpp. Fill correct username and password. If needed put domain as we provided earlier.. in this case it is rkg.test.


















We need to modify the advance settings as well



















Now after adding we can chat to other users on the server. Next few screens will show the sparkweb client which can be put in any webserver like apache and used using browser. In my case I have put it in a folder called chat and accessing with url http://rkg.test:4000/chat/SparkWeb.html. This is a flash based client which can be used on web and connects to the server we want.






















Thats it for the Chat Server and Clients.. We have one chat server running now, one Desktop client configured, one web client configured.

Cheers!!!

Ravi Kumar Gupta

[Servers] Setup and provide basic LDAP Server using OpenDS

Hi Friends,
Many times we need to integrate LDAP server with our softwares for user authentication. This blog will explain how to setup a basic LDAP server on a machine using OpenDS.

For the basics, LDAP is Lightweight Directory Access Protocol more on which can be read on LDAP: Wikipedia. OpenDS is one LDAP Server which can be downloaded from this link of OpenDS.org . I will recommend to download the zip version which contains setup script.













Download and extract this to a directory lets say D:/pFiles/OpenDS. Now run setup.bat which will launch the installation..






















Make sure you have already setup a proper hostname for your system. Like for me I have chosen rkg.test and put it in hosts file.
Just press next and fill server settings. Give a port number which is more than 1024; this is because ports between 0-1024(not an exact figure) are reserved and sometimes blocked in intranet. I chose 11389 for this installation. Choose the Root User DN which will be used to connect to LDAP and for all other admin tasks like create/edit/delete etc. DN stands for Distinguished Name. 























For a basic server we don't need to setup replication so just leave the options as it is in next screen.






















Now fill the Directory Data, Here we will Base DN which is must when we try to connect to LDAP through our softwares. Optionally we can install sample data if we want. 
 
Click next and Review the settings.























Now finish the installation. We can here choose to run this as service, optionally.























After setup is finished Launch Control Panel. Control panel is where we can manage all the entries. Clicking on the button will prompt to fill Bind DN which is nothing but Root User DN and password.
















This will connect to Control panel where we can see all the options provided to manage OpenDS.


































Click on Manage Entries and we will see a new screen where we can view the tree of all the entries. We can modify/delete/add any entry.

After our all the entries are setup now we are ready to use this LDAP for any integration needed. Now the most important thing, features which OpenDS is providing to us(Probably I should have listed them before in this post, but I feel this position better since now we have a basic understanding how LDAP looks like :D)
This listing is directly copied from OpenDS.org from this page

Directory Server Features

The OpenDS directory server is an LDAPv3 compliant directory server written entirely in Java. The directory server includes the following high-level functionality:
  • Full LDAPv3 compliance (RFC 4510–4519) with support for numerous standard and experimental extensions
  • High performance and space effective data storage
  • Ease of configuration and administration

    • A highly extensible administrative framework that enables you to customize most of the features listed below.
    • An administration connector that manages all administration traffic to the server. The administration connector enables the separation of user traffic and administration traffic to simplify logging and monitoring, and to ensure that administrative commands take precedence over commands that manipulate user data.
    • A graphical control panel that displays server status information and enables you to perform basic server and data administration.
    • Several command-line utilities to assist with configuration, administration tasks, basic monitoring, and data management. The main configuration utility (dsconfig) provides an interactive mode that walks you through most configuration tasks.
  • An advanced replication mechanism

    • Enhanced multi-master replication across directory server instances
    • An assured replication feature that ensures high availability of data and immediacy of data availability for specific deployment requirements
    • Fractional replication capabilities
    • Support for an external change log that publicizes all changes that have occurred in a directory server database
  • An extensible security model

    • Support for various levels of authentication and confidentiality
    • Access to resources based on privileges
    • An advanced access control mechanism
  • Multi-faceted monitoring capabilities
  • Rich user management functionality

    • Password policies
    • Identity mapping
    • Account status notification
  • A DSML to LDAP gateway
Read and Enjoy
Cheers!!!
Ravi Kumar Gupta

Wednesday, July 13, 2011

[HTML5] Adding Text to your Canvas

Hi Friends,
My last post was just an intro to Canvas and some line drawings. Whenever I see some board, canvas I always want my name written on it.. so i tried adding some text. I will show you how can you put your name over there..

1. Select a font style, size, weight just like css properties and assign like this
c.font = "bold 20px verdana";

2. Now we have two ways to draw it.. either fill or stroke.
c.fillStyle = "#ff0022";
c.strokeText("Only Stroke", 10, 60);
and for stroke
c.strokeStyle = "#00ff00";
c.strokeText("Only Stroke", 10, 60);
Remember if you want both fill and stroke then use both ways like this-
c.fillText("Both Stroke and Filled", 10, 90);
c.strokeText("Both Stroke and Filled", 10, 90);


3. Alignment of text is alwyas important. We can align text to both verticle and horizontal directions.
For horizontal just assign any of these properties start, end, left, center, or right. For ex.
c.textAlign = "left";

For verticle assign any of these properties top, hanging, middle, alphabetic, ideographic, and bottom. For ex.
c.textBaseline = "top";


Easy.. right? And this is output when I was trying something.. :)


Cheers!!!
Ravi Kumar Gupta

Thursday, July 7, 2011

[HTML5] Canvas -Paint Your Imaginations

Hi Friends,

If we forget about the IE older versions, HTML 5 is doing great job. Though there are so many things that it offers but Canvas is what attracts me. This post might act as introduction to canvas and writing your first canvas.

1. Canvas is nothing special but one HTML5 tag just like div, p, table etc. We use it like 
<canvas height="300" id="myCanvas" width="500"></canvas>

2. Actually just adding this canvas has no use at all. Javascript is one which helps us drawing things on it but even before drawing we need some initialization.
var canvas = document.getElementById("myCanvas");
var c = canvas.getContext("2d");

We just got context from the canvas. This is 2d context using which we can draw line, circles, shapes actually anything that you can think of in 2 dimentions.

3. Now when we have context available, we can start drawing. Lets draw a line first. Assume that you have a pen and paper, now what you will do to draw a line. See the comments above each code line.. isn't that right?
// Choose a point from where you want to start. So lets go to some point(x,y).
c.moveTo(x,y);
// which point you want to go now. Lets say point(x1,y1)
c.lineTo(x1,y1);
Easy so far, huh? But wait, we have to paint it, for that we have stroke(). By default stroke will paint with black color, which we can change using strokeStyle.
c.strokeStyle = "#ff9933";
c.stroke();
Now we are done. If you were not just reading this but writing the same in any html file, there might be a line appearing on the browser :)

4. To draw an arc use
c.arc(x, y, radius, startAngle, endAngle, anticlockwise);
x, y radius are just numbers but angles are in Radians so be careful. Anticlockwise is the boolean value to specify which side to move from start angle. One example Try running this and you will know more.
c.arc(50, 50, 10, Math.PI*1, Math.PI*1.9, false);
Now see, a circle is an arc with angle 0 and Math.PI*2. Just try it.

5. Well there is more to draw but lets close this for today. In my first MSpaint class in 10th standard, we were also given this much info only. If you are curious enough to learn more like me.. go to this link otherwise wait for my next post..

Cheers!!!
Ravi Kumar Gupta

Wednesday, February 23, 2011

MapReduce

MapReduce is a programming model and an associated implementation for processing and generating large data sets. It is inspired by Map and Reduce functions which are used in functional programming.

The basic computation can be expressed a set of input key/value pairs and produces a set of output key value pairs. All this computing is done in two steps Map and Reduce. Map takes an input pair and produces a set of intermediate key/value pairs. MapReduce library groups together all intermediate values associated with the same intermediate key and passes to Reduce. Reduce takes intermediate key and a set of values for that key as input. Reduce merges these to form a possibly smaller set of values.Typically just zero or one output value is produced per Reduce invocation. Actually the MapReduce framework is a large distributed sort which comprises of Input Reader, Map Function, Partition Function, Compare Function, Reduce Function, and Output Writer. The diagram shows how the data flows between these functions.

For example consider the problem of counting the number of occurrences of each word in a large collection of documents. Map and Reduce functions would have the pseudo-code as:
map(String key, String value):
    for each word w in value:
        emitIntermidiate(w,"1");
reduce(String key, Iterator values):
    int result = 0;
    for each v in values:
        result+= ParseInt(v);

Few more examples that can be expressed as MapReduce computations. Count of URL Access Frequency for which map function will process logs of web page requests and output (URL, 1) and reduce function will add all together for same url and will result (URL, total count). In Reverse Web-link Graph problem map function will output (target, source) pairs for each link to a target url found in page named source. Reduce will then concatenate the list and will emit (target, list(source)).

MapReduce is easy to use even for programmers without experience with parallel and distributed systems, since it hides the details of parallelization, fault tolerance, locally optimization and load balancing. A large set of real world problems are easily expressible as MapReduce computations.
MapReduce has been used at Google for different purposes such as web search service, sorting, data mining, machine learning etc. Google has developed an implementation of MapReduce that scales to large clusters of machines comprising thousands of machines.


Friday, February 11, 2011

Ajax Portlet using JQuery : AjaxJQueryPortlet

Hello friends,

This is a sample Ajax Portlet using JQuery. In this we are getting name and company from a java class which is called in jsp.

Check it out on Sourceforge : AjaxJQueryPortlet
And the Liferay page: AjaxJQueryPortlet

Cheers!!!
Ravi Kumar Gupta -aka- D'Maverick

Setting up wireless in Ubuntu

Hello Frnds,

This I could not post before.. found this in drafts.. :) consider this as a post of 2 years back.. :)

so, Finally i got time.. i got time to write again... this is totally new for me.. b'coz its first time i m using a laptop so it is obvious to get problems during setup.. and this happend.. mot only me.. most of us face problems during installation of wireless network while we are working on a linux... yep, u got it.. its drivers problem... :) ok, then i m gonna help with this issue... on Ubuntu.. and i hope the same will work for any linux..

so here we go with the first post (strictly written ) for wireless laptops

drivers can be downloaded from drivers repositories..

first step :
Installing ndiswrapper -
Download these pkgs for ubuntu... and install by simple double click.

Second :
Get the vendor and suitable driver for it.
run lspci

now run the following command...
>>>>>sudo ndiswrapper -i xxxxxxx.inf
this will install the driver file form "*.inf" file..
>>>>>sudo ndiswrapper -mi && sudo ndiswrapper -ma

now just reboot the computer and ur wireless configuration is done...
enjoy..
Ravi Kumar Gupta ~aka~ "D'Maverick"

Thursday, February 10, 2011

Piwik : An Open Source Web Analytics alternative to Google Analytics

Hello Friends,

Since Google Analytics can not be used on intranet website, we needed to find something similar in open source. And we have Piwik which provides similar functionalities. Piwik is open source, under GPL license Piwik also provides development options for developers.

To know more have a look here at the http://piwik.org/

Cheers!!!
Ravi Kumar Gupta -aka- D'Maverick

Setting Up Mail Server on Linux [Postfix + Dovecot]

Hello Friends,

Here are the steps to configure a basic mail server using Postfix and Dovecot.
For the basics of Mail server you can refer Wikipedia. We need to download Postfix and dovecot. Generally with any Linux these packages are distributed by default but if not available can be downloaded and installed.

This document assumes that all commands are run using super user or root.

For Redhat/Fedora/Mandriva/Suse etc Linux flavours  
  • rpm -ivh postfix-Xx.XX.rpm
  • rpm -ivh dovecot-xx.xx.rpm

For Ubuntu/Debian
  • apt-get install postfix
  • apt-get install dovecot 

Configure your domain name.
  • If you are running on any system which is directly visible to Internet i.e. you have your domain name then use your domain.
  • My system is running on intranet/LAN so I have to configure a domain name in hosts file
    • Add this line to /etc/hosts
      • 127.0.0.1    rkg.test
    • You can choose the domain name according to you. I use .test because that is not gonna conflict with any website I open. 

Configure SMTP which runs on port 25 by default
  • Using your favorite editor edit /etc/postfix/main.cf file 
    • vi  /etc/postfix/main.cf
  • Add these lines at the end
    • myhostname = rkg.test
    • mydomain = rkg.test
    • inet_interfaces = all
    • mynetworks = 172.0.0.0/8 
  • These are the basic configurations. If you want to get into details just read main.cf file accordingly.
  • mynetworks should be configured accordingly. For basics like > My system is in intranet with private LAN with IPs starting from 172.0.0.0 so I put it like that. Choose according to your network.

Configure Dovecot for mail receiving protocols- imap imaps pop3 pop3s
  • Edit the /etc/dovecot.conf or sometimes at /etc/dovecot/dovecot.conf
    • vi /etc/dovecot.conf
  • add this line
    • protocols = imap imaps pop3 pop3s 
  • For advanced configurations modify dovecot.conf file.

Now we need to configure accounts. 

Add some system accounts like a, b, c etc.
  • useradd a
  • passwd a 
  • useradd b
  • passwd b
For these accounts emails will be a@rkg.test, b@rkg.test etc.

Now we need to start the servers -
  • service dovecot start 
  • service postfix start

To automatically start the servers at startup
  • chkconfig dovecot on
  • chkconfig postfix on
 
Now the mail server is up. You can now use it for your integration purposes. In next post we will see how Evolution can be used as mail client to verify what we just did. :)

Cheers!!!
Ravi Kumar Gupta -aka- D'Maverick

Saturday, February 5, 2011

[Ubuntu] Broadcom Wireless STA Driver Activated But Not Currently In Use

Hello Friends,

I am using Ubuntu 10.04 LTS - the Lucid Lynx. I was using Wireless daily with no problem but one week back something happened and my wireless stopped working suddenly. I figured with System > Administration > Hardware Drivers.. that my wireless driver was not in use. I thought of removing it, reinstalling and then re-activate it.. it worked.. but whenever I rebooted my system I had to do the same process everytime.. :(

Tried google and found this blog.. thanks a lot to the writer..

I will just rewrite the steps here for my reference.. :D

All this we are going to do on a terminal.. just press Alt+F2 and type gnome-terminal and press enter..

1. Optionally u can try these commands first.. just to check the connection
lspci -nn
lshw -C Network
lsusb
ifconfig
iwconfig
sudo iwlist scan

Now run the following commands..
sudo modprobe -r b43 ssb wl
sudo modprobe wl
sudo ifconfig eth1 up
sudo iwlist scan
 
2. Blacklist ssb. Run the following command 
echo blacklist ssb | sudo tee -a /etc/modprobe.d/blacklist.conf
 
3. Edit rc.local and add the following code at the end.
sudo vi /etc/rc.local
and add this just before "exit 0"
modprobe wl



Now just reboot... the problem should be gone :)

P.S. I am running ubuntu on Dell 1440.

Cheers!!!

Ravi Kumar Gupta -aka D'Maverick

Sunday, January 9, 2011

How to configure start up programs / services in Ubuntu

Hello Friends,

I was recently installing a lot of softwares and most of which were started when computer starts. I needed to configure start up programs/services. After looking at some websites I found one tool.. install it using

sudo apt-get install sysv-rc-conf

then run sysv-rc-conf using sudo and configure.

Cheers!!!
Ravi Kumar Gupta -aka- D'Maverick

Saturday, January 1, 2011

configure: error: BDB/HDB: BerkeleyDB not available

Hello Friends,

Today morning while installing OpenLDAP I was getting error like :
configure: error: BDB/HDB: BerkeleyDB not available

I checked, googled and found-

from read me:
BDB and HDB backends require Oracle Berkeley DB 4.4, 4.5,
4.6, 4.7, or 4.8. It is highly recommended to apply the
patches from Oracle for a given release.

And then I installed Berkeley DB and set these environment variables..
CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include"
LDFLAGS="-L/usr/local/lib -L/usr/local/BerkeleyDB.4.8/lib -R/usr/local/BerkeleyDB.4.8/lib"
LD_LIBRARY_PATH="/usr/local/BerkeleyDB.4.8/lib"

export CPPFLAGS LD_LIBRARY_PATH LDFLAGS

Then everything worked fine...

just ran
./configure
make depend
make
sudo make install

Cheers!!!

Ravi Kumar Gupta aka D'Maverick