Saturday, August 20, 2011

List of timezones supported by PHP

Wandering, how to find the list of timezones currently supported by PHP ?

A quick solution. I needed it somewhere, so I wrote some lines. Rough code, but you better check the output :)

Reference : http://www.php.net/manual/en/timezones.php


#!/bin/bash 
listoftimezones=`curl -s "php.net/manual/en/timezones.php" | \
    grep -i "href=\"timezones\..*\.php\">" | \
    sed "s/href=\"/\n/g" | \
    grep -i "^timezones" | \
    awk -F "." '{print "http://php.net/manual/en/timezones."$2".php"}'` 


for a in $listoftimezones
do 
curl -s "$a" | \
    grep "td align=\"left\"" | \
    html2text 
    echo ""
done;
And here's the output

Monday, August 8, 2011

Make your Soundcards work as expected, in Ubuntu Linux 10.10

I am not sure, why did it take so long to me. May be I didn't sat down to give my 20 minutes to search for the solution, or may be I did a lot other way to give a try for something else, but not on exactly what I was looking for.

But when I discovered, its pretty simple to make your soundcards work properly in Toshiba Satellite (specifically L645) laptops, by simply loading hda-intel-snd module.

as simple as 1. 2. 3.


  1. sudo vim /etc/modprobe.d/alsa-base.conf
  2. add options snd-hda-intel model=MODEL at the end of the file where MODEL I selected was thinkpad (without any proper reasoning, just copied and pasted)
  3. sudo alsa force-reload
However, if you want to do some proper way and want to find, how it actually worked for your laptop, or how to find a proper codec and make it work, refer the following well maintained documents.




More Notes on HD-Audio Driver by Takashi Iwai 
excellent document that explains many issues with the snd-hda-intel driver written by one of the module's authors.