Tuesday, December 29, 2015

secured wifi disconnect in mint

Please create the below file with below content and reboot the system to overcome from regular disconnection of secured wifi connection.  I have tried in mint 17.3 and it works. Please let me know if it fail with proper log.


echo "options rtl8723be fwlps=N ips=N" | sudo tee /etc/modprobe.d/rtl8723be.conf


Tuesday, September 15, 2015

Rest service to get the name node Host ID from thousand of node from cloudera hadoop cluster


1) get the cluster name

clustername = HttpClient(http://:7180/api/v10/clusters)

2) now get the  HostID

host_id=HttpClient(http://:7180/api/v10/clusters/${clustername}/services/hdfs/roles)

3) Now get the Hostname which is on with Namenode

host_name=HttpClient(http://:7180/api/v10/hosts/fb50e775-33b7-4f38-b268-2bb3220695e1)

Now you have the host name which is on with name node .

NOTE : Here I just used HttpClient as a sample method which will get the details from rest service and parse as per the requirements.




-Khirod

Saturday, July 4, 2015

Hello Juby with warbler

Lets have a Hello world program through jruby and prepare a executable jar through warbler.

Let's assume jruby already installed . In my case I used jruby 1.7.8

Please create the below directory structure :

HelloWorld---|
                       |--bin--main.rb
                       |--lib--hello--hello.rb
                       |--Gemfile                      -------File
                       |--helloworld.gemspec   -------File

copy the below content to the respective file, then execute the below steps through terminal. at the end you should have a HelloWorld.jar in your project directory and follow the step number (5) to get the output.

  1. install bundler gem : gem install bundler
  2. change to the directory HelloWorld 
  3. execute bundle : $> bundle
  4. warble compiled jar
  5. java -jar HelloWorld.jar


helloworld.gemspec :

Gem::Specification.new do |s|  s.name             = 'helloworld'  s.version          = '1.0.0'  s.authors          = ['Khirod Patra']
  s.date             = '2013-07-03'  s.description      = 'Hello World'  s.email            = ['khirodpatra@gmail.com']
  s.homepage         ='khirodblog.blogspot.com/'
  s.require_paths    = ['lib','bin']
  s.files            = Dir.glob("{bin,lib}/**/*")
  s.executables   = s.files.select { |f| f =~ /^bin\// }.map{ |f| File.basename(f) }
  s.default_executable = 'bin/main.rb'  end

GemFile :

source 'https://rubygems.org'

gem 'warbler'

hello.rb :

module Hello
  class SayHello
    def hello
      puts "hello World"    end  endend

main.rb :

#!/usr/bin/env ruby
require 'rubygems'

require 'java'
my_lib = File.expand_path(File.dirname(__FILE__) + "/../lib")$LOAD_PATH.unshift(my_lib) unless $LOAD_PATH.include?(my_lib)
require 'hello/hello'
module Hello
  class Main    SayHello.new.hello
  endend

Tuesday, June 16, 2015

instant oracle 12c client on linux

1) get the below instance oracle 12c client from oracle site

  • instantclient-basic-linux.x64-12.1.0.2.0.zip
  • instantclient-sqlplus-linux.x64-12.1.0.2.0.zip
2) create a oralce_instance directory in your home directory

3) unzip both instantclient zip file in /home/xyz/oracle_instance

4) create a soft link in /usr/bin 

cd /sur/bin; sudo ln -s /home/xyz/oracle_instance/sqlplus  

5) Create a new file 

sudo vi /etc/ld.so.conf.d/oracle.conf

insert the below line and save the file
/home/xyz/oracle_instance/

Note : Oracle client instance home directory may be different in your case. So choose it accordingly.

6) sudo ldconfig


troubleshooting :

if sqlplus complain about the library libaio.so.1 , then install below library.

sudo apt-get install libaio1



that's it, now happy sqlplus  . If you want to install the oracle instant client from rpm package you need alien . Please check one of my old post.




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