Tuesday, April 23, 2019

Useful variables and aliases in bash profile

export NODE_NAME=`hostname -s`
export COMPUTERNAME=`hostname -s`
export ip_addr=`ip -f inet addr show eth0|egrep inet|awk '{print $2}'|awk -F/ '{print $1}'`

export http_proxy=http://www-proxy.us.oracle.com:80
export https_proxy=$http_proxy
export no_proxy=localhost,127.0.0.1,.oracle.com,.us.oracle.com,10.244.0.0,.oraclecorp.com

export HTTP_PROXY=http://www-proxy.us.oracle.com:80
export HTTPS_PROXY=$http_proxy
export NO_PROXY=localhost,127.0.0.1,.oracle.com,.us.oracle.com,10.244.0.0,.oraclecorp.com

export JAVA_HOME=/home/oracle/tools/jdk1.8.0_202
export ANT_HOME=/home/oracle/tools/apache-ant-1.9.13
export MAVEN_HOME=/home/oracle/tools/apache-maven-3.6.0

export ORACLE_HOME=/osmxarth/thirdparty/oracle/product/12.1.0/dbhome_1
export ORACLE_SID=orcl12c


export NO_JAVA_PATH=$ANT_HOME/bin:$M2_HOME/bin:$ORACLE_HOME/bin:$HOME/bin:/sbin:$PATH

PATH=$JAVA_HOME/bin:$NO_JAVA_PATH


alias ipa='ip -f inet -br addr'
alias vi=vim
alias l='ls --color=yes -alh'
alias ll='ls --color=yes -alh'
alias free='free -hltw'
alias free='free -glta' (older ip package)

Tuesday, February 12, 2019

Useful Yum commands

Few useful yum commands

  1. yum list installed - Gives a list of already installed packages
  2. yum history list   - Gives a list yum installs. Note that one can install multiple packages and their dependencies in a single invocation. Example, yum install docker-ce, docker-ce-cli
  3. yum history info   - Gives the details of yum invocation for each of the historical entry above.
  4. /var/log/yum.log - also contains log of yum installs
  5. yum list docker-ce --showduplicates | sort -r  - Shows all the versions that are present for docker and sorts them.

To find difference in packages between installs -

  • Before installation - 

rpm -qa --qf '%{NAME}.%{ARCH}\n' | sort > old-installed-rpms.txt

  • After installation - 

rpm -qa --qf '%{NAME}.%{ARCH}\n' | sort > new-installed-rpms.txt

  • Diff - 
diff old-installed-rpms.txt new-installed-rpms.txt | grep '^<'



Tuesday, March 22, 2016

Remote Interview Tools, Online Java Compilers & Cloud hosted IDE

Very good for Interviews (Basic stuff available for free, advanced features on purchase)
Basic Online Compilers (Free or Ad-supported)
Cloud Hosted IDE (Paid services only)

Tuesday, January 20, 2015

Modify Windows Control Panel Settings from command-line

I recently discovered that many Control Panel settings in windows can be opened from command-line. The article from Microsoft How to run Control Panel tools by typing a command explains.

Windows Command line shortcut to set Environment Variables


In order to invoke the System window and later set the Environment variables, the below command-line could be handy. It will avoid some mouse-clicks :)

C:\windows\system32>control.exe sysdm.cpl,System,3



The above command can also be saved into a bat file and placed conveniently on Windows Desktop.