Sunday, June 29, 2014

Installing KDE on CentOS.

Follow the step below to have some experience with KDE on CentOS.

Environment:
CentOS Rlease 6.5 (Final)
Kernel Linux 2.6.32-431.el6.x86_64


Step-1 :

Login as "root" user

Step-2 :

Open "Terminal"

Step-3 :

Enter the command to install desktop packages
yum -y groupinstall "KDE desktop" "X Windows System" "Fonts"

Step-4 :
After installation reboot your system by entering following command
init 6






Thanks...

Thursday, June 26, 2014

Linux commands on listing users

Some Linux Commands to see list of users


lastlog : All user's last login time

cat /etc/passwd : Display list of users

cat /etc/sudoers : List users with root privileges

getent group root : To see who is in group 'root'

getent group root wheel adm admin : To see who is in group 'root', 'wheel', 'adm', 'admin'

getent passwd 0 : To see who is UID 0
 

Friday, June 13, 2014

OpenCV Java with Eclipse

Working With OpenCV Eclipse.


The Open Source Computer Vision Library has >2500 algorithms, extensive documentation and sample code for real-time computer vision. It works on Windows, Linux, Mac OS X, Android and iOS.

Download OpenCV from below link:
http://sourceforge.net/projects/opencvlibrary/
Run the .exe file. The self extractor will ask you to provide location to store the extracted file.

My environment configuration
    OS: Windows 8 (64-bit)
    Eclipse: Kepler Service Release 2 , 32-bit
    OpenCV: Version 2.4.9



Follow below steps to configure OpenCV and Eclipse.
  1. Open Ecplise.
  2. Goto Window --> Preferences 
  3. Java --> Build Path --> User Libraries 
  4. Click on New... button 
  5. "New User Library" box will open. Enter the name of the Library as shown in figure. Now Click on "OK" button. 
  6. Now Click on "Add External JARs..." button 
  7. Locate and select the "opencv-249.jar" file from the "JAR selection" dialog box. See the circle for the path to 'opencv-249.jar' file. Now Click on "open" button.
  8.  "Preference" Box will look like below figure.
  9. Now select "Native library location" and click on "Edit..." button.
  10. Now click on "External Folder..." to locate the native library.
  11. See the figure to locate the native library. If the eclipse is of 64-bit, then you should choose 'x64' folder. Since I am using Eclipse 32-bit, so I choose 'x86' folder. Then click on "OK" button.
  12. Now click on the "OK" button.
  13. Now click on "OK" button on the preference box.

 Now it is the time to test. Follow the below steps to test the above configurations.


  1. Open Eclipse , and create a new Java project. (Say the project name is "testOpenCV")
  2. After creating the project, right click on the project name and select "Properties" option.
  3. Now select "Java Built Path" --> "Libraries" tab --> "Add Library" button.
  4. Select "User Library" and click on "Next" button. 
  5. Now select the add the user library, "openCV-2.4.9" and click on "Finish" button. 
  6. Now click on "OK" button. 
  7. Now create a java file. (say the file name is "test") 
  8. Now insert the following Code.

  9. package testOpenCV;
    import org.opencv.core.Core;
    import org.opencv.core.CvType;
    import org.opencv.core.Mat;

    public class test {

       public static void main(String[] args) {
       System.loadLibrary( Core.NATIVE_LIBRARY_NAME );
       Mat mat = Mat.eye( 3, 3, CvType.CV_8UC1 );
       System.out.println( "mat = " + mat.dump() );

    }
    }

    Now Execute the java file. You should get the following output.





    -Thank you.
     

Friday, June 6, 2014

How to know which bit version of JVM you are working on ?

To know which bit version of JVM you are working on
  • Press "win key" + "r".
  • Type "cmd" and press enter.
  • Enter the command "java -d64 -version".

  • If the installed JVM is of 32-bit version, error message will suggest you to install 64-bit version.

To install JVM 64bit version follow the link:
http://www.oracle.com/technetwork/java/javase/downloads/java-se-jre-7-download-432155.html

Download the respective JRE file and install on your computer.

To check for successful installation, enter the same command as in before  in "command prompt"
 "java -d64 -version"
 


-Thank you