Install cx_Oracle on Ubuntu from rpm package

Make sure that you have installed Oracle instant client. If not, please follow this post.
1. make sure that the path in your oracle.conf file contains libclntsh.so.11.1 file
cat /etc/ld.so.conf.d/oracle.conf
#it shows
/usr/lib/oracle/11.2/client64/lib
# verify that the path contains libclntsh.so.11.1
ll /usr/lib/oracle/11.2/client64/lib | grep libclntsh
lrwxrwxrwx 1 root root        17 Aug  5  2013 libclntsh.so -> libclntsh.so.11.1
-rw-r--r-- 1 root root  52761218 Sep 17  2011 libclntsh.so.11.1
2. update ld.so.cache
sudo ldconfig
3. download and install cx_Oracle library from rpm package
sudo alien -i cx_Oracle-5.1.2-11g-py27-1.x86_64.rpm
4. Configure cx_Oracle to work with Python2.7 within Ubuntu
cd /usr/lib/python2.7
sudo mv site-packages/cx_Oracle* dist-packages/
sudo rmdir site-packages/
sudo ln -s dist-packages site-packages

Install Oracle SQL Plus on Ubuntu

Recently, I switched my development environment from CentOS to Ubuntu. I have difficulties of running Oracle SQL Plus. The installation went fine by following my previous post. However, when I tried to run sqlplus,it complains that libsqlplus.so is missing "error while loading shared libraries: libsqlplus.so": Here is the solution I used to fix the problem: Create a file oracle.conf in /etc/ld.so.conf.d
# create file oracle.conf
sudo vim /etc/ld.so.conf.d/oracle.conf
# add the following line to the file
/usr/lib/oracle/11.2/client64/lib
# then run ldconfig to update the configuration
sudo ldconfig
But when you run sqlplus again you may find it shows another error: "missing libaio.so.1, to fix that you need install libaio1"
sudo apt-get install libaio1
Now you may be able to connect to Oracle:
sqlplus user/password@//oracle_server:port/SID

Install rpm Packages in Ubuntu

If rpm package is all you got for a software package, you could follow the following instructions to install it on Ubuntu:
# install alien and all the dependencies it needs
sudo apt-get install alien dpkg-dev debhelper build-essential
# Convert a package from rpm to debian format
sudo alien packagename.rpm
# Use dpkg to install the package
sudo dpkg -i packagename.deb

Enable alt for command line editing

When I first switched from CentOS to Ubuntu I noticed that Alt+f and Alt+b do not work in command line editing. Instead it opens terminal menu...
Here comes how to enable them
Open a terminal >> Go to Edit (on terminal menu) >> Keyboard Shortcuts >> Uncheck "Enable menu access keys (such as ....)"

Install Flash Player in Ubuntu

Can not watch youtube video in Ubuntu? Here is a solution:

sudo apt-get install flashplugin-installer

Enable print to pdf in Ubuntu

apt-get install cups-pdf

The printed pdf file will be located at ~/PDF/

Let Cron Send Email Only When Something Goes Wrong

Tired of getting too many emails from cron daemon? Here is a simple solution of letting cron send you an email when something goes wrong.
sudo crontab -e
Set "MAILTO=" on top of yout first command to be executed. And add ">/dev/null" to the end of each command. Here is my example:
#run emen2 local backup everyday at 1am and sync with production server everyday at 3am
MAILTO=your_email_address
0 1 * * * /home/user/cronjobs/emen2_backup.sh > /dev/null
0 3 * * * /home/user/cronjobs/syncserver.sh > /dev/null
Restart cront using command
sudo /etc/init.d/cron restart
Here is a very good example of explaing what /dev/null mean?

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...