Monday, February 23, 2015

Install oracle client in Ubuntu 14.04

Please follow these below steps to install oracle client12 in ubuntu 14.04

Here it will just install the sqlplus and it's supporting library only.

Download oracle-instance-sqlplus and oracle-instance-basic from oracle site . Please make sure to download the version as per the OS system type like 32 or 64bit.

sudo apt-get install alien
sudo alien -i 
sudo alien -i 



NOTE : it will create the .deb file and install .deb file by double clicking on the file else follow the below command to install the .deb file 
dpkg -i <.deb file>




sudo apt-get install libaio1 
sudo vi /etc/ld.so.conf.d/oracle.conf
 
update the below line in oracle.conf. Please make sure the exact path. In my case it is given below.

/usr/lib/oracle/12.1/client64/lib/
sudo ldconfig
 
Now check  if oracle installed successfully or not.
 
which sqlplus64 
OR
which sqlplus

Extra steps to manage oracle client from HOME with tnsnames.ora

cd /home
ln -s /usr/lib/oracle/12.1/client64 oracle
cd oracle
sudo mkdir -p network/admin
sudo vi tnsnames.ora
NOTE : Please add the required service string in tnsnames.ora , then save and quit the file.
vi ~/.bashrc OR vi ~/.bash_profile
export ORACLE_HOME=/home/oracle
export PATH=$PATH:$ORACLE_HOME/bin
 
that's it, and happy sqlplus
 
 

 
 

Thursday, May 29, 2014

C extension support is not enabled. [pry-stack_explorer]

If you are using pry then you may looks for better pry debugger plugins . I faced the above issue when I used to install pry-stack_explorer. The complete error you can find here :

https://www.ruby-forum.com/topic/4832612#new

In my case I am using pry-nav and pry-stack_explorer combined to debug the code. Please follow the below steps to install the above plugins.

1) install jruby-1.7.8, Export the variable JRUBY_HOME and PATH
NOTE : explicitly export this variable as we are going to use it once.
export JRUBY_OPTS=-Xcext.enabled=true

2) install ruby-1.9
NOTE : Here we need ruby-1.9 only for libraries, So you can set the --prefix at the time of
configuration and install in you specified directory.

3) create directory structure in JRUBY_HOME/lib/native/include

4) create soft link in JRUBY_HOME/lib/native/include
 ln -s RUBY_HOME/include/ruby-1.9.1/ruby ruby

5) jruby -S gem install pry-nav

6) jruby -S gem install pry-stack_explorer

that's it .

Please suggests if any body have any better tricks or idea.


Thanks
-Khirod





Tuesday, May 20, 2014

cannot load Java class jline.console.ConsoleReader

Please follow the link for more information.

https://www.ruby-forum.com/topic/4816085#new

-Khirod

Friday, April 25, 2014

eclipse icon issue in ubuntu 12.04



  1. Install gnome-desktop if it is not there 
  2. Execute the command gnome-desktop-item-edit --create-new ~/Desktop
  3. click on the icon on left top side of the pop up box and set the for icon.xpm where eclipse edittor unzipped
  4. set the application path
Now it is ready to run eclipse from your Desktop luncher.



-Khirod

Saturday, February 15, 2014

ssh login without password

1)  Install ssh on both Host , we will take as client1 and client2 . Here client1 will login to client2 through ssh without password.

2)from client1:
cd ~
ssh-keygen -t rsa

Enter file in which to save the key (/home/client1/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/kshyama/.ssh/id_rsa.
Your public key has been saved in /home/kshyama/.ssh/id_rsa.pub.
The key fingerprint is:
da:0d:08:10:8c:e6:59:2d:b0:59:8d:cf:3f:bd:70:e6 kshyama@kshyama
The key's randomart image is:
+--[ RSA 2048]----+
| ooo..+          |
|....++ o         |
|o  oo +          |
| . . . +         |
|  .   . S .      |
|       o * +     |
|      . . B .    |
|           E     |
|                 |
+-----------------+


3)cat .ssh/id_rsa.pub | ssh client2@192.168.3.20 'cat >> .ssh/authorized_keys'

Now you are done. The ssh connection will not ask any password from client1 to client2

Tuesday, January 14, 2014

[JRUBY] NameError: uninitialized constant Net::SSH::Connection::Session::JavaLang

I have gone through the work around for this issue successfully , but still not sure if it is a bug of net/ssh gem

Error Details :

NameError: uninitialized constant Net::SSH::Connection::Session::JavaLang
   const_missing at org/jruby/RubyModule.java:2642


The above error encountered when my program tried to open a new channel session. It looks for JavaLang. I just simple add a module of JavaLang which use the package of java.lang and issue resolved. i.e.


require 'java'
require 'rubygems'
require 'net/ssh'


module JavaLang
  include_package "java.lang"
end

class Testing1
   
  def testConnection()
    Net::SSH.start("myhost","user_id", :password => "password" ) do |ssh|
       puts("Connection Established")
      ssh.open_channel do |channel|
        puts("SSH Channel opened successfully")
      end
    end
  end

end



-Khirod

Monday, December 10, 2012

Network File System (NFS)

Follow the below syntax to create a Network File System. Please Note you must have the Root access to do this anyway.

Let two host A and B both can be access to each other over the network and you want to create a NFS on B from A.

Example Case:

java installed on machine A and JAVA_HOME on Host A is : /home/java/jdk1.6.0_33 . and you want to use the java on machine B with out installing it on B

ON Host B :

1) create a directory java [Note you can crteate this directory anywhere]. I am taking /mnt as parent directory , so you must be root or you have the sudo access to do so

 ~]# mkdir /mnt/java

2)open the file /etc/fstab and append the below line . Please change the parameter as per your requirements

 ~]# vi /etc/fstab

A:/home/java/jdk1.6.0_33 /mnt/java nfs defaults 0 0

A : Host name or IP address
/home/java/jdk1.6.0_33 : Path on Host A
/mnt/java                       : Path on Host B


On Host A:

1) Open the file /etc/exports and append the below line. Please change the path as per your requirements.

~]# vi /etc/exports

/home/java/jdk1.6.0_33 *(rw,sync,no_root_squash)

2)Start the nfs service. The below command will stop and start the service

 ~]# service nfs restart

3) Start portmnp service

~]# service portmap restart



Final step on Host B:

~]# mount /mnt/java


Now you are done. you can set your JAVA_HOME and PATH on Host B using the path /mnt/java.