Monday, December 24, 2012

Kill User Session on Linux/Unix

You need to have admin access to kill an user session. First : Get the process id of the user session using the who command. Second:Kill the process using the kill command with option- 9.

For example: Lets say, we want to kill the guest user session having pid 7317 as below

~$ who -u
deepak   tty7         2012-12-25 07:16  old         2531 (:0)
deepak   pts/1        2012-12-25 07:53   .          4481 (:0)
guest-qIU5kr tty8         2012-12-25 15:11  old         7317 (:1)

~$ kill -9 7317
bash: kill: (7317) - Operation not permitted
~$ sudo kill -9 7317
[sudo] password for deepak:

~$ who -u
deepak   tty7         2012-12-25 07:16  old         2531 (:0)
deepak   pts/1        2012-12-25 07:53   .          4481 (:0)

~$

Eclipse Juno 4.2 on Ubuntu 12.10

Currently the latest version Eclipse Juno 4.2 is not at available at Ubuntu software center. So if you wish to install the latest eclipse version,  You have to install it manually, not a big issue. Here are the simplified steps to do this.

1. First check if java is already installed or not.
 To check the java version, run the command below on your terminal window.
~$ java -version

if its not installed, get it installed from ubuntu software center..
 

2. Get the latest eclipse version ( Eclipse Juno 4.2) for Linux 32/64 bit as appropriate from the eclipse download center here.

Download the file and extract it at any temporary location, say to the Downloads folder at your home drive e.g /home//Downloads/

3. Then copy the eclipse folder from the location of the extraction to /opt   folder

~/Downloads$  sudo mv /opt/

4. a-Now create a desktop shortcut file (eclipse.desktop) at /usr/share/applications

~/Downloads$ sudo gedit /usr/share/applications/eclipse.desktop


 b-Enter the below text to this file

[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Eclipse IDE

NoDisplay=false
Categories=Development;IDE
Name[en]=eclipse.desktop


c-Create a symlink at /usr/local/bin

 ~/Downloads$ cd /usr/local/bin
 /usr/local/bin$ sudo ln -s /opt/eclipse/eclipse



5. Thats all. Now you are ready to launch eclipse

 /usr/local/bin$ /opt/eclipse/eclipse  -clean  &   




Originical contribution by Kovid can be found here