Wednesday, June 11, 2008

Be smart and safe with Mozilla Firefox


Today (11- June- 2008) , I got a mail from ICICI Bank <admin@icicibank.com>
It's content goes like this..

 

Security Alert

ICICI Bank has been receiving complaints from our customers of unauthorized access of the NetBanking accounts. As a result we have started reviewing our
NetBanking Accounts periodically and temporarily restrict access of those accounts which we think are vulnerable.It has come to our attention that your account
information needs to be updated as part of our continuing commitment to protect your account in this year 2008 and to reduce the instance of fraud on our website.
If you could please take 5-10 minutes out of your online experience and update your personal records, you will not run into any future problems with our online service.
Once you have updated your account records your online banking account service will not be interrupted and will continue as normal.

To update your records click the following link(s) and fill in the necessary requirements :

Personal Account Holders - https://infinity.icicibank.co.in/BANKAWAY?Action.RetUser.Init.001=Y&AppSignonBankId=ICI&AppType=retail&abrdPrf=N
Business Account Holders - https://cib.icicibank.co.incorp/BANKAWAY?Action.CorpUser.Init.001=Y&AppSignonBankId=ICI&AppType=corporate

Please sign in to Online Banking after you have verified your account to ensure your account security. It is all about your security.
We seek your cooperation for serving you better.

Sincerely,

Benoy Dasgupta
Security Department
ICICI Bank


Hmm... A really good looking work of fraud...... phishing at it's best.
But I decided to give it a try at Firefox and Internet Explor(d)er. IE acted as though nothing happenned. But the Firefox actually advised me that this is an unsafe website and it is potentially dangerous for me to browse that site !! Watch it...!!





 I will call it people friendly technology. Long live Free Software..... and of course Firefox. I feel it is lot more safer for me and people that I know to use Firefox as their default browser.



Posted by maxinbjohn at 11:43:36 | Permanent Link | Comments (0) |

Wednesday, June 04, 2008

Track your thoughts with Freemind

Freemind is the first and best mindmapper application that is known to me. Thanks to Mr. Dhanan for introducing to that software and demonstrating it's power in various arenas. Freemind is written in Java, that makes it a highly portable application.
Well, a mindmapper is an application which helps you to perform mindmapping. Perplexing, right ?? Then what is mindmapping ??

"A mind map is a diagram used to represent words, ideas, tasks, or other items linked to and arranged radially around a central key word or idea. It is used to generate, visualize, structure, and classify ideas, and as an aid in study, organization, problem solving, decision making, and writing." -- Says wikipedia.

 Recent days, I have been using Freemind extensively, for the presentations ( yes, I did one "Introduction to programming in Python" presentation in Freemind for HP zone members of Ushustech).  I was really able to convey the "Flow of my thought" using mindmaps in Freemind and I really enjoyed that presentation ( I hope those guys too :) ).

We can use freemind for designs of applications too.  I have decided to do one small Java ME application to find the Body Mass Index (BMI) . First thing I created is the mindmap of that application and then code it. That way, I can think over the application's features and drawbacks visually. My BMI mindmap goes like this..




 Next time , when you are going to present something, do it in Freemind . It will be a refreshingly new experience.
Posted by maxinbjohn at 10:59:57 | Permanent Link | Comments (0) |

Wednesday, May 28, 2008

Sweet Home 3D for a beautiful home

Want to design the interiors of your new Home in Gnu/Linux ? or you just need to modify the interiors of your' home ? ... You can do it all using the nice program called Sweet Home 3D.  It is available from http://sweethome3d.sourceforge.net/index.html.

Just download the software from http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-1.3-linux-x86.tgz. As it is a java based Software, make sure that you have openjdk installed in your machine.  In the latest Ubuntu Hardy Heron release,  the execution of Sweet Home 3D was flawless.

Have a look at my experiements with SweetHome 3D :)



It's really cool.. You can make wonders with some sense of beauty and a mind willing to spend hours with this software.
Posted by maxinbjohn at 18:10:17 | Permanent Link | Comments (0) |

Monday, May 26, 2008

GCompris for Unnikkuttan

Last Friday, my Uncle called me up for a particular requirement - to buy one PC for Unnikkuttan and Ponnu, my cousins.  He wanted his children to use that Computer for education purposes. I agreed to go with him and help him in choosing the PC configuration.

After some comparison by visiting multiple stores, we have decided to buy the Acer Aspire PC, which costs about 23000 (nowadays, I feel laptops are better than Desktops when we think about our wallet). It had a 1.6 Ghz, 1 MB L2 cache, 800 MHz FSB , Intel pentium dual core processor , 1 gb ram, Intel 945 GC motherboard, DVD writer....

Well, the dealers has installed some games on the PC and just after booting the PC in Windows XP , Unnikkuttan started playing the games, mostly nothing to with education and more to do with the violence. Jose Uncle wasn't that happy with what unnikkuttan doing with the PC.

Next week, I have visited Unnikkuttan's home , this time with 3DVDs of Debian Etch Gnu/Linux. I have installed the Debian on the 40 GB partition of that massive 160 GB HDD. Installed the Debian Gnu/Linux. Both Unnikkuttan and Ponnu were amused by the installation steps of Debian.  The whole installation took around 30 minutes (thanks to that high speed processor with 1 GB ram ).

After that it was the time for Education softwares. I have installed GCompris and Kdeedu and asked Unni and Ponnu to use it. They really liked those programs, I could guess it from their fight for playing the games. Again not willing to hurt Unnikkuttan's desire for Racing, I have installed the Torcs race game for him. He got thrilled by that game anyway..

The PC boots directly into Debian and I have configured the Debian to have a "passwordless" entry to the Desktop to reduce the "password" problem for children. I know they are smart enough to remember the passwords. But unfortunately I dont' remember my passwords these days. So I have decided to not to take a chance for myself :)

Nowadays Unnikkuttan and ponnu are proud owners of a Debian Linux ( I have removed the GNU to for ease of the kids) machine. They are the future, let them play with the Gnu/Linux Innocent  

( I wonder why people are saying Linux is hard to use while children like Unnikkuttan and ponnu , with ages 4 and 6 respectively are using it without any problem)



Posted by maxinbjohn at 12:44:05 | Permanent Link | Comments (0) |

Thursday, May 22, 2008

Play with Cheetah : the python based templating engine


Cheetah is a python powered  Templating engine and code generation tool (Though I never tried it's code generation functionality). Its main application is in the Web Development scenario itself.

To start with Cheetah, we can download the latest release of cheetah from http://sourceforge.net/project/showfiles.php?group_id=28961.
Installation is done by the usual
python setup.py install

After this we are going to test the prime functionality of Cheetah, the Web Development scenario.

The simplest template (Greeting.tmpl)
###################################
Hello, $firstName.

Your order (#$order) has shipped:
###################################                                  

Compile it using Cheetah

cheetah compile Greeting.tmpl
Compiling Greeting.tmpl -> Greeting.py

Now we got a Greeting.py. So let's  test that in python


>>> from Greeting import *
>>> t = Greeting()
>>> t.firstName= 'Maxin'
>>> t.order = 23342
>>> print t
Hello, Maxin.

Your order (#23342) has shipped:

Hmm.. It works..
Best reference for cheetah is available at http://www.cheetahtemplate.org/docs/users_guide_html
Posted by maxinbjohn at 13:28:04 | Permanent Link | Comments (0) |

Tuesday, May 20, 2008

System Tray application for Linux using Python and GTK

Creating an application which resides in the System tray adds charms to an otherwise simple application. Pleople tend to value accessibility and userfriendliness  than the quality of the program itself (pardon my friends, I am sure that you are not one of those chaps)

But, again it is fun to create a simple gui which demonstrates how to create an active System tray application using pygtk. My simple app goes like this.

#######################################################################################

#!/usr/bin/env python

import gtk

class StatusIcc:

    # activate callback
    def activate( self, widget, data=None):
    dialog = gtk.MessageDialog(
        parent         = None,
        flags          = gtk.DIALOG_DESTROY_WITH_PARENT,
        type           = gtk.MESSAGE_INFO,
        buttons        = gtk.BUTTONS_YES_NO,
        message_format = "Did you like this Activation example \n by Maxin B. John <maxinbjohn@gmail.com>?")
    dialog.set_title('Popup example')
        dialog.connect('response', self.show_hide)
    dialog.show()
   
   # Show_Hide callback
    def  show_hide(self, widget,response_id, data= None):
           if response_id == gtk.RESPONSE_YES:
               widget.hide()
    else:
        widget.hide()
           

    # destroyer callback
    def  destroyer(self, widget,response_id, data= None):
        if response_id == gtk.RESPONSE_OK:
            gtk.main_quit()
    else:
        widget.hide()

    # popup callback
    def popup(self, button, widget, data=None):
        dialog = gtk.MessageDialog(
        parent         = None,
        flags          = gtk.DIALOG_DESTROY_WITH_PARENT,
        type           = gtk.MESSAGE_INFO,
        buttons        = gtk.BUTTONS_OK_CANCEL,
        message_format = "Do you want to close this Status Icon program?")
    dialog.set_title('Popup Window')
        dialog.connect('response', self.destroyer)
    dialog.show()
     
       

    def __init__(self):
        # create a new Status Icon
        self.staticon = gtk.StatusIcon()
        self.staticon.set_from_stock(gtk.STOCK_ABOUT)
        self.staticon.set_blinking(True)
    self.staticon.connect("activate", self.activate)
        self.staticon.connect("popup_menu", self.popup)
        self.staticon.set_visible(True)

        # invoking the main()
        gtk.main()


if __name__ == "__main__":
    statusicon = StatusIcc()
####################################################################################


Hmm , The code is pretty simple . It is using gtk.StatusIcon() for the System Tray app. The most important signal for the StatusIcon are "activate" and "poup_menu". The callbacks for those singals are also self explanatory. So not much comments on the code. Now lets see my
app in action.




The Information (i) symbol in the system tray area is the running application. Right click and Left clicks will generate the "poup_menu" and "activate" signals respectively. 
Try the tray app for you next programming adventure :)
Posted by maxinbjohn at 11:48:19 | Permanent Link | Comments (0) |

Friday, May 16, 2008

Twitter through python

Twitter is a free social networking and micro blogging service that allows users to send "updates"  up to 140 characters long to the Twitter website, via SMS or instant messaging (google chat).
Updates are displayed on the user's profile page and instantly delivered to other users who have signed up to receive them. The sender can restrict delivery to those in his or her circle of friends (delivery to everyone is the default). Users can receive updates via the Twitter website, instant messaging,SMS, RSS, email or through an application.

Now let's have a look at python and integrate the Twitter with Python. Python-twitter module is a python wrapper around Twitter API which is available at http://code.google.com/p/python-twitter/. The twitter module depends on simplejson module which is available from http://pypi.python.org/packages/source/s/simplejson/simplejson-1.9.1.tar.gz. As it is a pure python implementation, installation is very easy and traditional.

Then download the python-twitter module from http://python-twitter.googlecode.com/files/python-twitter-0.5.tar.gz .
tar zxvf python-twitter-0.5.tar.gz
cd python-twitter
python setup.py build
python setup.py install
and we are done :)

Now let's write the simplest python script to post a message in twitter.

###############################################################
# The simplest python program to play with twitter using python-twitter
#  Google Code:   http://code.google.com/p/python-twitter/
#  Google Groups: http://groups.google.com/group/python-twitter
#  Python twitter API can be used to send and receive twitter messages
#
# Thanks to DeWitt Clinton <dewitt@google.com> for this wonderful module
#

import twitter

api = twitter.Api(username="my_twitter_username", password="my_secret_password", input_encoding=None)
status = api.PostUpdate("example of the simplest twitter message program ")
print status.text

###########################################################

It is very simple. Now let's run the code as
python simple_twitter.py
example of the simplest twitter message program

Now when I visit my twitter home (http://twitter.com/maxinbjohn), I can see that message and I think it is cool Cool
Posted by maxinbjohn at 12:34:45 | Permanent Link | Comments (0) |

Wednesday, May 14, 2008

QuickCam Go on Ubuntu 8.04 LTS Linux

One of my worst fears were whether my newly owned Webcam (Logitech QuickCam Go) will work in Ubuntu Linux or not. Though it was cheap(Rs. 730/- or roughly 19 USD) , I didn't wanted to experiment with it in M$ OS. But my fears were baseless. It worked smoothly in Ubuntu, didn't even have to wait for installing the drivers in the Ubuntu 8.04 LTS distro.

Hmm.. it saved a considerable amount of time for me.
uname -a
Linux maxin-desktop 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 GNU/Linux
At first I have tested it in the Ekiga Phone Software. Later decided to do something interesting with that. So I have installed 'motion' in Ubuntu Linux

sudo apt-get install motion

About Motion: " motion uses a video4linux device for detecting movement. It makes snapshots of the movement which can be converted to MPEG movies in realtime (or later for low cpu usage), making it usable as an observation or security system"


Output of motion in Ubuntu Linux using my Logitech Quickcam Go webcam



It runs a webserver on port 8081 in my machine. I will be able to monitor whether somebody is present in front of my pc (or if the 'motion' is installed in my home pc, I can check whether somebody is intruding my home or not) using an ordinary web browser.

Posted by maxinbjohn at 17:58:21 | Permanent Link | Comments (0) |

Thursday, May 08, 2008

The simplest (python based) pre-commit hook in Subversion

Hooks in Subversion are scripts or executables that are triggered by an event in the subversion version control life cycle. The following are the hooks supported by Subversion.

In the hooks directory of a repository we can find these template files:
post-commit.tmpl      pre-unlock.tmpl
post-lock.tmpl          pre-commit.tmpl
start-commit.tmpl     post-revprop-change.tmpl
pre-lock.tmpl          post-unlock.tmpl     pre-revprop-change.tmpl

start-commit
Before the commit transaction starts
pre-commit After the commit transaction starts but before the transaction is commited
post-commit After the commit transaction completes
pre-revprop-change Before a revision property is changed Repository Path,
post-revprop-change: After a revision property is changed Repository Path
pre-lock:  Before the lock being acquired
post-lock:  
After the lock being acquired

To test how a hook works, let's create a repository in our Gnu/Linux Box.

svnadmin create hello

Now we have a repository called hello and it will contain files like
conf dav db format hooks joke.py locks pre-commit README.txt
Modify the conf/svnserve.conf to include passwd file and add users to the passwd file along with their passwords.

Then run the server as svnserve -d -r hello
To checkout :
svn co svn://127.0.0.1

Then lets move to the real work. We need to stop anybody who is trying to commit to our repository just because we are doing some important work on the server or we just dont want anybody to help us :)

To do that, let's create a file called pre-commit in hooks folder in the repository (hello). The content of the pre-commit should be :

#!/usr/bin/env python
# ====================================================================
# The simplest pre-commit hook which prevents all the commits to the repository
# This can be useful(?) when you are doing the backup of your subversion repo.
# This small script will prevent the commit and will give a simple message
# to the person who is commiting the changes.
#
# USAGE:
# copy this script as pre-commit in the hooks directory of the svn server
#
# ====================================================================

import sys

MESSAGE="""
Dear Sir,

As we are doing some important work in the server,all those who are submitting
the changes will have to wait for some time.

Sorry for the inconvenience caused.

Regards,

Administrator.
"""
# Messages written to the stderr will be shown to the person who is commiting.
sys.stderr.write(MESSAGE)

# Need to exit with anything other than 0 to fail the commit
sys.exit(2)

Let's change the mode of the pre-commit to executable (chmod +x pre-commit)

To test this setup, lets create a sandbox and then try to commit our changes to the server.
svn co svn://127.0.0.1
cd 127.0.0.1
mkdir test
svn add test
svn commit -m "adding the test directory"

Now we will see the pre-commit hook in action:

Adding test
svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:

Dear Sir,

As we are doing some important work in the server,all those who are submitting
the changes will have to wait for some time.

Sorry for the inconvenience caused.

Regards,

Administrator.


This is the most simplest hook that can be implemented in Python. More complex hooks can be implemented in python using the svn module. More useful hooks examples are available from http://subversion.tigris.org/tools_contrib.html#hook_scripts





Posted by maxinbjohn at 11:39:11 | Permanent Link | Comments (0) |

Wednesday, April 30, 2008

Programming fun for children with Neko and Turtle in Windows

Python : A fun filled language for both beginners and experienced programmers. But some of us may not cared the fact that it is good for children also.. to start learning programming. As python is a heavily ported language (It runs in huge servers as well as on handheld gaming devices like gp2x too), it doesn't matter where you are ... you can be in Gnu/Linux (highly preferred and for the smart kids) or in Windows platform (only for the not so cool kids)

In Gnu/Linux, Python almost 'pre loaded'. So you just need to care about the Tkinter module. In Windows , we need to install Python first to do something for for our kids. Just download Python 2.5.2 installer from http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi and click to install it on your machine. Don't forget to select the Tkinter during installation. Preferably you should modify the Environment Variable Path to include the Python : (C:Python25) will be the default path.

The default package that is present in the Python installation for Kids is Turtle. It is easy to play with Turtle in Python.
The kids can move the lines and draw things in the computer by typing very simple commands in the python interpreter. It is as easy as

import turtle
turtle.begin_fill()
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(100)
This will give the kids an interesting way to see animation of what they are doing in real time and they will get an idea of what programs are suppossed to do.Its output looks like



The best way for the kid to learn programming is by playing with Neko (Cat in Japanese). Just like the Tom and Jerry Show, there is a rat in PyNeko which is an opponent for our Neko. If we program neko, he can jump to places and then eat that cat :) ... Must be very funny for the kids....

To start doing something with Neko, we need to download neko.py and nekomaps.py from http://gnuvision.com/pyneko/. " Adventures with Neko !" is a fun filled programming book by Mr. Pramode CE, a veteran Programmer/Teacher/Philosopher who lives in Thrissur. It is available at http://gnuvision.com/books/pybook/.

Now lets move on with Neko. Create a directory C:Python and download neko.py and nekomaps.py to that directory. Start cmd and cd to C:Python. Now we can start playing with Neko.

Neko can be invoked in Windows by

from neko import *
right() #moves the cat to 1 step right
left() # moves the cat to 1 step left
up() # moves it upwards
down() # moves it downwards..

It is really a funny experience. Read the Adventures with Neko for more fun filled adventures. A sneak peak of Neko :




Try it for your kid, it will be worth the effort, no matter what the OS you choose for it.
Posted by maxinbjohn at 11:26:52 | Permanent Link | Comments (0) |