Monday, November 16, 2009

first job as freelance,.. completed ...

ok yesterday, completed my first job as a freelance. this job is rather a complimentary, to support my r&d on my new apps. I need to purchase some devices, new laptop etc.

The job is actually about setting/recovering an active-passive mode cluster base on Redhat Cluster Suites. Manage to solved the OS boot crash failure, and reconfigured everything, the image extracted from system specs doc delivered to the customer.

Job completed in 6 hours... (Alhamdulillah) expecting first pay check today...

Saturday, November 14, 2009

Saturday, November 7, 2009

Rubik...

For few days I'm scratching, jumping, deep thinking, looking for a killer apps idea, an unique one, a web app that make people scream, so unique that make you cry... (or the other way around)...

suddenly ....... BINGO!!!



a Rubik...!!! yes... a Rubik... The idea is just like a Rubik, but with a different approach.


This is what happen when you try to solve it (or at least to me).



The left pic is a solution and a nice thing to have, the idea is
to make the scrambled/twisted rubik also a solution, and can be a better or even a nicer thing too.



The best part of it, you are not limited to single boring same color solution, but a varieties, and it is so simple anybody can do it. Just close your eyes and twist.. eureka!!!

Tuesday, November 3, 2009

New Chapter...

This is my last month working as an employee to an employer. I'm back to where i was (more or less) 10 years ago. Not expecting this myself, quite a shock for me too, but things just happened. Sad? little, what do you expect? Been working with this 'employer' for 10 years, building things together, and so... got to move and keep going, no turning back!

Preparations?, u can consider it "/dev/null". No plan, no emergency exit, but only.....

so, there will be no more post about the "new product/replacement model" like in my previous blog post all about, i'm no longer part of it...

starting a new chapter ...

Thursday, October 29, 2009

python urllib2


I'm trying to develop a code that actually get the html page of a given url, extract some text/desc from headers or body of the html page, and get some images, set it as thumbnail for the link itself.

initially i'm using this simple steps:

import urllib2

req = urllib2.Request('http://www.voidspace.org.uk')
response = urllib2.urlopen(req)
the_page = response.read()

and it works, however after several test, it fails on this
url: http://en.wikipedia.org/wiki/Sloth
and error given to me in python cli:

File "/usr/lib/python2.6/urllib2.py", line 510, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden

403: Forbidden

googling around few minutes, i found this statement in python doc :

Some websites dislike being browsed by programs, or send different versions to different browsers [3] . By default urllib2 identifies itself as
Python-urllib/x.y (where x and y are the major and minor version numbers of the Python release, e.g. Python-urllib/2.5), which may confuse the site, or just plain
not work. The way a browser identifies itself is through the User-Agent header.

so what i did just add the User-Agent header, voila it works.

user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
headers = { 'User-Agent' : user_agent }
req = urllib2.Request(url, None, headers)
response = urllib2.urlopen(req)
doc = response.read()


Thursday, March 5, 2009

USB 3G on Linux UBuntu

Ok this posting, is rather off topic, but someone gave me a USB 3G stick, only the stick, nothing else, no docs/manual what so ever. Black in colour, with 3M label and 3M Mobile warranty sticker. Others info, "Made in China" and M66 Model.

Ok, the first thing I did, plug it to my notebook and see s what happen, and as usual my ubuntu detect it as a usb storage, and look at dmesg gave me nothing as an usbserial device.

So my next step is to get few more info of the device by using 'lsusb'
xjutsu@xjutsu-laptop:~$ lsusb
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 007: ID 1c9e:1001
Bus 004 Device 002: ID 15ca:00c3
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 003: ID 413c:8103 Dell Computer Corp. Wireless 350 Bluetooth
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
xjutsu@xjutsu-laptop:~$
this usb 3g actually a two mode system. Some how u need to interact with the first system than only the usb serial device will be avalilable.

for this we need usb_modeswitch , try to google for usb_modeswitch and download the software. u need libusb to compile and running the binary.

after installation u need to edit /etc/usb_modeswitch.conf and look for something like this:

DefaultVendor= 0x1c9e
DefaultProduct= 0x1001

#TargetVendor= 0x1c9e
#TargetProduct= 0x6061

MessageEndpoint=0x05
MessageContent="55534243123456780000000000000606f50402527000000000000000000000"

next just execute usb_modeswitch in your shell cmd line.

root@xjutsu-laptop:~# usb_modeswitch

* usb_modeswitch: tool for controlling "flip flop" mode USB devices
* Version 0.9.6 (C) Josua Dietze 2009
* Works with libusb 0.1.12 and probably other versions

Looking for default devices
Found default devices (1)
Prepare switching, accessing latest device
Looking for active default driver to detach it
OK, driver found ("usb-storage")
OK, Driver "usb-storage" successfully detached
Setting up communication with device
Trying to send the message
OK, message successfully sent.
-> See /proc/bus/usb/devices (or call lsusb) for changes. Bye

now if u do lsusb again i will show diff thing:

xjutsu@xjutsu-laptop:~$ lsusb
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 007: ID 1c9e:6061
Bus 004 Device 002: ID 15ca:00c3
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 003: ID 413c:8103 Dell Computer Corp. Wireless 350 Bluetooth
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
xjutsu@xjutsu-laptop:~$

and finally just load the usbserial module

root@xjutsu-laptop:~# modprobe usbserial vendor=0x1c9e product=0x6061

look at you dmesg :

[ 195.420000] usbcore: registered new interface driver usbserial
[ 195.420000] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[ 195.472000] usbserial_generic 4-2:1.0: generic converter detected
[ 195.476000] usb 4-2: generic converter now attached to ttyUSB0
[ 195.476000] usbserial_generic 4-2:1.1: generic converter detected
[ 195.480000] usb 4-2: generic converter now attached to ttyUSB1
[ 195.480000] usbserial_generic 4-2:1.2: generic converter detected
[ 195.480000] usb 4-2: generic converter now attached to ttyUSB2
[ 195.484000] usbcore: registered new interface driver usbserial_generic
[ 195.484000] drivers/usb/serial/usb-serial.c: USB Serial Driver core

voila your serial interface is ready and kicking.........

Thursday, February 19, 2009

Client Side : Flex nin Jutsu

I started studying Adobe Flex December 2008, and in about one month seriously flexing myself in MXML and Actionscript 3. As a Linux user, i downloaded flex 3 sdk, and all of my coding are using editor of my choice of coz vi .

This is my first flex widget i created . A flv player, inspired by youtube of coz. Integrated with subtitle/caption in form of xml. With the flv id the player will lookup for the caption xml from the server if any.



And my second attempt is to develop a document viewer. I so amazed when i looked at scribd and they also using flex. In less than 2 weeks i managed to come out something similar, hmm almost 85% of scribd features available in mine. Called docPlayer.

Ok enough with client side, next will be on DJango and SQLAlchemy. The python side of the story.


Wednesday, February 18, 2009

1st jutsu - ular kekek mak iloi iloi....

We been using php for almost 10 years already, and everything are based on PHP oop and the dolphin RDBMS . A tough decision but we think it s the right time to move, with all the disputes and wrestles "ular kekek/sawa" will be our new direction and DJango will be the framework.

Motivation...

Motivation ... quite tough when you need to come out with a new product line... A totally new replacement model for our product and must be in production mid of 2009, code name LC2.0. So this is the story.....