Tuesday, November 26, 2013

SQL*PLUS

This is a quick and dirty installation of sql*plus in debian based systems.


1. Download sql plus

oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm

2. Install 'alien'

#apt-get install alien

3. Install rpms

#alien -i oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
#alien -i oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
#alien -i oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm

4. Install Linux kernel AIO library

# apt-get install libaio1

5. oracle.conf

# touch /etc/ld.so.conf.d/oracle.conf
# echo "/usr/lib/oracle/12.1/client/lib/" >> /etc/ld.so.conf.d/oracle.conf

6. configure dynamic linker run-time bindings

# ldconfig

7. Edit ~/.bash_profile and export oracle client path.

export ORACLE_HOME=/usr/lib/oracle/12.1/client64




7. Create the following file.

 # touch $ORACLE_HOME/network/admin/tnsnames.ora

8. connect to a db

# sqlplus user/password@192.168.1.8:1521/orcl

Saturday, November 16, 2013

django mysql exception

After facing some compatibility issues of my system, I upgraded my debian squeeze to wheezy. I used Python2.6 and the latest distro upgrade gave 2.7 version, which cause me to fix so many dependencies of my django project. This is one issue I faced.

    new_class.add_to_class('_meta', Options(meta, **kwargs))
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/models/base.py", line 264, in add_to_class
    value.contribute_to_class(cls, name)
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/models/options.py", line 124, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/utils.py", line 198, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/utils.py", line 113, in load_backend
    return import_module('%s.base' % backend_name)
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb


Solution:

install "python-mysqldb" "libmysqlclient-dev" from distro repositories.
install "django"
install "mysql-python" from pip.
          $ pip install mysql-python

run "python manage.py syncdb" again.

Tuesday, November 12, 2013

Compare Files


Here are  two KDE project utilities to compare files, awesome.


kdiff3


kompare
                         

Saturday, August 10, 2013

how to patch your code ?

Some of you(programmers) might not have tried patching tools before. There are many tools exist for Unix and windows to do patching. I started an opensource project a few weeks back and had no idea of what tool should I use to patch my code when needed. After a few read, I have found some tricks to do a good patching.  

If you are using a Unix system, this method might be really helpful to patch. Assume your source directory name is "test" and one of your code contributors got the same source directory.Now, you make a replicate directory of "test" called "testm" and do some changes to the source inside it. After a unit test, you want to send the modified source as a patch to your contributor. 

Open up a terminal and change the location to the parent directory of "test" and "testm".

  •  diff -Naur test testm > testpatch1.patch

Send the "testpatch1.patch" to the contributor and they should apply this patch to their source. 

  •  patch -Np1 --ignore-whitespace -d test < testpatch1.patch

Note: In this "diffing" and "patching" approach, you can include not only changes but also newly added files to the patch.

Sunday, June 16, 2013

Hungry Eyes

 I spent this weekend like a sleeping bear. It was really bored and my plans for the weekend smudged due to many reasons. One was to watch fast & furious 6, in theater. However I couldn't.  Instead of watching a new movie, I decided to watch a retro movie on Sunday. It was "Dirty Dancing". Thanks to my buddy Kristi, I got a streaming link to watch it online.

Photo Credit: Dirty Dancing Movie


The story plot is typical and not that strong as it seems. The entire story based on a vacation of Houseman Family. It was a three weeks vacation in Catskill Mountain resort. Even though it is a small story, still it gives you a good entertainment from the music and strong acting. Well, I forgot to mention about the dance. Yes, it's all about the dance. Patrick Swayze's (Johnny Castle) dance is really amazing, and I wish I could dance like him. :D Not only the finale dance for the song "Time of my life", but also in the other dancing moments, he got all the eyes from his sexy partners. Jennifer Gray (Baby Houseman) also danced well, but for me, Cynthia's (Penny Johnson) dance is the best. After all, I can say, Dirty Dancing is the best dance movie I have ever seen.  

Patrick & Cynthia,
Photo Credit: Dirty Dancing Movie


Saturday, May 11, 2013

Universal Database Manager

After a busy period, finally I got some time to spare for this blog. This time, I'm going to share something I use for my daily work in both industrial and personal.  In my technical life, I have to manage many types of databases. They are mostly varying among popular dbs, like mysql, oracle, postgre and db2. The problem I have faced was, how to manage all from one db client. I tried many clients, and some are restricted for only one specific db or others are commercial and expensive. As a free software lover, I use them as much as possible for my work. So I have found a good solution to handle multiple dbs.

It's DBeaver and it comes under GPL license. It supports for all the databases, which have JDBC diver. If you are familiar with Java eclipse GUI design, this can be visually close to you. I'm not going to explain all the stuff related to DBeaver and you can find much information regarding this awesome tool.


Sunday, April 7, 2013

STAR WARS


'a long time ago in a galaxy far, far away .....'


Just want to make a little post about some interesting work I found on the Internet. This is the ASCII version of famous movie called STAR WARS. I don't need to spend more words on this, just try this out.

Open a terminal and telnet to 'towel.blinkenlights.nl' and go. I tried this on my Debian Linux ,and hope it will work on Windows as well.

ex: # telnet towel.blinkenlights.nl


note : this is from a remote server. we use telnet to connect.