Wednesday, July 2, 2014

Process Viewer tools for Linux

Some good console base process viewer for Linux:

1: htop : alternative to top
command to install htop
sudo apt-get install htop

2: atop
Command to install atop
sudo apt-get install atop

3: top : Built-in tool
Command to install top
sudo apt-get install top

4: nmon
Command to install nmon
sudo apt-get install nmon

5: collectl
Command to install collectl
sudo apt-get install collectl

6: glance
Command to install glance
sudo apt-get install glance
 

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



 

Monday, April 21, 2014

Developing Java in Ubuntu 12.04

OS: ubuntu 12.04 LTS
Java Version: "1.7.0_55"
 
Step-1:
Installing Java 7 in Ubuntu 12.04 with default setup.


Step-1.1:
    sudo add-apt-repository ppa:webupd8team/java
Step-1.2:
    sudo apt-get update 
Step-1.3:
    sudo apt-get install oracle-java7-installer

It'll keep your java 7 installation up to date.

To automatically set up the Java 7 environment variables JAVA_HOME and PATH:

Step-1.4:
    sudo apt-get install oracle-java7-set-default


Step-2:
Downloading IDE for Java.

The best way to work with a better editor is to choose Eclipse which is easy to use. For this you can use Ubuntu Software Center

  1. Open "Ubuntu Software Center"
  2. Type "Eclipse" in the search box
  3. Click on "install

-----
Now open Eclipse editor and enjoy Java.

Monday, February 17, 2014

LaTeX : Part - 2 : Download Latex template

 

 

https://www.sharelatex.com/templates/

http://www.latextemplates.com/

 

Academic Journals Categories :-

  • Institute of Electrical and Electronics Engineers (IEEE)

          http://www.latextemplates.com/template/ieee

          Conferences: https://www.sharelatex.com/templates/journals/ieee-conference/ieee-conference.zip

          Transaction: https://www.sharelatex.com/templates/journals/ieee-journal/ieee-journal.zip

         

         

 

  • ACS Publication

          http://www.latextemplates.com/template/acs-publications

  • American Geophysical Union

          http://www.latextemplates.com/template/american-geophysical-union

          https://www.sharelatex.com/templates/journals/agu/agu.zip

  • Proceedings of the National Academy of Sciences (PNAS) Journal

          http://www.latextemplates.com/template/pnas

  • Public Library of Science (PLOS)

          http://www.latextemplates.com/template/public-library-of-science-plos

  • Royal Society of Chemistry

          http://www.latextemplates.com/template/royal-society-of-chemistry

  • Elsevier’s elsarticle document class

          http://www.latextemplates.com/template/elseviers-elsarticle-document-class 

  • Association for the Advancement of Artificial Intelligence (AAAI) Press

          https://www.sharelatex.com/templates/journals/aaai-press/aaai-press.zip

  • AGH Reports

          https://www.sharelatex.com/templates/journals/agh_reports/agh_reports.zip

 

Friday, August 23, 2013

LaTeX : Part - 1 : Some Mathematical symbols, operators and many more related to Maths.

****** This document has been extracted from http://www.ams.org/tex/short-math-guide.html ******





















 

Please feel free to share document which contain more symbols related to mathematics.

 

Sunday, March 17, 2013

How To: Create swap file in Ubuntu 11.04


1.       Open Terminal by pressing alt+ctrl+t
2.       Enter the command
               cat /proc/meminfo
3.       Now enter
                sudo dd if = /dev/zero of=/swapfile bs=1024 count=XX
                 swapfile size = count * bs
                e.g. count=2M  OR count = 2048K
                   so size=1024 * 2M = 2GB
4.       sudo chmod 600 /swapfile && sudo mkswap /swapfile
5.      sudo swapoff -a
6.      sudo swapon /swapfile
7.      sudo -b gedit /etc/fstab
                edit /etc/fstab file and remove or comment out all old swap partitions
8.       Add new line:
                /swapfile none swap sw 0 0
                verify that everything is done OK
9.     free -m
10.   Now you'll see your swap reported
                   swapon -s


Friday, March 1, 2013

How To : Enable/Disbale hibernate and suspend option in Ubuntu 11.04

Ubuntu Version 11.04

Steps:


1: Open terminal by pressing Alt+Ctrl+t
2: Enter the command given below
      
       sudo gedit /usr/share/polkit-1/actions/org.freedesktop.upower.policy 

   sudo command is used because the editing the file require root privilage and hence it requires password to enter.
3:  At the end suspend and hibernate section you will find two lines(if both are enabled):
       
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>

4:  Change yes to no and vice-versa. we assume that in your system both are enabled and you want to disabled it. If it is not the file contain the below lines

          <allow_inactive>yes</allow_inactive>
      <allow_active>no</allow_active>

 and now you have to turn "yes" to "no" and "no" to "yes" to make it enable.

Note : it's preferable to use "gksudo" instead of "sudo" when opening graphical programs, to prevent permission errors