आसमाँ के पार (Aasamaan ke paar – Rockford)

A beautiful song composed by Shankar-Ehsaan-Loy and sung by Shankar Mahadevan.
Lyrics by Gulzar

सन सना ता रा रे रारा सन सना

आसमाँ के पार शायद और कोई और आसमाँ होगा
बादलों के परबतों पर कोई बारिश का मकाँ होगा

ओ... मैं हवा के परों पे कहाँ जा रहा हूँ कहाँ
कभी उडता हुवा कभी मुडता हुवा मेरा रास्ता चला
ओ हो हो हो
ओ... मैं हवा के परों पे कहाँ जा रहा हूँ कहाँ

मेरे पाँव के तले की ये ज़मीन चल रही हैँ

कहीं धूप ठंडी ठंडी कहीं छाँव जल रही हैँ

इस ज़मीं का और कोई आसमाँ होगा

होगा... आसमाँ ...

हो आसमाँ होगा

मैं हवा के परों पे कहाँ जा रहा हूँ कहाँ

इन लम्बे रास्तोँ पर सब तेज़ चलते होंगे

Copy के पन्नों जैसे यहाँ दिन पलटते होंगे

शाम को भी सुबह जैसा क्या समा होगा

होगा.... क्या समा....
हो.. क्या समा होगा

मैं हवा के परों पे कहाँ जा रहा हूँ कहाँ

django queryset weirdness

I needed to reset the django admin password and found this page which tells us how to do this. It did not work for me, however I tried to get the user object explicitly, reset the password and save it and it worked!
Here is a session describing the behavior:

> python manage.py shell
In [1]: from django.contrib.auth.models import User
In [2]: u=User.objects.all()
In [3]: u[0].password
Out[3]: 'sha1$0913d$6c5cfefb89b3c77dc8573e466a943c7acd177f6b'
In [9]: u[0].set_password('testme')
In [10]: u[0].save()
In [11]: u[0].password
Out[11]: 'sha1$0913d$6c5cfefb89b3c77dc8573e466a943c7acd177f6b'
In [12]: q=User.objects.get(id=1)
In [13]: q
Out[13]: <user : root>
In [14]: q.set_password('testme')
In [15]: q.save()
In [16]: q.password
Out[16]: 'sha1$24e9c$868ff39f08c3bde96397e33ea6a8847a658a16bc'

Maybe this is related to queryset caching, which would print the same password even after calling set_password. But it looks like in the first method, the password does not even get written to the database. This might be a bug. I will need to run more tests and report (or possibly patch) it...

Update: Perhaps I am not clear in the above post. The weirdness is that in the above two scenarios u[0] and q should essentially reference the same user object, but calling set_password (and later save) method on the u[0] reference does not seem to work (i.e. the password attribute remains unchanged and changed password cannot be used on the admin pages) but calling the same method on q reference seems to work!

Update2:I got it finally. Thanks all (Esp SmileyChris) ! every array slice is a new query! so in the first solution, I need this to make it work:

u=User.objects.all()
u[0].password # to display current hash (Query #1)
q=u[0] # (Query #2)
q.set_password('testme')
q.save()
q.password
u[0].password # (Query #3) this should print updated hash!

Dear Lazyweb

I am looking for a flash media player which can play audio/video content in browser. I am currently using del.icio.us's playtagger for now, but it is limited to mp3 only (I had to change the code a little bit to prevent it from adding multiple inclusions - my changed code is here) and it does not allow rewind/forward.

I also looked at this post which suggests using google video player, which would be nice as it could then also play video files, but it consumes a lot of real estate on the pages. There is also this website mentioned which is nicer but that player is bigger than I want too... And it is probably not a fair use as it is undocumented use...

I also checked out the odeo player, which is nice but you need to host the files on odeo, which is a no-no.

Here are my requirements for this with a scorecard for Playtagger and Google:

  • Easy to use. No need to add tag soup for each file. (Del.icio.us + Google -)
  • Small size on the page (need to collapse the buttons until user clicks on play button) (Del.icio.us + Google -)
  • Ability to rewind/fast forward (Del.icio.us - Google +)
  • Play different media formats (mp3/wav/ogg/avi/mpeg video, possibly realmedia) (Del.icio.us - Google +)

Any suggestions ?

Thanks!

काही बालगीते

Update: Click here to play all songs in your browser.

To play the song, click on the small triangle before the song name. (needs javascript and flash plugin)
To download the song, right click on song name and select "Save Link As" or "Save Target As"
नाच रे मोरा
आम्ही कोळ्यांची पोरं हाय हो
अगडम बगडम (
छडी लागे छम छम
चांदोमामा चांदोमामा भागलास का
कोणास ठाऊक कसा
खोडी माझी काढाल तर
लहान माझी बाहुली
दिवस उद्याचा सवडीचा
सांग सांग भोलानाथ
टप टप टप टप टाकीत टापा
ये रे ये रे पावसा रूसलास का
एक मुलगा गेला तळ्याच्या काठी
सांगू काय सांगू काय
एका माकडाने काढले दुकान
मैना राणी
सांग सांग भोलानाथ
ससा तो कसा बॊल
जंगल जंगल बात चली है
Asha and friends - Zamana mein aaye hai deewane - Asha and Lil Champs

Some videos from Salil - Sandip:
अगोबाई ढग्गोबाई - Agobai Dhaggobai
मी पप्पाचा ढापून फोन - Mee Pappancha Dhapun Phone
दूर देशी गेला बाबा - Dur Deshi Gela Baba
दमलेल्या बाबाची कहाणी - Damlelya Babachi Kahani

Children’s songs in Marathi

Update: Play all files in your browser.

To play the file, click on the small triangle before the name. (needs javascript and flash plugin)
To download the file, right click on file name and select “Save Link As” or “Save Target As”

Aala Aala Paus आला आला पाउस आला बघा बघा हो आला आला ...
Mala Pawasat Jau De - ए आई मला पावसात जाऊ दे, एकदाच गं भिजून मला चिंब चिंब होऊदे
Chocolate Cha Bungla - असावा सुन्दर
Gori Gori Pan - गोरी गोरी पान फुलांसारखी छान दादा मला एक वहिनी आण
Koli Geet - Amhi Kolyanchi Pora Hay - आम्ही कोळ्यांची पोरं हाय हो
Konas Thauk Kasa - कोणास ठाऊक कसा पण शाळेत गेला ससा
Majhya Dadala - आणायचा माझ्या ताईला नवरा आणायचा
Mamachya Gawala Jauya - झूक झूक आगिनगाडी धुरांच्या रेघा हवेत काढी
Nach Re Mora - नाच रे मोरा आंब्याच्या बनात (देव बाप्पा)
Pustak Nantar Vacha - पुस्तक नंतर वाचा
Sang Sang Bholanath - सांग सांग भोलानाथ पाऊस पडेल काय
Ye Re Ye Re Pawasa - ये रे ये रे पावसा रुसलास का माझ्याशी गट्टी फू केलीस का
Ya varyanchya basuni vimani... Shala chandoba gurujinchi - या वार्‍यांच्या बसुनी विमानी ... शाळा चान्दोबा गुरूजींची
Chhaan Chhan Chhaan Mani Mauche Bal - छान छान छान मनीमाऊचं बाळ कसं
Raja Ranichi Nako - राजा राणीची नको
Bahuliche Lagin Zokat Lagale - बाहूलीचे लगीन झोकात लागलं

 

Fix maharashtratimes.com font problems on firefox

Maharshtratimes.com (or maharashtratimes.indiatimes.com) is a marathi news website using unicode fonts. But it does not display correctly on firefox browser. The problem is because of a single HTML div which uses justified font style. It displays correctly on IE (which is why it is not getting fixed) - this could be because of firefox's buggy implementation of "align: justify" or that IE simply ignores that style (likely).

Anyway, here is a javascript one liner that you can bookmark and once the page is loaded, click on it to fix your font problem.

Fix Ma. Ta. -- Drag this link to your bookmarks.

I tried to create a greasemonkey script to do this automatically, but it's not working for some reason...

Update: Apparently it *is* a mozilla/firefox bug open for 4+ years. See here and here.

Update2: Here is a greasemonkey script by Saravana Kumar to fix this issue. Caution: you might want to change the included domains carefully (it by default runs on all http and https sites!)

Update3: Here is my greasemonkey script specific for maharashtratimes. Enjoy!

Update4: (2009-02-16) The original site seems to have removed this style attribute now. So the above post is now only for posterity.

Using Ruby for integer format conversions

Here are some recipes for interpreting stream of bytes as different C types. I will keep adding more to this as I go...

Convert a byte stream (embedded in a string) into 1 byte signed integers:
"\xfc\xfd\xfe\xff".unpack("c*")
=> [-4, -3, -2, -1]
Convert a byte stream (embedded in a string) into 1 byte unsigned integers:
"\xfc\xfd\xfe\xff".unpack("C*")
=> [252, 253, 254, 255]

Rescuing hosed server

This post describes the steps that I took to restore an old server which had died some months back.

I had a linux server running debian pretty reliably. It had failed because of a hardware problems (broken power supply). I replaced the power supply and proceeded to make it current with security fixes. But as it happens when you update after a long time, (or it could also be due to my own itch to remove old kernels), I hosed the system. By that I mean that the system was running but somehow all the kernels had been removed (including the current one that I was running!). Anyway, in summary, the system would not boot because there was no kernel to do so.

Step 1: Okay, I thought I will just reinstall it with Ubuntu (which BTW is my new favorite distribution). But the problem was that the machine was using LVM and Ubuntu installer did not recognize the LVM volumes (even though it is documented to do so).

Step 2: So next stop was latest and greatest Knoppix which recognizes LVM. When I booted knoppix, I was able to see all the old partitions and data (70 gigs of legal *cough* songs, audio books and movies). Success!

Step 3: Next step was to chroot into the old root partition and use apt-get to get the kernel package installed back again. I confirmed that there was no kernel-image-* package installed! apt-get update would fail, because procfs was not mounted, so from out of the chroot, mounted the procfs. After that I was able to update the packages, but the install scripts failed because of errors. The specific error was /dev/null: Permission Denied. I was stumped. The device looked okay and the permissions also were okay (the script runs as root afterall). Upon some search I found out that it is because the default mounts in knoppix do not mount devices (nodev option). Once I fixed that, all things fell right in place.

Search the web for devanagari words.

I created a small form using which you can search the web for unicode devanagari words. It is very cumbersome to actually enter unicode devanagari characters using qwert keyboards, so I have adopted the phonetic transliteration scheme from Manogat website. Do give it a try:

http://amit.chakradeo.net/search/ (Link now removed, please see update below)

Start typing devanagari words phonetically and you will see unicode characters in the input area. When you hit enter, the phrase will be submitted to google.

Update: (2009-07-14) I have taken down my link now, as there are many more effective alternatives to do this. Check out the following pages from google:
Google Indic Transliteration (Marathi, Hindi)
Bookmarklets to transliterate any text element on any webpage.
A simple form for transliterating any text.

Religious Stotra – काही धार्मिक स्तोत्रे ध्वनीरूपामध्ये

Update: For those looking for the lyrics of Mahishasura mardini shloka, here is a link.

Update: There have been many requests for Shivaleelamrut (Shivleelamrut). Here is one link to the complete text in devanagari: - श्री शिवलीलामृत

Update: Click here to listen to Complete Ganesh Pooja.

I keep getting a lot of hits on some of the old posts (Ram Raksha Stotra and Hanuman Chalisa) with visitors asking for audio versions of the stotra. Here is a page where I will keep collecting the audio versions of various stotras.

To Play: If you have javascript enabled, you can click on the small arrow before each link to play the file.
To Download: Right click the link and select "Save Link As" or “Save Target As”.

श्री शिवलीलामृत - ११ वा अध्याय (अपूर्ण) (Shivaleelamrut - 11th Chapter (Incomplete))

RamRaksha Stotra - श्री रामरक्षा स्तोत्र

Ganapati Atharvasheersh - श्री गणपत्यथर्वशीर्ष  (or in PDF)

Ganapati Stotra - गणपती स्तोत्र (words and English Meaning)

Guru Mantra - गुरू मंत्र

Another version of Guru Mantra (Guru Stotram) by Swami Atmananda.
Guru Stotram गुरू स्तोत्रम Text
Shiva Tandav Stotra - शिव तांडव स्तोत्र

Shiv Mahimna Stotra. Lyrics / शब्द

Vishnu Sahastranam - श्री विष्णुसहस्रनाम

Beej Mantra - बीज मंत्र

Maha Mrutyunjay Mantra - महा म्रुत्युंजय मंत्र

Shivoham

Kailas Rana Shiva Chandramouli - कैलास राणा शिव चंद्रमौळी

Mantra Pushpanjali - मंत्र पुष्पांजली

Bhimarupi Maharudra (Hanuman Stotra) - भीमरूपी महारुद्रा - शब्द

Mahishasur Mardini Stotra - महिषासुर मर्दिनी स्तोत्र -

Pasayadan - पसायदान शब्द

Purush Sukta (with meaning in English) - पुरूष सुक्त (इंग्रजी अनुवादासहित)

Chandika Devi Kavach - चंडिका देवी कवच

Durga Kavach 1 - दुर्गा कवच १

Durga Kavach 2 Anuradha Paudwal- दुर्गा कवच (अनुराधा पौडवाला)

Hanuman Kavach - हनुमान कवच

Shree Sukta - श्री सुक्त (Script and Meaning)
- Thanks to Abhijeet V. Wajpe for this

जय अंबे माता Jaya Ambe Maata

Jai Jai Hanuman - जय जय हनुमान:
Shree Hanuman Chalisa (Anup Jalota) श्री हनुमान चालिसा (अनुप जलोटा)

Hanuman Austak - हनुमान अष्टक

Hanuman Stavan - हनुमान स्तवन

Chhand - छंद

Jiske Man Main Base Shreeramji - जिसके मनमें बसे श्रीरामजी

Jai Jai Jai Hanuman Ki - जय जय हनुमान की

Kab Loge Hamari Khabariya - कब लोगे हमारी खबरियाँ

Shree Hanuman Aarti - श्री हनुमान आरती

जय जगदीश हरे जय जगदीश हरे - Jay Jagadeesh Hare (words)

Credits:

Song from animation film Hanuman
Mahabali maharudra

beautifully sung by Vijay Prakash, Sonu Nigam, Shaan, Palash Sen, Kailash Kher, Madhushree, Sneha Pant, music by Tapas Relia and lyrics by Satish Mutatkar.

Lyrics in itrans ascii:
(jaya hanumaan gyaan guNa saagar
jaya kapiis tihu lok ujaagar
raamadoot atulit bal dhaamaa
a.njanee putra pavanasoot naamaa)

paraakram se gu.nje tribhuvan
dharatii paataal,duShTa bhanjan
jal saagar kare paraajay kra.ndan
trikaal nira.ntar lok va.ndan

mahaabali mahaarudraa mahaavajraa
shauryavaan veer hanumaan......

chehare se chhalakatii namrataa
aankho.n me.n shaa.nt chit kii chhaayaa
mukhapara hai.n subaha kii laalii
vishaal si.ndoor lipii kaayaa

(mahaabeer bikram bajara.ngii
kumatii nivaar sumatii ke sa.ngii
ka.nchan baran biraaj shubhesaa
kaanan ku.nDal ku.nchit kesaa
haat vajra aur dhvajaa biraje
khaa.nde moo.nj janeu saage
sha.nkar suvanaa kesarii na.ndan
tej prataap mahaa jag va.ndan)

bikaT samay nikaT jo aaye
pratham vahii smaraN aa jaaye
har vipadaa vo door kare
sa.nkaT mochan tabhii kahalaaye

shaktii kii nayii paribhaaShaa
viraaT vikramii roop anokhaa
laaye uThaaye droNagirii
aur jag dekhe leelaa nyaarii

Devanagari:
(जय हनुमान ग्यान गुण सागर
जय कपीस तिहु लोक उजागर
रामदूत अतुलित बल धामा
अंजनी पुत्र पवनसूत नामा)

पराक्रम से गुंजे त्रिभुवन
धरती पाताल,दुष्ट भन्जन
जल सागर करे पराजय क्रंदन
त्रिकाल निरंतर लोक वंदन

महाबलि महारुद्रा महावज्रा
शौर्यवान वीर हनुमान......

चेहरे से छलकती नम्रता
आन्खों में शांत चित की छाया
मुखपर हैं सुबह की लाली
विशाल सिंदूर लिपी काया

(महाबीर बिक्रम बजरंगी
कुमती निवार सुमती के संगी
कंचन बरन बिराज शुभेसा
कानन कुंडल कुंचित केसा
हात वज्र और ध्वजा बिरजे
खांदे मूंज जनेउ सागे
शंकर सुवना केसरी नंदन
तेज प्रताप महा जग वंदन)

बिकट समय निकट जो आये
प्रथम वही स्मरण आ जाये
हर विपदा वो दूर करे
संकट मोचन तभी कहलाये

शक्ती की नयी परिभाषा
विराट विक्रमी रूप अनोखा
लाये उठाये द्रोणगिरी
और जग देखे लीला न्यारी

Check if a site is phishing site.

Here is the updated bookmarklet: Phishy? (tested on firefox 2.0 only!)

1. Drag this link to your bookmark. This checks if the site you are currently on is a phishing site.
2. Drag this link to your bookmark. This prompts for a URL and checks if it is a phising site.

Uses phishtank's check URL API.

If this does not work try turning debug to true above if you want to see the encoding.

Update: This still uses the GET method for checking the URL. Phishtank recommends using the POST interface (which will remove limitations on URL length: base64 inflates the length by 33%). Implementing that would need some kind of xmlhttprequest hackery. Stay tuned...

Update2: I got the AJAX bookmarklet ready, (thanks!)but it hits the infamous "uncaught exception: Permission denied to call method XMLHttpRequest.open" bug. i.e. you cannot do cross-domain xmlhttprequests. To solve that I think I need to convince PhishTank to host the javascript code, so the bookmarklet will insert a hidden iframe into the current page which will load the javascript from phishtank page, which will eventually make xmlhttprequest to phistank and display the result back. Are you listening PhishTank ?

Update3: Thanks to "till" who commented below, here is the bookmarklet using the POST method so now the solution will also work for really long URLs. Till's solution is good, but it makes users trust his site (in addition to phishtank). So basically user has to trust that he is not trying to filter the results being presented..

I have also merged the two earlier bookmarklets so that the current site location will be autopopulated in the prompt, so that user can easily change it if he wants to check a URL different from the one he currently is on.

Against all Enemies

Against all Enemies: Book CoverAgainst All Enemies: Inside America's War on Terror is a fascinating account of events that happened inside the White House before and after 9/11 and how the focus shifted from fighting the terrorists to war with Iraq. I got to know about this book after watching Clinton's interview with Fox News. where he repeatedly asks the interviewer to read this book. The book starts off describing events in situation room and then goes back in history and explains the background of how Al-Qaeda started appearing on CIA's radar. There is an interesting account of different presidents and their view of terrorism and the changes in the mindset from Cold-War era to terrorism.

Excellent read and is highly recommended...

Fixing the geocoder gem.

I wanted to use the ruby geocoder library on the windows machine, but the installation of the gem failed due to some weird error. I checked the rubyforge project page to see if someone else had a similar problems and someone actually had, but the bug was open for a long time. I decided to fix this issue and found that the problem was due to the fact that windows platform does not allow characters '?' and '&' in the filename with any escaping, period. The said files were used (in a very innovative way I must say!) to test the library by modifying http.rb to return the test datafile contents instead of fetching the URL from the net. (yay open classes in ruby!). The way I fixed the problem was to change the filenames to use '_' instead of '?' and '__' instead of '&'.

I wrote to the developer, but there was no response. Anyway I managed to create a new GEM with the changed files so that this should be installable on windows now. Here are the files if you want to try installing the gem. (Also including the tgz because... it got generated anyway!)
geocoder-0.1.1.gem
geocoder-0.1.1.tgz

More about Phishtank API

Here is what will be good-to-have from phishtank.com API:

  • Good documentation about each interface e.g. how is callback_url used by auth.frob.request API ?
  • Description of all possible fields in return response (all possible XML elements and their possible values)
  • Some test URL's and emails which will return known responses (i.e. phishy URL, good URL, not in the database etc.)
  • Developer mailing list/wiki
  • Response should always honor the responseformat parameter if specified and valid