A Very Cool Oracle Bash Profile

[code language="css"] # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH # Oracle Settings export TMP=/tmp export ORACLE_HOSTNAME=easyoradba.com export ORACLE_UNQNAME=ora12c export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1 export ORACLE_SID=ora12c export CATALINA_HOME=/home/oracle/apache-tomcat PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin:$CATALINA_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; alias ob='cd $ORACLE_BASE' alias … Continue reading A Very Cool Oracle Bash Profile

Create pem file for SSH access Linux

It is always good practice to lock down password based logins and SSH using keys. We can use pem files to login to remote server from local machines. Infact if you use AWS, the only way to SSH into the server is using pem files. This procedure can be done on any server cloud based … Continue reading Create pem file for SSH access Linux

Column count of mysql.user is wrong. Expected 42, found 39. Created with MySQL 50173, now running 50560. Please use mysql_upgrade to fix this error.

This error occurred in my environment when i tried to create a user in MySQL, most likely you have upgraded MySQL Server (51. to 5.6  in my case) . After upgrading your MySQL you have to run  mysql_upgrade to fix any incompatibilities in System tables. If it finds any errors it automatically repairs it and … Continue reading Column count of mysql.user is wrong. Expected 42, found 39. Created with MySQL 50173, now running 50560. Please use mysql_upgrade to fix this error.

Documentation#1193 – Unknown system variable ‘lc_messages’

This error you would usually see when you login to phpMyAdmin after an upgrade. This is related to your MySQL version, in my case I had upgraded my phpMyAdmin but the MySQL version was still on 5.1, after upgrading to MySQL 5.6 it solved the issue You can upgrade MySQL to the latest version by … Continue reading Documentation#1193 – Unknown system variable ‘lc_messages’

Install NodeJS on CentOS 6 – 7

Install Latest NodeJS on CentOS 6 or 7 -------------------------------------- 1. Add Repo and Install NodeJS For Stable Release:- $ yum install -y gcc-c++ make $ curl -sL https://rpm.nodesource.com/setup_8.x | sudo -E bash - $ yum install nodejs   2. Check the version for Node and NPM $ node -v v8.11.1 $ npm -v 5.6.0   … Continue reading Install NodeJS on CentOS 6 – 7

Execute Windows Commands from Linux using winexe. Connect from Linux to Windows without SSH

Winexe – is a software on Linux which uses RPC to run remote commands and might even come with your distribution's packages. It depends on Samba for running rpc commands Edit: even if your distro does not have it precompiled and you do not want to compile yourself, you should check out the Build Service … Continue reading Execute Windows Commands from Linux using winexe. Connect from Linux to Windows without SSH

Compare 2 Servers RPM and Install RPM from Text File List

1. Generate RPM list on Old Server rpm -qa --queryformat='%{NAME}\n' | sort > serverold.txt 2. Generate RPM list on New Server rpm -qa --queryformat='%{NAME}\n' | sort > servernew.txt 3. Copy File to New Server and use diff comand to get differences diff serverold.txt servernew.txt > diff.txt 4. Get list of packages missing in new Server … Continue reading Compare 2 Servers RPM and Install RPM from Text File List

Shell Script to Ping Hostnames and Send SMS if Host is not Available

We use the below procedure to ping hosts and based on availability send SMS to our team. The SMS is send by calling a web service from the BASH Shell script using curl  The hosts are defined in a file called hosts.txt -- Shell Script -- #!/bin/bash current_time=$(date "+%Y%m%d%H%M%S%3N") #### Above Date Format is in … Continue reading Shell Script to Ping Hostnames and Send SMS if Host is not Available

Shell Script to Add Date to Filenames

Below Shell Script will append Date to all FileNames in Directory with extension .TXT. Also it will create a folder with the Date and move the files to it. #!/bin/bash FILE="$(date +%Y%m%d)" cd /bi_dataload mkdir -p /bi_dataload/BI_$FILE for f in *.TXT do mv -n "$f" /bi_dataload/BI_$FILE/"${f%%.*}"_"$FILE".TXT done

Linux Matrix Effects Shell Script

Sometimes to have a funky time on the BASH shell you can run the below shell script [code language="bash"] #!/bin/bash clear virtcent=$((`tput lines`/2)) horcent=$((`tput cols`/2-10)) tput setf 6 tput cup $virtcent $horcent && echo "entering the matrix" sleep 1 tput cup $virtcent $horcent && echo " " sleep 1 tput cup $virtcent $horcent && echo … Continue reading Linux Matrix Effects Shell Script