Ubuntu 12/13 install and configure Java JRE

1. Download JRE 7 from Oracle website. 2. Unarchive the file: [code language=”bash”] tar zxpvf jre-7u25-linux-x64.tar.gz [/code] 3. Create the installation directory [code language=”bash”] sudo mkdir -p /usr/lib/jvm/ [/code] 4. Move the unarchived directory in the newly created one [code language=”bash”] sudo mv ./jre1.7.0* /usr/lib/jvm/jre1.7.0 [/code] 5. execute this wonderful command: [code language=”bash”] sudo update-alternatives… Continue reading Ubuntu 12/13 install and configure Java JRE

Example for singleton decorator pattern in python

I know there is not very common in Python to use the singleton pattern, but I found a nice implementation of this pattern in Python 3 Patterns, Recipes and Idioms book. Starting with that example I implemented an equivalent of the well known PHP getConnection example. You have the code below: This is the class that… Continue reading Example for singleton decorator pattern in python

Install MySQLdb for Python 2.x

If you want to install MySQLdb for Python 2.x, without using the package manager of your Linux distro (Ubuntu in our case), you can do it through pip like this: First you must to have installed libmysqlclient-dev (and, of course pip) [source language=”bash”] sudo apt-get install libmysqlclient-dev [/source] After that execute this two commands: [source… Continue reading Install MySQLdb for Python 2.x