Friday, May 18, 2012

Install the GNOME desktop in Ubuntu


  1. Type sudo apt-get  install ubuntu-desktop to download and install.
  2. Type startx to start the GNOME






If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

How to release a service running on some port and assign new task in Ubuntu?

I have been running some service on my port 8080 and then tried to install Apache Tomcat server on the same port. It doesn't show me any output related to new installation when checked in the URL http://localhost:8080/ . The service that is already running on my 8080 port is not at all necessary for me. So I decided to kill it. Below are the steps.

1) Check the Process ID (PID) of the unwanted service running on 8080 by issuing the following command.


sudo fuser -n tcp 8080


2) It replies the PID of the service if it is running currently.

For example : 8080/tcp: 3660 in my case
Kill it by issuing the following command.


sudo kill 3660

3) Now assign your new service i.e Apache Tomcat server restart in my case. Thats it! It works ! :)



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

No JDK found - please set JAVA_HOME error while starting Apache tomcat in ubuntu

If you have already installed JDK and JRE in your system and encountered this error, then follow below steps.

1) Type sudo gedit ~/.bashrc in the terminal
2) Add export JAVA_HOME=/usr/lib/jvm/java-7-oracle  at the end of the file.  Here the path may vary depending upon your installation.  Open /usr/lib/jvm and check for the folder name and replace accordingly.  It is java-7-oracle in my case. This is nothing but setting up environmental path for java.


Check out if your Apache tomcat is starting.  If the same error encounters again, goto next step

3) Type sudo gedit /etc/default/tomcat6  in the terminal and hit enter.
( Type password if asked ).
4) Search for the word something similar to this JAVA_HOME=/usr/lib/jvm/java-7-oracle
If this line is commented, uncomment it and give the same path which you have given previously in .bashrc file.
5) Save the file and try to start the server again. It works!



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

How to install Tomcat in Ubuntu ?


1) Find a correct tomcat package to install



sudo apt-cache search tomcat

2) For example, if you find tomcat6 in the output of above command, Install all Tomcat packages with following commands

sudo apt-get install tomcat6-webapps
sudo apt-get install tomcat6-admin
sudo apt-get install tomcat6

3) In order to start your Apache tomcat server, first install java i.e both JRE and JDK. To install JRE, go with this link.



4) But in order to start you need JDK too. Just open synaptic manager and search for oracle-jdk7-installer if you've followed above link to install JRE on your machine.


5) Start your Apache tomcat by using the following command



/etc/init.d/tomcat6 start

6) If you want t stop,

execute /etc/init.d/tomcat5.5 stop
if you want to restart the service

execute /etc/init.d/tomcat5.5 restart











If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Thursday, May 17, 2012

Which one is better ? open-jre or sun java ?

On a whole, open java and sun java are 99 % similar. As oracle purchased sun company, java is taken into oracle and tried to make it proprietary. Open jdk / open jre is under GNU Public License and is free (free in terms of freedom not as in price). So whatever may be the issue, there are currently no major issues running both of them side by side. 


But today, as I re-installed my Operating system i.e Ubuntu, I need to check for java plugin support for browser. I've already installed open-jre in my system but it don't enable jre in browser i.e java plugin in browser. i didn't find any browser specific plugins on the internet. Tried installing sun java from oracle.com but couldn't succeed because I've downloaded a Linux version .tar.gz file which is self extracting archive. Oracle.com suggested to execute .bin file in that folder and surprisingly it is missing (Amazing support !).


Finally discovered a way on the internet and below are the steps.


sudo add-apt-repository ppa:webupd8team/java


sudo apt-get update


sudo apt-get install oracle-java7-installer


sudo apt-get update

Voila ! that works ! :)

Consider this before choosing.



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Saturday, January 28, 2012

What is the difference between rand and randn in MATLAB ?

We have two functions in MATLAB namely rand() and randn() to generate random numbers.  There exists a small difference between these two which lets us easy to use but complex to understand.

rand gives value from standard uniform distribution. That is they are in range [0,1].

randn gives value from standard normal distribution. A distribution with mean 0 and variance 1 is nothing but Standard Uniform Distribution. These are also in range [0,1]

In general we will use randn for generating random numbers.





If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Thursday, January 26, 2012

Login to Google Account on Any Public Computer Without Password

Google moved a step forward in the field of security. We already know about the 2 step verification of our Google accounts login. Now in order to get rid of the keylogger problem, it introduced a new feature in fact. Its nothing but GOOGLE SESAME


The amazing thing here is you don't need to enter your password on a computer. If you need to access your google account on a public computer like an internet cafe or so, there is problem with keyloggers which are Fully UnDectactable (FUD).


Procedure : 



  1. Goto this URL on the computer
  2. QR Code (Quick Response Code) will be generated and displayed in the webpage
  3. We need to scan this QR Code using our mobile phone(Smartphones only). The smartphone can be  Android / iOS / Windows / Blackberry  or any other.
  4. This code is decoded into some URL on your mobile. You need to enter this URL on your mobile browser.
  5. It asks for your credentials like username and password.
  6. Type your login details.
  7. After that click on the button " Start with Gmail " or " Start with iGoogle ". 
  8. By doing the step - 7, you will be logged in automatically on your computer web browser.
  9. That's it !
The only appearing disadvantage is actual availability of a smart phone with every Google account user. 

Except this, Sesame is just amazing. But Let's wait and see until the highly self trained monkeys(Hackers) find some vulnerabilities. Till then, this is said to be most secure.






If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged