Thursday, October 18, 2007

Unix Login Without Password (Setting login keys)

Client : Machine from where you want to log-on
Server : Destination machine where you want to log-on from

1. On the client machine

Create the key(id_rsa) file with appropriate permissions

ssinghal@client$cd ~ssinghal/.ssh
ssinghal@client$touch id_rsa
ssinghal@client$chmod 600 id_rsa

Generate is_rsa file

ssinghal@client$ssh-keygen -t rsa

Press enter when you are prompted for a passphrase or for entering a file name ( accept the default)

Id is stored in ~ssinghal/.ssh/id_rsa

Your identification has been saved in /home/ssinghal/.ssh/id_rsa.
Your public key has been saved in /home/ssinghal/.ssh/id_rsa.pub.
The key fingerprint is:
2c:ce:0d:e4:53:83:d3:41:95:82:5f:cc:e5:8f:a1:6b ssinghal@MACHINENAME


2. copy the id_rsa.pub to server

Using any scp or ftp mechanism

3. On the server machine

SSH to the server machine and create keys file with appropriate permissions

ssinghal@server$cd ~ssinghal/.ssh/
ssinghal@server$touch authorized_keys2
ssinghal@server$chmod 600 authorized_keys2
ssinghal@server$cat id_rsa.pub >> authorized_keys2
( id_rsa.pub is client's public key)


Note: The username on client and server needs to be same ( If I am not mistaken)

Logout and from the client machine try to ssh again, you should be able to log-on with just your username

ssinghal@client$ ssh ssinghal@server

Friday, October 12, 2007

Formatting XML in vim

":silent 1,$!xmllint --format --recover - 2>/dev/null"

http://www.vim.org/tips/tip.php?tip_id=349

Updated vim tips URL : 

http://vim.wikia.com/wiki/Format_your_xml_document_using_xmllint

Eclipse Tools I Use

This list keeps on growing and changing when I discover new plug-ins. Here is my current configuration of eclipse. Along with eclipse update sites.

Base Eclipse Version : 3.3.0 Europa, http://download.eclipse.org/releases/europa

Web Tools Platform : http://download.eclipse.org/webtools/updates
It Includes many cool features, best of which is JSP Debugging options and unbelievable support for editing WSDL files for web-services

JSEclipse: Javascript plug-in from Adobe(now), http://download.macromedia.com/pub/labs/jseclipse/autoinstall/

Subclipse, SVN plugin for eclipse : http://subclipse.tigris.org/update_1.2.x

Perl Editor : http://e-p-i-c.sourceforge.net/updates
I prefer VI to work with perl files, but fancy it for its auto-complete features.

ShellEd for browsing through shell scripts - No better way than VI to actually code and test them :)

Monday, October 1, 2007

Oracle - Common Datafile Operations

Adding a table space

ALTER TABLESPACE users
ADD DATAFILE ‘/home/ssinghal/oradata/users01.dbf' SIZE 10M
AUTOEXTEND ON
NEXT 512K
MAXSIZE 250M

Adding a table space with minimal options

ALTER TABLESPACE name ADD DATAFILE ‘filespec’ SIZE 200M;


Altering a tablespace by adding a new datafile

ALTER TABLESPACE VPN2_LRG_TBLS
ADD DATAFILE '/home/ssinghal/oradata/users02.dbf' SIZE 100M
AUTOEXTEND ON
NEXT 1024K
MAXSIZE 250M


Resizing a data-file

alter database datafile '/home/ssinghal/oradata/users02.dbf' resize 500M


Dropping a datafile

alter database datafile 20 offline drop

Note : ID of datafile can be obtained from dba_data_file