Monday, February 23, 2015

Docker Machine

https://vexxhost.com/blog/getting-started-with-docker-in-minutes-using-docker-machine/#.VOjOjXGdvZ4.dzone

Typically, you would have to create a new virtual machine, install multiple Docker components until you’re ready to provision new containers. With Docker Machine, it’s a matter of a single command.

Saturday, November 1, 2014

How to install JDK on Redhat/CentOS usng the alternatives command


http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/

Install Java JDK or JRE package

## JDK 32-bit ##
rpm -Uvh /path/to/binary/jdk-7u67-linux-i586.rpm
 
## JDK 64-bit ##
rpm -Uvh /path/to/binary/jdk-7u67-linux-x64.rpm
 
## JRE 32-bit ##
rpm -Uvh /path/to/binary/jre-7u67-linux-i586.rpm
 
## JRE 64-bit ##
rpm -Uvh /path/to/binary/jre-7u67-linux-x64.rpm
 
 

Install Sun/Oracle JDK java, javaws, libjavaplugin.so (for Firefox/Mozilla) and javac with alternatives –install command

## java ##
alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 200000
## javaws ##
alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 200000
 
## Java Browser (Mozilla) Plugin 32-bit ##
alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/jre/lib/i386/libnpjp2.so 200000
 
## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/latest/jre/lib/amd64/libnpjp2.so 200000
 
## Install javac only if you installed JDK (Java Development Kit) package ##
alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 200000
alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 200000

Saturday, October 25, 2014

Unable to start historyserver service


If you see error as below in your log file while failed to start the history server, then you can use the command sudo su -l hdfs -c "hadoop dfs -chmod -R 755 /" to fix it and then restart the service with sudo service hadoop-mapreduce-historyserver restart 

Permission denied: user=robing, access=WRITE, inode="/":mapred:hadoop:rwxr-xr-x

Friday, August 29, 2014

ORACLE: How do I set up passwords to NEVER expire?


Run the below query to set up SYSTEM password never expire

SQL> select profile from dba_users where username = 'SYSTEM';
PROFILE
--------------------------
DEFAULT

SQL> alter profile DEFAULT limit password_life_time unlimited;

Profile altered.


After doing this...Reset the password of the user again.

SQL> alter user SYSTEM identified by new-password;

User altered.

By doing this,the password will never expire.

Saturday, August 2, 2014

Docker tricks and tips

https://gist.github.com/wsargent/7049221


http://stackoverflow.com/questions/17157721/getting-a-docker-containers-ip-address-from-the-host?rq=1

How to get the container's IP address ?


You can use docker inspect
Example:
> CID=$(docker run -d -p 4321 base nc -lk 4321); > docker inspect $CID -or-
> docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CID}

How to get the full container ID ?


> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d8e703d7e303 solidleon/ssh:latest /usr/sbin/sshd -D cranky_pare
> docker inspect -f '{{.Id}}' cranky_pare
or
> docker inspect -f '{{.Id}}' d8e703d7e303
d8e703d7e3039a6df6d01bd7fb58d1882e592a85059eb16c4b83cf91847f88e5

Where is the full container ID stored ?
It is in the host file system under /var/lib/docker/aufs/mnt/


How to copy file from host to container ?
Get full container ID as mentioned above and then use the 'cp' command from the host
> sudo cp file.txt /var/lib/docker/aufs/mnt/d8e703d7e3039a6df6d01bd7fb58d1882e592a85059eb16c4b83cf91847f88e5/root/file.txt

How to coy file from container to host ?
>docker cp d8e703d7e303:/file/path/within/container /host/path/target