Some notes on modularity in PlayFramework2

PlayFramework2 met lots of disapointments from frist release fans. The Internets is full of questions "How to do that I did it in Play 1". People found groovy templates better than Scalate, Jobs more intuitive than Akka and sbt is quite performance eating and upredictable in comparison to previous play python console. Otherwise second version bring really new level of

Read More »

Adding Captcha in PlayFramework2

Built-in captcha has been gone in PlayFramework2. But to plug-in reCaptcha you may find even easier. I will try to keep my examples as simple as possible and without unnessasarry option you may plug later to improve this approcach. First of gain public and private keys from, choose option to generate global key in case you are going

Read More »

Add Web Content Type to Liferay

Web Content is powerfult abstraction to public web articles and pages in Liferay CMS, but   on the moment this entry is created there is no way add web content type. In order to be able to use custom content type you have to add the following line to file liferay-portal-a.b.c-ce-ga1/tomcat-x.y.z/webapps/ROOT/WEB-INF/classes/


where new type is ID of your newly created type, don't

Read More »

Standalone C++ app on Windows with Qt framework


While *nix world gives us power of shared libraries and packaging with dependency management on Windows operating systems you have to either place everything in the same box with your application or hope that user is experience enough to download and install all necessary libraries or virtual machine (ha-ha). The alternative way is to build stadalone or static

Read More »

Modular C++ projects with CMake


Cmake if fantastic make tool for C++. It allows you to generate makefiles for every platform you need, itsteand of writing them manually. As and addition it alllows you to generate project files from variety of IDE's while the most of C centric alredy have Cmake support.

Project Structure

We will organize project tree as set of subprojects. Each of subproject will

Read More »

Syncronize WebDAV with local folder

WebDAV is data exchange protocol that has some benefits in comparison with plain old FTP and SMB.

  • It's supposed to be more secure
  • It supports some advanced file features like locks and versioning

It is widely used by file hostings, document management systems: GoDaddy Online File Folder, Yandex.Disk . It is supported natively but all modern operating systems

Read More »

Execute system command from Java

We will take canonical hello world up for demonstration.

import java.util.Scanner; import*; public class Program { public static void main(String[] args) { try { Process p = Runtime.getRuntime().exec("echo 'hello' > /tmp/hello.txt"); Scanner sc = new Scanner(p.getInputStream()); while (sc.hasNext())

Read More »

Tomcat6, Nginx and PHP in one Linux box


You should install tomcat either from packages

$sudo apt-get install tomcat6 tomcat6-admin

or from downloadable bundle and ensure it's running on port 8081 by finding in server configuration file (server.xml) lines similar to the following:

<Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000"

Read More »

Allow remote connections for MySQL on Windows

So you are you able to connect your MySQL database on Windows ? You have two optioins.

1. Disable Firewall. Easy and popular way of solving problem for win users is to disable something but I do not recommend this to you

2. run cmd.exe and execute the following command:

C:\>netsh advfirewall firewall add rule name="MySQL Server" action=allow protocol=TCP dir=in localport=3306

This will add

Read More »

Install Liferay 6 on Linux with external MySQL database


Liferay is bundled with HSQL database included, but you can install with external database usage enabled. Assume you have installation of MySQL and your linux distribution is not very different from Ubuntu, CentOS or other widely used.


First of all check your database server supports TCP connections in addition to default socket. You should have the following line uncommented in [mysqld]

Read More »

Getting swftools on Linux (Ubuntu)

Get the source code and dependencies

Swftools package that provides pdf2swf tool currently available only for Ubuntu Hardy that is long time all not about us. So to get it we will build it from source. First of all navigate to the dir you are going to store sources, suggest somewhere they will not be deleted, e.g. /usr/local/src. cd to it

Read More »

Build kernel from 3rd-party sources on Debian 5

There are several way to build your kernel on Debian Linux and building it from kernel-sources is most recomended way, but it's possible that you need to build it from original tarball or some non-offical patchset. This artical describes the way to do this without turning your system into Slackware.

Install necessary packages:

$sudo apt-get install debhelper mc kernel-package libncurses5-dev tar bzip2


Read More »

Howto reset MySQL root password

Yes, this is the probably what we all done before, and tons of blog tips are cached by Google, but I want to have my own note for this).

Well find your MySQL configuration file that is named my.cnf. You may use locate index search in your Linux box if you previously installed it as follows

$locate my.cnf

or use whereis command (Hey,

Read More »

Dealing with Android emulator slow starting

The Android emulator is starting slow. So if you are developing with Titanium framework you probably had the following messages:

[ERROR] Timed out waiting for emulator to be ready, you may need to close the emulator and try again

The solution is simple: just do not close the emulator between coding & building, your app will be restarted when it necessary within

Read More »

Android friendly translation strings in Titanium

Titanium has lots of pitfalls, hope they will disappear in nearest future.

I just spent some hours on finding out why my Titanium app won't build for android. The reason is that you can not use non-alphabetical letters symbols in translation string names  and event spaces. This mean that you should have L('hello_world') instead of L('Hello World') in your multilingual crossplatform

Read More »

Crossplatform layouts on Titanium Framework

Titanium Framework allows you to develop cross-platform applications using one code base. In particular Titanium Mobile allows to develop apps for iOS, Android and Blackberry devices. Mobile applications on Titanium are coded with JavaScript and built to almost native binaries for each platform.

The problem is that they all have different screen resolutions and ui customs. Happily starting from version 1.5

Read More »

Transparent cache in Nginx


Let's assume you have website that is regulary occures under Slashdot effect. We should perpare it for highload.

Starting from 0.8.46 nginx has some options to enable transparent cache. Transparent for every visitor, in other words this cache if effective until user is not logged in. This options will help servier be live when user visits are rapidly grown. To acquire

Read More »

Apacheless web-server on Debian Squeeze with nginx and php-fpm

Threre are tons of information on now to setup "parts" that making fully functional web server plaftorm, but usually without giving summary view. We're going to explain all steps on you how to get your LAMP web server up. Things you should have:

  1. Virtual or real personal (dedicated) server hosting. You'd better have 5Gb of disk space and 256 RAM. Not

Read More »

Using SNORT as service IPS


There are lots of resources related to SNORT, but in most cases it proposed to be used as tool to watch on network activity. This article describes how to use SNORT as Intrusion Prevention System (IPS) to watch and controll not all network traffic but the only can be described with iptables (Linux firewall) rules. I will not teach you

Read More »

LDAP & Samba management with LAM on Debian Squeeze

1. Console Tools

There are a number of console tools for LDAP and Samba control:

  • smbldap-groupadd
  • smbldap-groupmod
  • smbldap-passwd
  • smbldap-useradd
  • smbldap-userinfo
  • smbldap-usermod
  • smbldap-groupdel
  • smbldap-groupshow
  • smbldap-populate
  • smbldap-userdel
  • smbldap-userlist
  • smbldap-usershow

Your are free to use them in interactive way or write some scripts. Some operations e.g. import of users can be done much more faster with their help than in any GUI tool. Names tell enough about their functioinality.

2. Ldap-account-manager

This tool is quite good for LDAP+Samba combination

Read More »