Wednesday, May 27, 2009

Thunderbird Tip : Sync all folders

Tell Thunderbird to check for mail in all Imap Folders . Here is how to do it

'

Check all IMAP folders for new mail

Thunderbird can download mail from all accounts when you start the program. Just open the Config Editor, search for the preference mail.check_all_imap_folders_for_new, and change its value to true. '

Source

Friday, February 20, 2009

Breach

Watched Breach tonite. Its based on a true story of a FBI agent turning out to be a mole . Robert Hansssen , served in the FBI for 25 years and is said to be the best in business. He works for the Intel department of FBI and covers America's biggest threat Soviet Union. Little did they know that he is hand in gloves with them and has been carrying out espionage work for the past 15 years. The story revolves around him being promoted to head a new Intelligence wing and his assistant ( a FBI agent scooping him). The plot is slow to start with but becomes racy at the end .

Ratings :

Story : Based on true story

Screenplay : C

Acting : B

Overall : C

Friday, September 5, 2008

DIY : Screenlet

At Yahoo! where I work, we communicate with each other over YIM ( seems obvious). Sometimes it so happens that people who are not in your buddy list occasionally ping you and you are clueless whom you are speaking too.

We have an internal app. that has all the contact info of all Y! employees. So basically we lookup the id against and get the necessary details.

I wanted to get this feature right in my IM . I use Pidgin and it has some cool api's that can be used. At first I tried integrating the feature of listing the person's details within the IM window. To achieve it I had to write a Pidgin Plugin. I felt it was an overkill for what I wanted.

Next came screenlets

Screenlets are widgets that run on your desktop ,similar to google gadgets. We can write custom plugins in python (Yipee!).

I looked at some existing screenlets and shamelessly copied their styling ( I suck at that). Anyways, this is also a recommended approach.

After some hours of understanding and some help in IRC I was able to get it working. Its really wonderful and serves my purpose. It needs some tweaks but on the whole worth the effort.

Monday, March 24, 2008

The Great Debater

Its been long since I watched a movie and I am really happy for starting it off by watching The Great Debaters.

The tone is set in the early 1930's when the Afro-Americans were still not being treated equally and were subject to racial abuse. The entire scene was brought to life by some stupendous acting by none other than - Denzel Washington. He really breathes life in to character that he portrays Melvin Tolson. Some other noteworthy performance by the Whitaker's.

The dialogues are beautifully crafted and rendered to perfection. I still remember the last speech that Denzel Whitaker renders at Harvard. Its really mesmerizing

A must watch movie and I highly recommend it.

Friday, January 11, 2008

Finding A Programmer in a Haystack

The world I know is full of Software Engineers, so the question arises as to how to pick a really good programmer from the rest. Its a real challenge for the technical recruiters coz' the CV or the resume mentions a load of technologies and languages that a person may have worked on , but does that translate into being a good programmer.

I read a blog which clearly defines the fine art of identifying a good programmer.

Abstract from it:

1. Passionate of Coding and Technologies

Learns new stuff on his own, rather than being told so from the company. Codes for the fun of it rather than a looking at it as a job.



2. Personal Projects

A good indicator is the projects he has worked on the past .Past here refers to college and child hood days.



3. Intelligent

Programmers are intelligent. Good Programmers are even more intelligent. Being able to talk on other subjects apart from technology is also an indicator. If you can’t have a great conversation with them in a relaxed social context, they’re very likely not a good programmer.

Read the blog for the rest of the story.


Makes me feel good , as I fit the bill

Using Tomboy with SSH

I work in an environment wherein I have to logon to a large number of machines either for debugging certain things or installing stuff ( Just another Ops Guy! ). I wanted to note certain things like debug info or stuff done on that box somewhere so that I can follow up on that . It also used to help track what i did last week .

Earlier Approach:

1. ssh to the remote box.
2. Do some stuff.
3. Logout.
4. Open VIM ( I don't Vi) and note information about if any.


Recently my eyes lay on the Tomboy .For the uninitiated:

"Tomboy is an open-source desktop notetaking application for Unix-like systems written in C# using Gtk#. It uses a Wiki-like linking system to connect notes together. Tomboy is part of the GNOME desktop environment and is licensed under the GNU Lesser General Public License. "


I wanted to use Tomboy in conjuction with SSH. I was able to find a place which information on using the Tomboy Api.

Tomboy supports a new Dbus-interface that allows us to hook into it.

It was looking for a RPC library so that I can invoke the function from a remote place to my Desktop. I used python's Pyro library to achieve this.

This is my code.

Pyro Server on my Desktop

Pyro.py

!/usr/bin/env python

import Pyro.core
import Pyro.naming
from Pyro.errors import PyroError,NamingError

import tomboy_note

class tomboy_Server(Pyro.core.ObjBase,tomboy_note.NoteMaker):
pass

def main():

Pyro.core.initServer()
daemon = Pyro.core.Daemon()
uri = daemon.connect(tomboy_Server(),"Note")
daemon.requestLoop()

if __name__ == "__main__":
main()

The notemaker script:

notemaker.py

#!/usr/bin/env python
import sys, dbus, gobject, dbus.glib

bus = dbus.SessionBus()
obj = bus.get_object("org.gnome.Tomboy", "/org/gnome/Tomboy/RemoteControl")
tomboy = dbus.Interface(obj, "org.gnome.Tomboy.RemoteControl")

FILENAME = "/home/sharadg/worklog"



if len(sys.argv) > 1:
new_note = tomboy.CreateNamedNote(" ".join(sys.argv[1]))
tomboy.SetNoteContents(new_note,"".join(sys.argv[2:]))
else:
file = open(FILENAME)

for line in file:
output = line.split(":")
print output
new_note = tomboy.CreateNamedNote(output[0])
tomboy.SetNoteContents(new_note,output[1])


tomboy.DisplayNote(new_note)


On the desktop I run , Pyro.py which listens for RMI. From the remote box , I wrote a wrapper over ssh that catches the EOF message an calls the Remote function to take any notes if required using the create_note.py script.

My wrapper script looks like this

#!/bin/bash

host=$1
trap '{
echo -n "Do you need to track this ?"
read answer
if [ "$answer" == "y" ]
then
echo -n "Please enter the comment: "
read comment
`/home/sharadg/create_note.py $host "$comment"`
fi
exit 255
}' EXIT
if grep -q $host ~/.myhosts
then echo "Authorized keys are good here"
cd ~/.push
tar zhcf - . | ssh $1 "tar zpvxf -"
else
cd ~/.push
tar zhcf - . | ssh $1 "tar zpvxf -"
echo $host>>~/.myhosts
fi
ssh $host


create_note.py
#!/usr/bin/env python

import Pyro.core
import sys

if len(sys.argv) > 1:
hostname = sys.argv[1]
comment = sys.argv[2]
o=Pyro.core.getProxyForURI('PYROLOC://my actual hostname:7766/Note')
o.makenote(hostname,comment)



So finally it looks like this now

1. Log into machine
2. Do some work
3. Logout
4. Script asks me if i need to note something
5. It seemlessly creates a new post for me in Tomboy on my Desktop


Please post your thoughts on this and any feature request

Wednesday, January 9, 2008

Making Captcha Uesful

Captcha is a challenge-response mechanism that tells whether the user is human or a machine. This is now being widely used in preventing spamming in comments and other places.

Enter Recaptcha which also works on the similar pattern or preventing spamming from bots , but serves another very usesful purpose. Loads of books from the pre-digital era are now being converted into their digital self . They are using OCR software to convert them , but whenever the OCR is not able to clearly identify a word, that word is sent to Recaptcha for clarification.

How does it work?

"In order to verify that humans can decipher these previously undetectable words correctly, two words are displayed; one is a word which a OCR software has been unable to read, and the other is a word which several other human users have already been able to identify. If the user recognises the identified word, it is assumed that they were also correct about the new word."

A real good idea. Makes the captcha more useful.