Creating DSL / PPPOE Connection in UBUNTU

I have internet connection (worldlink-512kbps, cable net) shared with landowner and flatmates through wireless router. I recently created a PPPOE (Point to Point Protocol Over Ethernet) dial-up connection on my laptop to use whole bandwidth during load-shedding.

Creating DSL connection in Ubuntu is extremely easy.

Create, configure maven project in eclipse - example tutorial

In this post, the followings are covered :
  • Download and Install maven in windows:
  • Add M2_REPO classpath variable in eclipse 
  • Generate Java/Web Project  with maven and import in eclipse
  • Add another dependency from web repository
  • Add custom or 3rd party library manually into repository:
  • Benefits of using MAVEN :

Reading contents of unix ext partitions from windows

How to read / browse / copy files from linux ext partitions from windows?

Do you ever want to copy files from your unix ext partition from windows?
Ext2Explore is solution.
It supports ext2, ext3, ext4 partitions. and easy to use as it provides GUI like an file explorer.
This software is compatible with windows XP SP3 and higher.
Download it from
You need to run this program as an Administer option.

Most Popular English Movies

Here is the list of best and popular movies that I have watched.
They are definitely good : inspiring and entertaining.
  1. A beautiful mind
  2. The Pursuit of Happiness
  3. Atonement
  4. The Notebook
  5. Casablanca
  6. Hill has eyes
  7. Stuck
  8. 8 belows
  9. Alive
  10. Awakenings
  11. Basketball diaries
  12. The Motorcycle Diaries (2004)
  13. Before Sunrise (1995)
  14. Before Sunset (2004)

Drawing Chess Game Board in Java - Source Code

Source code for Chess Game Board in Java :

public class ChessGUI extends JFrame {
    private Board board;
    private ChessGUI() {
        board = new Board();
        setLayout(new FlowLayout());

java read content of web page

The following example use easier method to read String from InputStream in Java. It uses java.util.Scanner. It will be easy/efficient to read shorter content by using this method.
Reading content of web URL:
System.out.println("Google\n" + new Scanner(new URL("").openStream())
Reading a text file :
System.out.println("TextFile\n"+new Scanner(new File("inputFile.txt"))
The regex "\\A" here matches the beginning of input source. Scanner can work not only with an InputStream source, but with  anything that implements the new (JDK version >= 1.5) java.lang.Readable interface.

Deploying .war file to Apache Tomcat Server : Working way

Here i am going to describe the [MANUAL]working way to deploy your .war(web application archive) file to the Apache Tomcat Server.
Suppose you have your web application's war file ,say MyProject.war exported from Eclipse Netbeans or similar IDE.
1.Copy this .war file to webapps folder TOMCAT_HOME directory e.g, C:\apache-tomcat\webapps\
2.Restart the server, >> run the startup.bat in folder C:\apache-tomcat\bin
3.If the error message such as
     JAVA_HOME not defined or CATALINA_HOME not defined
     Then follow these steps to setup these environment variables:
  • Right-click the My Computer icon on your desktop and select 'Properties'.
  • Click the 'Advanced' tab (Windows XP), click on Advance System Settings on Windows7.
  • Click the 'Environment Variables' button.
  • Under 'System Variables', click 'New'.
  • Enter the variable name as JAVA_HOME.
  • Enter the variable value as the installation path for the Java Development Kit. eg. C:\Program Files (x86)\Java\jdk1.6.0_20
  • Repeat the process for CATALINA_HOME variable and enter installation path for Tomcat Server, eg. C:\apache-tomcat\webapps\
  • Click 'OK'.
  • Click 'Apply Changes'.
  • Restart the Server >> run the startup.bat in folder C:\apache-tomcat\bin
4.Launch http://localhost:[PORT]/MyProject/ on the browser, (port number might be 8080 or 8400). And Make sure the work offline option is not checked.
5.If everything is ok, the Home page of your app will be loaded into browser
6.Enjoy :)

hibernate show sql & parameter to console

You need to configure it 2 places :
1) Configuration in log4j logger : add following lines in - file  :
The first is equivalent to hibernate.show_sql=true, the second prints the bound parameters among other things.
2)Configuration in hibernate.cfg.xml :

<property name="show_sql">true</property>
TO Show Formatted SQL :<property name="format_sql">true</property>

java escape html string - code

1) StringEscapeUtils from Apache Commons Lang:

import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
// ...
String source = "The less than sign (<) and ampersand (&) must be escaped before using them in HTML";
String escaped = escapeHtml(source);


2) Use Spring's HtmlUtils.htmlEscape(String input) method.

Selection sort C C++ source code

Selection sort C C++ source code
//selection sort
#include <iostream.h>
void selectionSort(int *array,int length)//selection sort function 
    int i,j,min,minat;

      for(j=i+1;j<(length);j++) //select the min of the rest of array
          if(min>array[j])   //ascending order for descending reverse
              minat=j;  //the position of the min element 
      int temp=array[i] ;
      array[i]=array[minat];  //swap 

void printElements(int *array,int length) //print array elements
    int i=0;
void main()

    int a[]={9,6,5,23,2,6,2,7,1,8};   // array to sort 
    selectionSort(a,10);                 //call to selection sort  
    printElements(a,10);               // print elements