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 2.6.30.4 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 2.6.28.14 Kernel the Dual Core option from BIOS wouldn't work and installation crashed. After some readings I found that the latest Kernel (currently 2.6.30.4) 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 2.6.30.4

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
https://launchpad.net/debian/sid/+source/broadcom-sta/5.10.91.9-1

- the 32-bit driver:
https://launchpad.net/debian/sid/+source/broadcom-sta/5.10.91.9-1/+files/broadcom-sta_5.10.91.9.orig.tar.gz

- download also debian patches for this STA drivers version from:
http://patch-tracking.debian.net/package/broadcom-sta

mkdir wifi;cd wifi

# download all needed files
wget http://patch-tracking.debian.net/patch/series/dl/broadcom-sta/5.10.91.9-1/01-hidden-essid.patch
wget http://patch-tracking.debian.net/patch/series/dl/broadcom-sta/5.10.91.9-1/02-license.patch
wget http://patch-tracking.debian.net/patch/series/dl/broadcom-sta/5.10.91.9-1/03-2.6.29.patch
wget http://patch-tracking.debian.net/patch/series/dl/broadcom-sta/5.10.91.9-1/04-2.6.30.patch


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

New jambel.net


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!

Quick and simple step by step ensymble guide for Windows

This tutorial is intended for a group of people that they're not programmers or they're new to PyS60 and like to experiment making .sis applications for mobile phones. There's a lot of documentation on the internet about ensymble but not a single simple step by step guide.

So the steps we have to follow to built a .sis file are:

1) Download and install OpenSSL for Windows.

2) Download ensymble python script unzip it and copy it to OpenSSL folder (something like: C:\Program Files\GnuWin32\bin\ensymble_python2.5-0.26.py).

3) Also copy your python script to OpenSSL folder and run ensymble command on the command prompt:
python ensymble_python2.5-0.26.py py2sis --uid=0xE0000000 --appname=your_app_name --version=1.0.0 your_app_name.py your_app_name.sisnow you have probably successfully build your .sis file. Also, be sure that you have path your python directory.

4) Go to Open Signed Online and fill the required fields.

5) You'll get an email with a signed sis file.

6) Install it on your phone and enjoy it!

Good luck!

Resources:
Ensymble: http://ensymble.googlecode.com
Ensymble readme: http://code.google.com/p/ensymble/wiki/Welcome?tm=6
OpenSSL: http://gnuwin32.sourceforge.net/packages/openssl.htm
Open signed online: https://www.symbiansigned.com/app/page/public/openSignedOnline.do

Spy phone python script for S60


The other day I was surfing some surveillance websites and I found some patented mobile phones called spy phones and also some spy software. All of course, at high prices for my standards! The concept is, you call the target phone which will result in the answering of it and let you listen into the surroundings. They also have some extra features like stealth/ghost mode, no lights or zero ringings etc etc.

However the price as I mention isn't reasonable and it's possible for someone with basic programming skills and some research on the internet to do that kind of work with no money at all! How?

Well, I wrote a simple python script for S60 compatible devices that allows you to call the target cellphone, which will acknowledge a number of your choice and afterwards when you hung up it automatically start recording any ambient sound or conversation surrounding the phone.
It has no ghost or no ringing capability but if you are using a Nokia phone you can achieve this by assigning a blank sound to that entry.

I have tested it successfully on my Nokia N95 8GB with Python for S60 1.4.2 final.
You can download the script here (Last update: Sun 23 2010).

Have fun :)

Wake on LAN MIDlet

Wake On LAN Mob is a J2ME application for mobile devices.

When I first posted Wake on LAN Java MIDlet on my website I received various e-mails asking me for some extra features, modifications and source code requests. I didn't expect so much interest at all so I decided to provide the source code.

Tested on Nokia 6630, Nokia N95 8GB, Nokia E65, HTC Touch, HTC TyTN II.
Screenshots: 1, 2, 3

Here is my simple implementation, enjoy!// © J@mBeL.net
import java.util.Vector;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;

public class WakeOnLan extends MIDlet implements CommandListener {

    private Display display;
    private Form mainScr;

    private Command OKCommand;
    private Command ClearCommand;
    private Command exitCommand;

    private static TextField tfIP;
    private static TextField tfMAC;

    private Alert alert;

    private static final int PORT = 9;

    public WakeOnLan() {
        display = Display.getDisplay(this);
        mainScr = new Form("WakeOnLan Mob");
        tfIP = new TextField("IP Address:\n", "", 16, 0);
        tfMAC = new TextField("MAC Address:\n", "", 17, 0);
        mainScr.append(tfIP);
        mainScr.append(tfMAC);
        mainScr.append("© 2007 jambel.net");
        OKCommand = new Command("Send", Command.OK, 1);
        ClearCommand = new Command("Clear", Command.ITEM, 1);
        exitCommand = new Command("Exit", Command.EXIT, 1);
        mainScr.addCommand(OKCommand);
        mainScr.addCommand(ClearCommand);
        mainScr.addCommand(exitCommand);
        mainScr.setCommandListener(this);
    }

    private class SendPacket implements Runnable {
        public void run(){
            SendStr(tfIP.getString(), tfMAC.getString());
        }

        private void SendStr(String ipStr, String macStr) {
            if(ipStr.length() == 0 || macStr.length() == 0) {
                alert = new Alert("Please fill IP and MAC address fields.");
                display.setCurrent(alert, mainScr);
                return;
            }
            else {
                try {
                    byte[] macBytes = getMacBytes();
                    byte[] bytes = new byte[6 + 16 * macBytes.length];
                    for (int i = 0; i < 6; i++) {
                        bytes[i] = (byte) 0xff;
                    }
                    for (int i = 6; i < bytes.length; i += macBytes.length) {
                        System.arraycopy(macBytes, 0, bytes, i, macBytes.length);
                    }

                    String address = "datagram://" + ipStr + ":" + PORT;
                    DatagramConnection packet = (DatagramConnection)Connector.open(address);
                    Datagram dgram = packet.newDatagram(bytes, bytes.length, address);
                    packet.send(dgram);
                    packet.close();

                    alert = new Alert("Wake-on-LAN packet sent.");
                    display.setCurrent(alert, mainScr);
                }
                catch (Exception e) {
                    alert = new Alert("Failed to send Wake-on-LAN packet: " + e);
                    display.setCurrent(alert, mainScr);
                    return;
                    //System.exit(1);
                }
            }
        }
    }

    private byte[] getMacBytes() throws IllegalArgumentException {
        byte[] bytes = new byte[6];
        String sep;
            if(tfMAC.getString().indexOf(":") > 0)
                sep=":";
            else
                sep="-";
                String[] hex = split(tfMAC.getString(),sep);
            if (hex.length != 6) {
                throw new IllegalArgumentException("Invalid MAC address.");
            }
            try {
                for (int i = 0; i < 6; i++) {
                    bytes[i] = (byte) Integer.parseInt(hex[i], 16);
                }
            }
            catch (NumberFormatException e) {
                throw new IllegalArgumentException("Invalid hex digit in MAC address.");
            }
        return bytes;
    }

    private static String[] split(String original, String separator) {
        Vector nodes = new Vector();

        // Parse nodes into vector
        int index = original.indexOf(separator);
        while(index>=0) {
            nodes.addElement( original.substring(0, index) );
            original = original.substring(index+separator.length());
            index = original.indexOf(separator);
        }
        // Get the last node
        nodes.addElement( original );

        // Create splitted string array
        String[] result = new String[ nodes.size() ];
        if( nodes.size()>0 ) {
            for(int loop=0; loop < nodes.size(); loop++)
                result[loop] = (String)nodes.elementAt(loop);
            }
        return result;
    }

    public void commandAction(Command c, Displayable d) {
        if (c == OKCommand) {
            if (d == mainScr) {
                SendPacket doIt = new SendPacket();
                Thread myThread = new Thread( doIt );
                myThread.start();
            } else {
                display.setCurrent(mainScr);
            }
        } else if (c == ClearCommand) {
            tfIP.setString("");
            tfMAC.setString("");
        } else if (c == exitCommand) {
            destroyApp(false);
            notifyDestroyed();
        }
    }

    public void startApp() {
    Display.getDisplay(this).setCurrent(mainScr);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}
You can download it here.

You can freely distribute it as you wish and if you like just add a reference on me.
Also you can e-mail me your modifications just to notify me.

Welcome to jambel.net blog

This is my first blogging attempt!

My name is John Ambeliotis and I'm a Software Engineer from Greece. You can check my full profile here if you like.

In this place I'll try to share some code parts I use and how do I do things in a range of computer languages/technologies. Also maybe some thoughts or life events that might happen and worth some mention, at least to me :)

I hope you to find some useful stuff.

Thanks for your visit, let's get started...