Latest Entries »

Showing posts with label Miscellaneous. Show all posts
Showing posts with label Miscellaneous. Show all posts

Sunday, January 27, 2013

Install Oracle Sun Java JDK on Linux

In this post, I would try and collate information about installing Sun Java JDK on various Linux platforms. Since the time licensing issues have come up, the distros have stopped shipping sun-java and thus we need to add additional repos to achieve the same. I have found a very diverse information with various methodologies how people have installed but none of them give a very holistic picture. Hope this post can become a one stop information for many people struggling out there to get the right information all at one place and thus would keep updating this post to add new and relevant information.

Installing Sun Java JDK on Ubuntu 10 and 11

## Install the package required for adding repositories 
deploy$ sudo apt-get install python-software-properties
deploy$ sudo add-apt-repository ppa:ferramroberto/java
deploy$ sudo apt-get update
deploy$ sudo apt-get install sun-java6-jdk
deploy$ sudo update-java-alternatives -s java-6-sun

## Adding to environment Variable
deploy$ sudo vi /etc/environment
## Append the line - JAVA_HOME="/usr/lib/jvm/java-6-sun"



Thursday, January 24, 2013

Remote Desktop using VNC and FVWM Crystal

This is one of my favorite things. Most of the times, I do not like having a development environment on my own machine because of various constraints like RAM, OS etc. It also helps in environments when DB connections cannot be made over VPN and only internal servers can access them. Thus, for working remotely, this is the best practice. 

I have always followed a policy of creating an environment for myself on the development server and working on that. For this, sometimes I require to have a windows manager too. FVWM crystal serves as one of the best windows manager I have ever worked with. It is light weight, superfast over VPN and renders pretty nicely. 


Quick steps to get you setup for Ubuntu


## Installing VNC Server on Ubuntu and FVWM-Crystal

deploy$ sudo apt-get install vnc4server fvwm-crystal

## Starting VNC Server - You can give the geometry settings you like.
## Note that this is a normal alphabetical 'x' and not a multiply sign.
deploy$ vncserver -geometry 1200x800 

## For the first time, it would ask you for a VNC Password
## Please enter your desired password for logging into your remote machine.

## The above command would start the VNC server at 
## terminal :1 or :2 depending upon what is available. 
## To kill a particular port run
deploy$ vncserver -kill :1

Accessing the VNC Remote desktop

There are a variety of clients available but mostly on Mac and Windows I have used RealVNC and on Linux I have used Remmina. There are varied functionalities with these clients and you can choose according to what functionalities you would require.

To open the remote desktop, open the client and enter the URL in the format :. Here port is the terminal port on which the windows manager has got started when the above command of vncserver was given. For example 10.0.0.23:1. One you do this, you would be able to login to remote terminal using fvwm-crystal or any other default windows manager. If you have multiple windows manager, the suggestion is to edit the ".vnc/xstartup" which is there in your Home directory to configure it.

Important FAQ - If you are not able to access the remote machine, then your server might be blocking the VNC port. In such case, you would require to tunnel it to do the same. Follow the steps of Port forwarding in Ubuntu Documentation to achieve the same.
## Find out the remote port where VNC is running - Mostly 5900 or 5901
deploy$ netstat -tpln | grep -iR xvnc
## On your local system, create a tunnel
deploy$ ssh -L 5900:localhost:5900 joe@remotehost

## Connect to remote machine from VNC client giving IP 
## of localhost as "localhost:5900"

Sunday, October 24, 2010

PasswordLess Login with Open-SSH Linux

OpenSSH allows you to login to remote systems and run commands. This is not a new concept for most of linux developers but for who require to perform remote commands without being prompted for a password, this quick tutorial gives just a way. Password less login to remote systems is useful in a lot of ways like copying backups across systems, monitoring multiple systems, trigger various commands, sync repositories etc.

So following is what you would need to do to achieve this. There are plenty of tutorials already for this over the internet since it is not a new concept. I am just documenting it for my personal use and for those who stumble upon my blog.

Step-1 : If you dont have a keypair already, then generate one.
## Leave the options blank and press Enter. 
## It automatically selects the defaults which are good enough

deploy$ ssh-keygen -t rsa

## Output
Generating public/private rsa key pair.
Enter file in which to save the key (/home/deploy/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/deploy/.ssh/id_rsa.
Your public key has been saved in /home/deploy/.ssh/id_rsa.pub.


Step-2 : If you wish to login to a machine called remotehost from localhost then we need to copy this key file to the remotehost.

## The following command will prompt you for the password once
## and copy the key file for you
ssh-copy-id -i ~/.ssh/id_rsa.pub user@remotehost

Great!! You are ready to go and login to the remote host from now onwards without entering your password again. You would need to repeat this password if you are logging from any other machine to remote host. This method is only local to login in from your system. Try doing the following now:-

ssh user@remotehost

Advance users can follow the Debian Guide for further information.

Sunday, June 06, 2010

What this Blog is About!!!

Friends, welcome to my blog!! It has been really long time since I did any blogging. My last blog was way back in 2007 on one of my websites which I had shut down due to lack of time. But since very long I have felt a need to document a lot of things that interest me and put forward to the world my everyday learnings. As I keep on venturing more and more into various technologies, I keep stumbling across lots of challenges which are worth documenting for like minded people to come across and get the benefit.

People coming across this blog would mostly find the articles about Operating Systems (mostly Linux), HowTo's on various topics, Databases in general and Data Warehouse, Performance and Scalability of various Web Applications etc and lot of Design patterns revolving around various technologies. Hope you find the blog extremely useful!!!