Wednesday, September 10, 2014

Start, Stop, Restart and know status of Apache2 in Ubuntu.

Commands to do basic operation with apache2 in Ubuntu.

OS: Ubuntu 12.04 LTS
OS Type: 32-bit 

Start apache2 

 Command : "sudo service  apache2 start"



 Stop apache2 

 Command : "sudo service  apache2 stop"
 

Restart  apache2

Command :  "sudo service  apache2 restart"
 

Status of apache2


Command  : "sudo service  apache2 status"
 





-Thank You

---

Sunday, August 31, 2014

LaTeX : Part - 3 :Working with BibTex

 


In this post we'll discuss on how to use bibtex in Latex environment. The BibTeX tool is typically used together with the LaTeX document preparation system. BibTeX makes it easy to cite sources in a consistent manner, by separating bibliographic information from the presentation of this information, similarly to the separation of content and presentation/style supported by LaTeX itself[1].

Requirement:
TeXnicCenter [link] (Many other alternatives can be use)
BibTeX package for IEEE transaction [link] (if require)

Steps:
  1. Open TeXnicCenter
  2. Open new tex document. (File -> New -> File...)
  3. Use \bibliographystyle{ieeetran} inside "document" like below code snippet
    1. \documentclass[10pt,journal,cspaper,compsoc]{IEEEtran}
    2. \IEEEoverridecommandlockouts
    3. \hyphenation{op-tical net-works semi-conduc-tor}
    4. \begin{document}
    5.  \bibliographystyle{ieeetran}
    6. .
    7. .
    8. << your content>>
    9. .
    10. .
    11. \bibliography{IEEEabrv,referencefile}
    12. \end{document}
  4. Insert \bibliography{IEEEabrv,referencefile} just before ending the document section.
  5. With in the document, you use \cite{label} to refer to a particular source. 
  6. Run the .tex file.**
 Example of a bib file (referencefile.bib)

@article{label1,
     title   = "abc",
     author  = "aaaa",
     journal  = "XYZ",
    volume  = "xx",
    number  = "xx",
    pages   = "xxxx",
    year   = "xxxx"
}

@inproceedings{label2,
  title   = "xxxx",
  author  = "XXXX",
  booktitle  = "xxxx",
  pages   = "xxx",
  year   = "yyyy",
  organization = "IEEE"
}

*Bibliography file must have extension ".bib" and must be created in the same folder where .tex file is created else you need to specify the path to bib file.
** Run the .tex file four time to reflect the modification on output file.

Advantages of BibTeX [source]

  1. All the references in BibTeX are stored in a plain text database with an extension ".bib". Once it is in the database, it can be used in any file.
  2. Consistency through out the paper is another major advantage.
  3. Only refereed sources will appear in the output file. For example, if there is a reference entry in the database with label {label-23}, and no where in the paper you use, then the entry in database will NOT appear in the output file.
  4. Same reference file can be used for many paper with different style. This is possible because of its modularity function. Here Presentation is independent to the content.



-Thank you


---

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.