Change between workspaces using HP 2140 accelerometer

HP mini 2140 netbook comes with an ST Microeletronics accelerometer and under linux kernel 2.6.27 we found a driver that supports it (LIS3LV02Dx).
With wmctrl and some scripting we can toggle between workspaces when we tilt the machine left or right. This is a useless script but it has some fun :)

First you need to install wmctrl
sudo apt-get install wmctrlbash shell script - Download#!/bin/bash


while [ $COUNTER -le 100 ]; do
    sleep 0.5
    POS=`cat /sys/devices/platform/lis3lv02d/position | awk -F "(" '{print$2}' | awk -F , '{print$1}'`
    echo $POS
        if [ $POS -ge 12 ]; then
            wmctrl -o 1024,0
        elif [ $POS -le -12 ]; then
            wmctrl -o 0,0
    COUNTER=$(( $COUNTER + 1 ))
UPDATE Sep 8, 2009: an approach in python - Download#!/usr/bin/python
import time
import os
while cnt <= 100:
    f = open ('/sys/devices/platform/lis3lv02d/position','r')
    data =
    ar = data.split(',')
    results = ar[0].replace('(',''), ar[1], ar[2].replace(')','')
    print results
    if (ar[0].replace('(','') >= '12'):
        os.system('wmctrl -o 1024,0')
    elif (ar[1] <= '-12'):
        os.system('wmctrl -o 0,0')
    cnt += 1
Note: Scripts will work when System/Preferences/Appearance/Visual Effects is set to Normal or Extra.

Show and hide gnome panels using gconftool-2

I own an HP mini 2140 netbook and as you might know the 1024x576 resolution is a little bit annoying. In order to gain some space I removed the bottom panel and decide to hide the top. I really don't like the autohide method and I needed something to do it manually. Then I open gconf-editor to figure out the settings that gnome using to apply these methods. When I found them I created 2 new custom keyboard shortcuts and wrote the followings:

Hide Top Panel
gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/auto_hide" --type boolean "true"
Show Top Panel
gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/auto_hide" --type boolean "false"
By default the size of the hidden panel is 6 so to gain even those 6 pixels make sure you run this first to resize it to 0.
gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/auto_hide_size" --type integer 0
Under Ubuntu everything works great!

Oakley Minute 2.0

My favorite sunglasses firm is Oakley by far! After 9+ glorious years with Oakley Minute I step forward to the next generation Oakley Minute 2.0 Polarized this time! What can I say, sunglasses rocks and they're definitely deserve the term HDO (High Definition Optics).

Ubuntu 9.04 (Jaunty Jackalope) with Kernel on HP 2140

Recently I bought an HP mini 2140 netbook and decided to install Ubuntu on it. As I browsing around for known issues on this machine I get into that with default Kernel the Dual Core option from BIOS wouldn't work and installation crashed. After some readings I found that the latest Kernel (currently fixed the problem so I proceed installation with Dual Core option disabled.

After that everything works like charm except wifi. I look around again in Ubuntu forums, blogs etc and come with this solution from Jocelyn's Blog. Let's see it step by step:

- Download and compile latest Kernel, or use my ready made

to install these files just run dpkg -i packagename.deb

- preparing the installation of STA Broadcom drivers
sudo apt-get install module-assistant
sudo module-assistant prepare

- download the Broadcom STA driver from

- the 32-bit driver:

- download also debian patches for this STA drivers version from:

mkdir wifi;cd wifi

# download all needed files

mkdir hybrid;cd hybrid

# unpack the driver
tar zxf ../broadcom-sta_5.10.91.9.orig.tar.gz

cd broadcom-sta/

# patch the driver
patch -p1 < ../../01-hidden-essid.patch patch -p1 < ../../02-license.patch patch -p1 < ../../03-2.6.29.patch patch -p1 < ../../04-2.6.30.patch cd i386/

# make the module
make -C /lib/modules/`uname -r`/build M=`pwd`

# copy it to modules location and load the module
sudo cp wl.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/
sudo depmod -a
sudo modprobe wl

- in order to make sure the wl module is loaded after the reboot I’ve added wl to /etc/modules
sudo echo wl >> /etc/modules

Everything went well but wifi remained unavailable. I tried lspci -v and realize that Kernel driver was in use wasn't the wl but ssb (b43-pci-bridge). Then I read about KernelModuleBlacklisting from Debian Wiki and come up with the following solution:

sudo echo blacklist b43 >> /etc/modprobe.d/b43.conf
sudo echo blacklist ssb >> /etc/modprobe.d/ssb.conf
sudo modprobe -r b43
sudo modprobe -r ssb
sudo modprobe -r wl
sudo modprobe wl
sudo depmod -ae

- recreate initrd and restart Network Manager

update-initramfs -u
sudo service NetworkManager restart

and voila! wifi worked perfectly at last!
This tutorial will probably work for all devices using Broadcom BCM4322.

Got lucky with Kawasaki

Past Sunday (9 Aug 2009) a friend of mine went on vacations and left me his motorcycle a Kawasaki ZX-10 '07, so we arrange with another friend go for a ride and check it out. I was very exited because mine was out for service (Yamaha R1) and I had the opportunity to check out the ZX-10 and the GSX-R of other friend.

We went to Arachova and everything was great til returning. When we left mountains and lots of turns we rich the highway and decide in some part of the road to open the throttle a little bit, so we accelerate and at around 230km/h I realize that something was wrong with the back side and start decelerating but in 200km/h the bike started to "dance"! I tried not to panic and be as calm as I could to make very precise handlings in result to stop it.

Fortunately everything ended well and I'm just fine!

The mechanic told us that he found a piece of metal stuck in the tire and in combination with roads high temp it cause the tire to "burn".

Incident in pictures...

Real Time Color Based Object Tracking

This is my first attempt on Real Time Color Based Object Tracking/Recognition from a C# application I've build using AVICap.
The technique is very simple and very slow but it describes the basic idea... I use avicap32.dll to interact with webcam, grabbing the frames and represent them in a new picture box. After that the program scan every new picture-frame to track the position of a constructed RGB palette based on the sampling pixel.

There is also some other more sophisticated methods which applies image filtering like thresholding or bluring but it's still under -a lot of- development and I don't want to go further yet. Probably I won't even bother to implement.

Source code Download.

ASP.NET (C#) Intranet Application/CMS

This is one of the latest project I've created for the company I currently work for. It's an intranet/CMS application developed in .NET platform.

You can take a sneak peek here or click the image.

Login information

username: demo
password: demo

This is just for demo purposes and some modules may not be working properly due to some policies and settings. I'm going to debug it thou and provide it as complete as possible.
UPDATE: I believe now it's in a mature competitive level!

UPDATE #2 (April 7, 2010): Download User Manual


My new website based on Joomla is ready!
See you there...

UPDATE: I discontinue updating joomla website and I'll continue writing in this blog.

Working abroad

After lots of thoughts and consideration I decided that I'm available working abroad especially in Berlin, Germany.
If you are an employer and you are interested to hire me then maybe you want to take a look at...

     * About me and my career so far
     * My complete resume
     * Contact me

Any proposal are very welcome!

Thanks in advance!