SMTP setting for GMail in Evolution


This post of mine involves the least technical depth probably :), it is mainly about configuring SMTP for GMail with Evolution mail client (not that it could not be figured from the image). As GMail users know GMail does not use the default SMTP port (25), the custom port number has to be mentioned in the configuration and though there is no field labelled as Port, but users can easily set the port number as I did. Please see the red border region for it in the image - server-address:port. If required port number can also be provided in similar fashion for incoming mail server.

Modular project development - with Maven and GIT

For sometime I have been searching for a combination for Multi-Module project development with SCM and Project Build tool. After using and testing some tools I have settled GIT and Maven; actually honestly speaking I have quite impressed by GIT. Though the main repository for my projects will be either CVS and SVN because dev.java.net provides those only but the developers will be requested/encouraged to use GIT (through online collab) as their local/team SCM/VCS. As result of my conviction I have decided to start a plugin for GIT-NetBeans integration as well; Almighty willing. At first I will use it for the DatabaseReport and JAIN SIP adapter projects. Everyone interested can join in any of the 3 projects (including the GIT-NetBeans Plugin).

NetBeans RCP development with Maven

I have been wanting to work with NetBeans RCP for quite some time now, but I felt that resources were lacking; then came along API changes for NetBeans 6.0 Platform and I felt there is a lot of improvement in it, along with its platform home, the excellent RCP book and Maven integration for plugin/suite/Rich Client Application development (I personally tested it whether it works or not and it does smoothly except that when I was reading it Figure 4 and Figure 6 were in opposite places), now I reckon NetBeans RCP as a force. The biggest advantage of NetBeans RCP that actually initially dragged me to NetBeans was the JavaHelp integration.
I just wish NetBeans also support(s)/ed GIT. Actually I am planning to add support for it in NetBeans.

Killing a process in Linux

As a software developer one thing I have several times is killing a process, some people will term is as ugly or bad, but general software developers often come across situation where killing a process is handy or necessary. I will mention some use cases later in the blog.

Killing a process usually involves 2 steps. Finding the process ID that is intended to be terminated and terminating it with a kill statement. Step one for general users (like myself) again involves a ps command with some grepping and then manual lookup. I have to these almost every time I kill a process. I have simply put this steps into this script so that I can do them in a single command. If someone has any improvements please inform me about it.

The shell script expects 3 arguments, of which 2 are mandatory and 1 is optional. The first 2 are grep params to identify the process. For example, to identify a Tomcat running Escenic Content Engine I use java and escenic.root to identify the process. The third param is the user to search it with. If it is not provided then whoami will be used to determine the user executing the shell.


This shell script has enabled me to sync, build, deploy my projects all with a single command and this helps me save some sustainable amount of time. Now without a build server I can still achieve what a build server like Hudson can do. Actually I use this script from within Hudson and thus I almost "never" have to be concerned about deploying applications to my demo server. I hope this is useful to all.

Guarding against softwares with memory leak

I have been using IntelliJ IDEA as the IDE for my project development. It has been satisfying but sometimes it annoys me a lot. For example, when I am typing in the code editor and all of a sudden I cant hear the music playing (which I always play while coding), the IDE stopped responding and the mouse pointer hardly moves. The only way to start working normally again is to restart my laptop and on a laptop it is not a happy scenario to force reboot and moreover I do not like force reboot as a solution. So first I had to detect what caused the catastrophe and I find that the Java VM running IDEA keeps taking up memory linearly at 45 Degrees angle in the resource monitor. Furthermore this is not a infrequent event it usually occurs 2-3 times a day.

As I could not live with the reboot I had too make sure it did not occur and for that I thought of the a solution - I will have a cron job that will monitor the used memory by IDEA and will kill it if it crosses a certain amount. So I wrote a shell script and created a cron job following the the Ubuntu help. That solved my problem. The shell script can actually be used to kill any Java process that leaks memory and might disrupt the normal flow of PC usage experience.

If anyone has any alternate solution please feel free to share it.

WinRAR on Ubuntu

As a novice Linux and Ubuntu Fiesty Fawn user I have faced some issues related to RAR Archives. WinRAR is the Windows tool widely used for this purpose and it is also a powerful archiver. If one has wine installed as mentioned in one of my earlier blogs they can install WinRAR in no time following this.

I am just mentioning the steps in short.
  • Download WinRAR 3.7
  • wine {PATH_TO_EXE}. E.g. wine wrar371.exe. Having Desktop emulation configured using Wine is necessary. winecfg -> Graphics -> Emulate.... checkbox
  • Run WinRAR with the following command: wine {PATH_TO_INSTALLATION}/WinRAR.exe
I hope all enjoys WinRAR on Ubuntu.

Developing projects that support multiple Databases

It is a common scenario in product/project development that there is a requirement to support multiple databases. This actually leads to 3 challenges - generating DDLs for the DBMS, keeping the queries in Data Access Layer portable across the DBMS platforms and optimizing the read SQLs for the specific DBMS platform. This blog entry will cover only introduce the probable solution to the first of the three challenges.

DDL usually differs from one DBMS to the other. When it comes to generating DDLs there is a issue of creating or altering a table. i.e. when the DDLs are being executed for the first time it should create the database, whereas on consecutive execution it should only execute the alter table table columns to ensure that only the changes are taking effect. There is also the issue of being able to generate the DDLs when required - both the whole DB script and the alter table script. We would also like the script to be generated and executed only on specific cycles of build process.

After searching the internet the tool that caught my eye is the DDL Utils project of the Apache DB Project. This tool fulfils the requirements described above when used in conjunction with Maven. Have a look at the following sample project to see how it can be achieved.
Sample Project
After decompressing the sample project please go to the maven-plugin folder and execute the shell script. Windows users can simply use the same command in it :). As the example uses MySQL please check the connection parameters in the /src/main/resources/com/smartitengineering/.../schema/
db-connection-params.properties.

The project is build around maven and thus the DB operations are also attached with the Maven commands compile, install and deploy. Their outcomes are as follows:
  • mvn compile - Generates the DDL for the whole schema regardless of the current DB state
  • mvn install - Generates the DDL required to sync the current schema to the DB; that is generates the minimum possible alter table statements
  • mvn deploy - Execute the alter table ddls on the DB to sync with the latest state
The first 2 only generates the DDLs but does not execute them. You can find the DDLs in the target folder. Another thing to note is that the POM file takes the DB parameters as properties so they can lie anywhere. Currently I am reading it from a properties file in the classpath and the additional plugin is required for this purpose. Important links of the tool are -
DDL-Utils Ant Tasks
Schema Documentation
In order to get the deploy working you will need a valid repository to deploy. So that is the only thing that needs to be edited in the POM file.

All in all the tools is very useful handy when it comes to DDL generation and history maintenance. The only thing I found missing in the tool's release is support of ON UPDATE/DELETE CASCADE/RESTRICT/.. support. Though the schema supports it, the implementation does not support it; but considering the whole this is quite a useful tool. The good news is that the source code in the SVN has support for it during creation only and not in altering, so we can hope to see it soon as well

Getting Intel 82801G to work in Fiesty Fawn

My new laptop is a Acer Aspire 5585WXMi. It ships with ALC883 Intel HDA chipset. I could get everything to work with Ubuntu Fiesty Fawn except for my sound card and it was so sad that I could basically work with everything excepting for sound.
After trying a lot of things all of a sudden it started to work. So I started looking into why and how. I noticed that I have ALSA 1.0.15rc1 installed from the source code; I did that basically as instruction provided from the Ubuntu help but the wiki alone did not solve the problem then. Later I have installed alsaplayer-alsa, alsaplayer-gtk, alsa-tools and alsa-tools-gui packages and ran alsaconf again. Used the ALSA mixer to turn the PCM channel on and set full volume and then all of a sudden hurrah! there is sound in my laptop. But I do not think that upgrading to ALSA 1.0.15 is required it could be achieved in 1.0.13 as well if the additional packages are installed but that is my hypothesis, I am not absolutely certain. I hope this works for others as well. If it does let me know.

Search