Saturday, February 14, 2009

Chutneys

Passed (the somewhat newly opened) Chutneys on Road No. 36, Jubilee Hills (, Hyderabad) today while running an errand and made up my mind to get back to eat here.

It was 11 in the morning when I got back in (and I expected the place to be empty - however, it turned out to be nearly full, but possibly the day being the V-Day had something to do with it.) And before there is any speculation on this, I was (unfortunately) alone.

The prices on the menu were high, but given the locality, and possibly the quality, I should have expected it - Rs. 89/- for a butter masala dosa, 35/- for a coffee, plus 12% tax (and tips).

Six types of chutneys were placed before me. Sambar was poured into a container from a transparent plastic mug. A smallish masala dosa with a big lump of white butter on a very decent stainless steel plate with a banana leaf over it was then brought.

Decent sambar, well-cooked potato-onion masala, decent dosa, and fine yummy butter were individually adorable but the combination of dosa with the chutneys was really heavenly.

The chutneys - urad dal, peanut, tomato, ginger and spicy coconut were all superb; the plain rich white sweet coconut sheer delight.

The coffee, while perhaps not heavenly, was nothing to complain about. This was, however, large in quantity as well, unlike the dosa.

Lucky, I was, to get into this and not 36 Jubilee or Santosh Jubilee for my breakfast. Next time is time to try one of their specialities - this includes Babai idlis, MLA Pesaratus, and so on.

Saturday, August 09, 2008

Orkut community Thread re-title (Greasemonkey)

This script allows you to change the titles of Orkut community threads while viewing them locally.
Tested with:
Ubuntu Hardy Heron 8.04
Firefox/3.0.1 (Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1) Gecko/2008072820)
Greasemonkey 0.8.20080609.0

Of course, it's local - it doesn't actually affect the data on Orkut's servers and you don't need any special privileges in the community to use this.

Name changes are persistent (will remain even after the browser is restarted - I think the info is lost if you Ctrl+Shift+Del your cache).

Refer elsewhere for how to install a Greasemonkey user-script.
Test with: http://www.orkut.co.in/CommTopics.aspx?cmm=22317

This does have some minor bugs which I'll fix if someone is interested in using this.

// ==UserScript==
// @name Orkut Community Re-title 1.0
// @namespace tag:abhijitppai@gmail.com,2008-08-07:Algoretitle
// @description script to re-title Orkut community threads
// @include http://www.orkut.co.in/CommTopics.aspx*
// ==/UserScript==
function myclick() {
if(this.checked==true)
{
c = document.createElement('input');
c.type="text";
c.name="apt"+this.name;
c.value=GM_getValue(String(this.name),"");
this.parentNode.insertBefore(c, this.nextSibling);
}
else
{
c=document.getElementsByName("apt"+this.name)[0];
GM_setValue(String(this.name),c.value);
var link = this.parentNode.childNodes[1];

if(c.value!="")
{
//don't have old value saved yet
if(""==GM_getValue("orig"+this.name,""))
{
//save it
GM_setValue("orig"+this.name,link.innerHTML);
}
link.innerHTML = c.value;
link.style.color="red";
}
else
{
link.innerHTML = GM_getValue("orig"+this.name,"blank");
this.parentNode.childNodes[1].style.color="grey";
}
this.parentNode.removeChild(this.parentNode.childNodes[3]);
}
}

var allLinks, thisLink;
allLinks = document.evaluate(
'//a[@href]',
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);

for (var i = 0; i < allLinks.snapshotLength; i++) {
thisLink = allLinks.snapshotItem(i);
var k = thisLink.href.search("&tid=");
if(k>0)
{
k=k+5;
b = document.createElement('input');
b.type="checkbox";
b.name=String(thisLink.href.substr(k));
vlue = GM_getValue(b.name,"");
if(vlue!="")
{
thisLink.innerHTML = vlue;
thisLink.style.color="red";
}
b.addEventListener("click", myclick, true);
//insert after
thisLink.parentNode.insertBefore(b, thisLink.nextSibling);
}
}

LAPP on Ubuntu 8.04 (Hardy Heron)

To install LAPP (Apache, PostgreSQL, Perl on Linux)

At the prompt:

1) sudo apt-get install perl postgresql apache2
Say Y to download dependencies.
2) sudo su postgres
3) psql
> create table a(b integer);
> insert into a values(2);
> \password

Enter a new postgres database user password twice, say "qwe" (without quotes).
> quit
4) logout (of the postgres user only)
5) sudo vi /etc/postgresql/8.3/main/pg_hba.conf

Change all the "ident sameuser" in the last column of all (non-commented) lines to "md5".

6) sudo vi /etc/postgresql/8.3/main/postgresql.conf

Find the line:
#listen_address

Remove the hash from the start (de-comment it).
Change the address from 'localhost' to '*' (including quotes).

7) cd /usr/lib/cgi-bin
8) sudo vi c.cgi

#!/usr/bin/perl

use DBI;

print "Content-type: text\html\n\n";

my $dbh = DBI->connect('DBI:Pg:dbname=postgres;host=localhost','postgres','qwe')
or die "Couldn't connect to database: " . DBI->errstr;
my $sth = $dbh->prepare('SELECT * FROM a')
or die "Couldn't prepare statement: " . $dbh->errstr;
$sth->execute()
or die "Couldn't execute statement: " . $sth->errstr;

while (@data = $sth->fetchrow_array()) {
print "$data[0]\n";
}
$dbh->disconnect();



9) sudo chmod +x c.cgi
10) Open firefox.
Try:
http://localhost/cgi-bin/c.cgi
You should see 2 on the screen.

This means LAPP (where the last P is Perl) is successfully installed.

Monday, August 04, 2008

External Hard disk bought

I bought a Seagate FreeAgent 500 GB external USB hard disk from A. S. Computers on S. P. Road yesterday for Rs. 5174/- (all inclusive).
Also purchased: Transcend 4 GB pen drive for 624/- (all inclusive) (- the 8 GB Transcend was appx. 1150/-.)