Jun 15, 2012

Create a HTML e-mail using Python

This is a Python script that I used to generate a HTML e-mail. Script is configured to use gmail as the senders mail host with SSL support. Change the mail server if you want to use some other mail server. If you enable the 2-way authentication on google account, that will be another problem.

Note : There are some problems with attachments. Some mail clients (yahoo) don't show the attachment.

Loading ...

May 19, 2012

Create a maven distribution package including a jar with dependencies

In this post I will show how to create a distribution package (zip/tar.gz) using maven. Package will contain the executable jar and other relevant file such as README, License etc.

First I will create the jar including all the dependencies. To do that I add following code to my pom.xml

In this pom.xml, it reffers to another xml file call dist.xml. This xml file contains all the details about the distribution package we are going to generate.
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"

You should note following thing on pom.xml and dist.xml.

In pom.xml

  • Replace this " <mainclass<HelloWorld.App</mainclass> " with your main class.
  • Replace this " <descriptor>src/main/dist.xml</descriptor> " with your dist.xml file path.

In dist.xml

  • Use <files> to add files.
  • Use <fileSets> to add directories.
  • Use <outputDirectory> to specify the destination of each file/directory.

For more details : Maven assembly plugin examples

Apr 22, 2012

xhost error in Oracle 11g on CentOS

I try to install Oracle 11g database on CentOS 5.

There was an error saying
" Checking monitor: must be configured to display at least 256 colors
>>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< "

I try all the xhost configurations and those things work fine. Then I restart my computer.

After I restart the computer I logedin as "Oracle" user. Then I re-try the ./runInstaller.sh. Finally it works.

Initially I login to the system as some one else and use "su - oracle" to change the user on the terminal.

As the solution,
First you should check the login user name. It should "oracle".
If it is oracle user, then try other things like xhost configurations.