Thursday, December 27, 2007

Sunday, December 09, 2007

SHA1 sum check

Just like the MD5 checksum, SHA1 checksum can be done with
sha1sum filename
Used with Fedora iso downloads, for example.

Tuesday, December 04, 2007

combating spam from feedback forms

One more technique to supplement the one I've described earlier - check for the string http:// and don't email the form if present! In asp, that translates to
if Instr(strString,"http://") then
Response.Write " -- "
end if

Sunday, November 25, 2007

firefox doesn't play nice with tunnels

Created a tunnel over ssh from my remote machine to use the studio server's internal webserver, similar to tunneling TightVNC. Got a firefox error when trying to access the tunnel using http://localhost:6000 -
This address is restricted: This address uses a network port which is normally used for purposes other than Web browsing. Firefox has canceled the request for your protection.
Found the solution at by googling.
  • Go to about:config in your Firefox browser.
  • Right click somewhere, and choose "New => String"
  • In the setting Name box type ""
  • In the Setting Value box, type "1-65535" or whatever port-range you want to allow.
  • Click OK

Tuesday, November 20, 2007

phplist removal from blacklist, that is, re-subscribe gives the info on how to remove a user from phplist's blacklist - usually when someone unsubscribes and now wants to re-subscribe - Go to that user's history and click on the link there.

Sunday, November 18, 2007

more SQL and web programming Gyaan

Don't create tables or records with names like From - SQL keywords - though postgres allows it, the names will cause error grief in SQL queries.

When trying to write to a text file, the most likely cause of errors is permissions, if the file exists. Check permissions of the parent directory and its parent and so on....

Examples for doing file writing in asp from
got by googling

Tuesday, November 13, 2007

Many different topics

Hopefully the search feature on blogger will help me find this post when I need it, because I'm going to post about many different items.

1. New schedule page in public beta - have added a link from the old schedule page on

2. Asked for a firewall rule change on fs3 to allow only our machines to get shell access.

3. Weird error on a csv import, was due to a newline in a Description.

4. Google customized search being used for H2H, old links to krishna being removed using TexRep find/replace in files tool.

5. Subscription pages which send emails to us instead of directly accessing phplist - to avoid exposure. Also writing to file...

6. Removed asp page dl.asp for saicast downloads, using static addition of the content-disposition header "attachment" instead: In IIS manager, right-clicking on Saicast video downloads, as given in
"To apply the header statically, right-click the document in the Internet Service Manager, and then select *Properties*. Select the *HTTP Headers* tab and enter the content-disposition header there."
In our case, added it to the entire site.

7. Adobe had nice video workshops for their products.
But around 500 kbps is needed to see them properly.

8. Have subscribed to Secunia Weekly summary of vulnerabilities.

9. Lots of updates on the "voluntary" side of web work, keeping me busy outside "office hours".

Friday, November 09, 2007

sql snippets

Gave a link to the new php program schedule page from the schedule page 2 days back, so it is in some sort of public beta. Found some bugs, one of which was due to languageid being NULL in our local db. Solution was to make languageid 1 the default value for that field, so that future record inserts will automatically have it set (tested) and also ran
update file_information set languageid=1 where languageid is NULL
Struggled a bit to get the syntax right, with languageid ='', languageid = NULL , NOT (languageid>0 and languageid<9) and so on, till I googled the correct syntax for NULL.

One more snippet of SQL Gyaan is that to insert, update etc for fields with type interval / timestamp , the syntax is
UPDATE "file_information" SET "duration" = interval '00:01:09' where file_id = 2020
and so on. One has to do a sort of typecasting using the keyword interval. One can even say interval '1 hour' and so on. From

Friday, November 02, 2007

dir listing taking too long

One of our machines was taking a looong time for ls -l listing. Turned out a mounted smb share had i/o errors - reported by df -h. Umounted it, then all is well....

session_start() caveats in php coding

The new schedule page admin interface had a bug of having to login twice - and momentarily some error messages would appear.
session_start(): Cannot send session cookie - headers already sent 
Reason was the session_start() function being called in the body of the page. It should appear before any output is sent to the browser, as mentioned below:

silent speakers!

DJ did a great job checking mandir speakers on NR's instructions - found 8 not working! Loose contacts and an amp being disconnected.... Fixed now, I believe.

new schedule page

Still working on the new schedule page - still needs streamlined import feature - import from csv file, currently have to copy-paste, and also need to add lots of timezones. Bugfixes pending too - download flag checking, filename gets a space and needs ltrim....

trouble or work ticket systems for windows - Open source ticketing system - Perl-based, has Windows installer - - Perl-based, has Windows installer

Google results for NA who had asked for MT office. Passed on the info to V, since he's the one who has to install any sw for MT.

Friday, October 26, 2007

Media convertor problems?

On Oct 11 I had some connectivity problems, thought there was some router problem, but finally suspected local (PC) router and media convertor. Once again, on Oct 23, I had one more episode of connection problem. Tried restarting my router (Millenium) computer. Still problem persisted. Then toggled the WorkStation/Hub switch of the media convertor. Then it started working. So, probably media-convertor / network card issue. Right now it is working and I can live with it....

Thursday, October 25, 2007

internal http sharing problem

Our internal http large file share had been unmounted after a reboot due to a power problem, but after remounting it, was not able to access it from the same machine. Forgot that I've not added localhost to the access controls! So, changed the relevant lines in httpd.conf:

AllowOverride None
Options +Indexes
Order deny,allow
Deny from all
Allow from x.y.z.w a.b.c.d p.q.0.0/
#allow from

Migrating to Google Apps

Spent the whole morning yesterday creating accounts, adding forwarding rules etc so that the users will not feel anything in the migration. The Dashboard was very slow yesterday, probably because of Murphy's Law! This morning, corrected our SPF records so that the new accounts also can send mail without spf softfail - needed to remove the mx records of gmail, which were anyway not required, since mail sent from gmail is anyway signed properly. So, now the SPF records have ip4: parts and the include: part as given in Google's Helpcenter.

For migrating other domains, will think about the options presented by Scott Hanselman, especially the part about transferring old mails via pop and the gXfer tool to one-click transfer all mails.

Monday, October 22, 2007

small bug in PhpMailer timezone code

As posted to phpmailer general mailing list:

In class.phpmailer.php 's function RFCDate(), there is a bug in the timezone code which returns +0580 for Indian Standard Time instead of +0530.

The line
$tz = ($tz/3600)*100 + ($tz%3600)/60;

should be replaced with

$tz = (($tz - ($tz%3600) )/3600)*100 + ($tz%3600)/60;

Found this bug in our phplist mails....

Edit: More info - has a comment which describes the integer division required:
nicolas_rainardNOSPAM at yahoo dot fr
10-Jul-2007 09:10
Here is another very simple and extremely fast integer division function, but it works only if the arguments are integers and nothing else. So use it only if you are sure of what you are doing.

function int_int_divide($x, $y) {
return ($x - ($x % $y)) / $y;

phplist process bounces

Phplist process bounces stopped working a few days back. Reason probably was an interrupted run of the processbounces script. Tried deleting bounces with the Reset Bounces link in View Bounces section. Didn't work. Then purged the mbox file by rm and touch, fetched some more bounces, now it works.

Sunday, October 14, 2007

PhpSpy trojan and more

One of our machines was found to have the PhpSpy trojan, using which a cracker had put a link to on a webpage. The fake mozilla site is now down - note the spelling -
... And we're removed the offending php-based pages from view.

Wednesday, October 10, 2007

dns corrections

Found that the local Cyberoam dns server was repeatedly failing for domain. Checking out the Domain report at, found that it had a problem of having a stealth nameserver. Logged into Plesk and changed the ns dns records to w5 and w6, that seems to have fixed the problem. Also added SPF TXT record using the wizard at

phppgadmin issue - blank fields

An issue with phppgadmin cropped up during the db work. If any field which is marked as a key of any type (even unique key) is NULL, clicking Edit next to a record opens the Edit form with all the fields blank - not filled in like in other cases. Does not happen for NULL fields when the fields are not marked as keys. It relates to the way the query is made in phppgadmin....

sql queries for find-replace

Running some sql queries on our pgsql db like
UPDATE "file_id" SET "download_filename" = '-' 
WHERE "filename" ~~ 'SV_MS%'
AND "filename" not like '%MSANTAN%'

UPDATE "file_id" SET "download_filename" =
REPLACE(download_filename,'_RAVI_', '_')
WHERE "filename" ~~ 'MBV%RAVI%'
and filename not like '%ARAVIND%'
and filename not like '%KULA%'
and so on. It took two mornings to finish.

Saturday, October 06, 2007

extra-curricular activities

Aiming to use Dataone for "Loka Samasta Sukhino Bhavantu", doing a bit of cleanup for some other sites on a purely voluntary basis, avoiding the limelight....

Tuesday, October 02, 2007

R's iptables config for ssh natting

Struggled a bit with R to configure his machine to nat ssh - here's a working /etc/sysconfig/iptables for Fedora -
# Generated by iptables-save v1.2.11 on Sat Mar 11 13:08:36 2006
:INPUT DROP [1339:140723]
:OUTPUT ACCEPT [137:35130]
# allow local loopback connections
-A INPUT -i lo -j ACCEPT
# drop INVALID connections
-A INPUT -m state --state INVALID -j DROP
-A OUTPUT -m state --state INVALID -j DROP
-A FORWARD -m state --state INVALID -j DROP
# accept requests from internal machines on port 8080
-A INPUT -s -i eth0 -p tcp -m tcp --dport 8080 -j ACCEPT
-A FORWARD -s -i eth0 -p tcp -m tcp --dport 80 -j REJECT
-A FORWARD -s -i eth0 -p tcp -m tcp --dport 443 -j REJECT
-A OUTPUT -d -o eth0 -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT
-A OUTPUT -d -o eth0 -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT
-A OUTPUT -o eth0 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A OUTPUT -o eth0 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A OUTPUT -o eth0 -p tcp -m state --state NEW -m tcp --dport 110 -j ACCEPT
# Completed on Sat Mar 11 13:08:36 2006
# Generated by iptables-save v1.2.11 on Sat Mar 11 13:08:36 2006
:OUTPUT ACCEPT [35:2100]
# Completed on Sat Mar 11 13:08:36 2006
By changing the ports to REJECT in the format --dport 8081:65535 he can block access to any other service.

We took more than an hour, because default routes were not set to use this machine as a gateway, and also the machine blocks pings. Once the gateway was set correctly on his double-homed Win2k3 box, it worked. But we also struggled a bit because of forgetting the two COMMITs, one after each *table. Also, the
echo "1" > /proc/sys/net/ipv4/ip_forward
was getting overwritten on service network restart, he had to add it to the startup scripts.

Sunday, September 30, 2007

Educational sw and toys

A asked about Educational sw for Ap - so I googled for Educational software 8-10 years and came up with There's also Google Earth and Geekdad.
Searching Ask Slashdot gave pointers to edubuntu and Tuxpaint - that was for pre-schoolers.(Edit: Edubuntu is hardly for kids!)
And wikipedia has a good listing. 'Where in the World is Carmen Sandiego' can be downloaded from here. And there seem to be quite a few more educational game downloads there too!

bat file for print job

Printing files using
copy filename.bin lpt1
written multiple times in a bat file doesn't work - the printer queue needs some time. One option was to use a Reply statement using the given by MS
Another option is the SLEEP or WAIT given at Something similar is at

type filename.bin > lpt1
works fine even if written multiple times.

youtube and others

Checked out the video quality and other issues like copyright etc for uploading on youtube, google videos and needs a Creative Commons license or something similar. Youtube reduces resolution to 240x180 and restricts to 10 minutes per clip. Google Videos seems to be the best bet - 640x480 res, unlimited length, uploader owns copyright.

Wednesday, September 26, 2007

samba issues

There were some issues with Samba and Windows using "Allow Everyone" shares. R's problem was that his Fedora box had a samba share which he wanted to "Allow Everyone" - configured with the gui, didn't work, with Windows clients getting a forbidden message. Googling with
samba share fedora all everyone
found and passed it on to R. R just added a samba user with the gui and it started working. Apparently his box just had root and no other users, and samba root login was banned.

Tuesday, September 25, 2007

quick phplist faq

> 1) Why does a user get blacklisted.
When a user unsubscribes, he is blacklisted. Which means that no mails, not
even system mails, are sent to him.

> 2) What about the users who have not confirmed. Is there a way to
> resend a request for confirmation mail to them.
Yes, there is such a feature.
Manage Users -> Reconcile Users has many useful links - scroll till the bottom
of the page to see all of them.

> 3) I have sent a mail to AOL users and asked them to subscribe from a
> different domain and deleted them from the list. Are there any other
> domains which give a similar problem?
You can check using "view bounces". Read the reason given by the mailer daemon
for the bounce.

> 4)Is there anything else which I need to know or manage?

Very good documentation at

Sunday, September 23, 2007

logs on media

Logs on media server were filling up system drive once again. Changed log location to Data drive which has more space. Also using 7zip to archive and download older log files. Commandline is
7z a -tzip filename*.* 

Saturday, September 22, 2007

using autogk to convert mpeg2 to avi

In order to use my workflow for saicast which uses virtualdub, needed avi or mpeg1 input - so, used autogk to convert mpeg2 files to avi. 3.5 hours to convert a 1.1 hr 3.3GB mpeg2 to 2 GB divx avi.

file transfer, samba and sftp

Taking video from video studio via smb on studio's gateway, found that 3.3 GB file was not getting directly sftp'd from the smb-mounted drive - crashing at 2 GB. But copying to local drive over the same smb mount was working! And then sftp worked too. Strange!

flv encoders

Video to flash encoders, freeware from which has a nice search feature, "look for freeware only". DVDVideoSoft's Free Video to Flash Converter makes a basic html page with a basic player embedded too. But the more full featured converter is Riva FLV Encoder. And took only 10-15 minutes for a 50 minute vcd file to be converted to 200 kbps flv file.

PsPad - nice free text editor with nifty features

Looking for a nice text editor, from googled reviews, found pspad freeware editor. Download link for pspad was from, and that led to some more finds, video to flash convertors...

Friday, September 21, 2007

find files with GNU find

Syntax to remember -
find /path/where/to/look -name *.mpg
will search for *.mpg in all sub-directories of /path/where/to/look too.

Tuesday, September 18, 2007

Tight VNC tunneled over ssh

As written in my previous post, tightvnc was using far less bandwidth - only 100 kbps instead of 500 kbps for X over ssh. To sum up the setup, run on remote machine
vncserver :63 -geometry 1024x768 -localhost -depth 8
For linux client machine, add to ~/.bash_profile
VNC_VIA_CMD='/usr/bin/ssh -2 -c aes128-cbc -x -f -L %L:%H:%R %G sleep 20'
export VNC_VIA_CMD
Run client as
vncviewer -encodings Tight -depth 8 -quality 1 -via ip.address.of.remote localhost:63
where you should change ip.address.of.remote to the appropriate address, of course. And for Windows clients, Putty should have the tunneling set up as
L5963 localhost:5963

using netstat on Windows

Netstat is always useful for finding open ports, whether a service is running as expected and so on. As listed at
netstat -ao |find /i "listening"
to find process id and open ports. Process id can be mapped to process name with Windows Task Manager, choose to view PID from View -> Select Columns.

open links in firefox

Links in emails were not opening in firefox directly, but were loading from kde cache, like
The solution is to use a %u as given in KDE-Forum. In KDE Control Centre, Components -> File Associations -> Text -> html , make the Command line read as
'/path/to/firefox' %u

Monday, September 17, 2007

optimizing X over WAN

Many different ways of optimization, like using ssh -C to enable compression, using tightvnc which uses tight encoding instead of gzip encoding of the ssh -C option, using servers like NX server

Thought I'd try tightvnc, since there's a simple but elegant step-by-step guide available with bandwidth comparisons - big difference noted between hextile and tight encodings.

Friday, September 14, 2007

tracing routes

Doing traceroutes to digistu and to Calicut, found Calicut in 5 hops (same dataone network) while digistu was 14 hops away from my room in the next building!
Tracing route to over a maximum of 30 hops

1 28 ms 29 ms 29 ms
2 51 ms 51 ms 51 ms
3 * * * Request timed out.
4 62 ms 60 ms 63 ms
5 85 ms 65 ms 69 ms

Tracing route to [(digistu dest)]
over a maximum of 30 hops:

1 28 ms 28 ms 30 ms
2 64 ms 63 ms 64 ms
3 64 ms 64 ms 64 ms
4 59 ms 61 ms 60 ms
5 61 ms 61 ms 60 ms
6 78 ms 79 ms 79 ms []

7 78 ms 79 ms 78 ms []
8 106 ms 106 ms 107 ms []
9 106 ms 107 ms 106 ms []
10 107 ms 107 ms 107 ms []
11 101 ms 101 ms 100 ms []
12 * 102 ms 101 ms []
13 108 ms 108 ms 107 ms one hop away
14 115 ms 115 ms 115 ms dest

Thursday, September 13, 2007

download issues on saicast

The Hariharan video on saicast attracted a large number of downloads, mostly from India, so the inefficiencies of the code were exposed. Server ran out of memory pretty quickly. Changed the ADODB.Stream object's buffering to be more sane - from code snippet at
found by googling ADODB.Stream large file
for i = 0 to objStream.size
i = i + 128000
My earlier trials along same lines did not work when I tried the Binarywrite and the Read calls in different lines, probably since I didn't save the Read's return value in a variable or something. When it had not worked, briefly tried a javasript-based solution:
<script language="JavaScript" type="text/JavaScript">
function forcedown(x){
myTempWindow =,’’"SSS"’);
<a href="javascript://" onclick="forcedown('');">dwnld</a>
The experts exchange link had some small syntax problems like SaveAs not within quotes, script tag not having the language=Javascript etc. Abandoned this as unsuitable because IE6 on WinXP was playing the file in Windows Media Player instead of showing the download box. Firefox, Konqueror, IE7 etc worked, Safari also did not work.

bandwidth usage

Checked out various apps bandwidth usage for the Dataone connection, using Ethereal.

Skype without video:
9 kbytes per second = approx 75 kbps = 36 MBytes per hour

ssh usage without X = 1 kbyte per second (heavy usage) = 4 MBytes/ hr

X over ssh usage = 63 kbytes per sec = approx 500 kbps = 230 MBytes per hour

Web based admin - phplist:
3 kbytes per second = approx 25 kbps = 12 MBytes per hour

Checking gmail with full interface:
5 kbytes per second = approx 45 kbps = 18 MBytes per hour

Remote Desktop on Windows:
3 kbytes per second = approx 25 kbps = 12 MBytes per hour

So, we've decided to go for an uncapped connection!

Tuesday, September 11, 2007

bug litany

saispace2 has lots of problems under Windows. And in spite of running squeaky-clean licensed sw! There's the inserting-DVD-crashing-system problem I've already mentioned, and also Windows Media Encoder randomly crashing during the second pass. Not so random, either. Opening another app or Firefox tab has triggered it on occasion, so nowadays I leave it for encoding turning off all other apps including IM clients. Probably something to do with HDD not being able to keep up, since it happens more often when audio and video are separate files. Fortunately the partial output file can be joined to another partial file, and some time can be saved. Similar problem seen with Virtualdub trying to import an mpg file from a Que Firewire HDD. Lots o' errors. Copy the file to internal SATA drive and then import, no probs at all. The Que drive also has other problems with writes, for eg. MusicMatch jukebox mp3 encoding sometimes fails when that drive is the target. Workarounds, workarounds.... Maybe I should look for motherboard driver update for the Intel 865 GBF.

Monday, September 10, 2007

currently busy with

Stuff I'm doing nowadays:
1. Processing a clutch of videos for saicast
2. Trying to follow up on the new php code for radiosai schedule page
3. Processing a little audio on the side, at least a little
4. Mandir recordings and playlist making as ususal

Sunday, September 09, 2007

reverted to PPPoE from laptop

After my last post, found that there seemed to be no way to do port forwarding in the UT300R2U ADSL router's web interface, so reverted to bridge mode using PPPoE from the computer by resetting to factory settings pressing the recessed button provided.

Saturday, September 08, 2007

BSNL Dataone broadband and UT300R2U ADSL router

Took more than an hour to configure the UT300R2U ADSL router to do PPPoE dialout for BSNL Dataone - even my previous experience was not enough to clear all the hurdles. This particular model number has been used for a large number of different routers, or at least very different firmware. And adding to the confusion was the different instructions for bridge mode (which is not what we want) which were the google matches. Anyway: First mistake was to keep the existing "WAN interfaces" enabled: they have to be disabled, or more easily, just deleted. Then, some of the settings in the wizard needed to be changed from the default for the connection to work. Here's the step-by-step procedure.

0. Reset the router to factory settings in case it's been altered significantly.

1. Set up your ethernet interface to have a static ip of Make the default gateway as well as DNS server. Connect ethernet cable to router.

2. Go to the router's config interface at - by default
username = admin
password = admin.

3. Go to Advanced Setup -> WAN on the left side menu and delete all other interfaces except the one with PPPoE (or delete all and start from scratch)

4. Using Edit if you're not making a new interface with Add, you get the next screen, where you make sure the VPI/VCI are 0 and 35.

5. In the next screen, make sure PPPoE is chosen as connection type, and encapsulation mode is LLC.

6. In the next screen, give your username and password, call the service name dataone, and most importantly, uncheck all the checkboxes, especially the one saying "Bridge PPoE Frames".

7. In the next screen, make sure "Enable WAN service" is checked. Multicast is optional.

8. In the next screen click "Save"

9. Finally click "Save/Reboot"

After the Router power cycles and the DSL light comes back on, you should find PPPoE UP in the WAN Status.

Saturday, September 01, 2007


Over the last few days:

1. P's Powerbook G4 65 watt power adapter - seems to be faulty, tho simple multimeter voltage readings show nothing even for the iBook's working 45 watt adapter. The 65 w adapter has a light at the end of the plug which used to light up when they touch the plug tip, it no longer lights up. And no charge indication on the Powerbook either. Apple Bangalore asked for Rs. 2,500 for just testing! Cheaper to buy a new adapter!

2. Some progress on the RadioSai schedule page being written for us by B in php, the schedule not being shown by default was my crib, it turns out it just needed the DefaultStreamId to be set properly in the Constants section. Now maybe we can stuff it with data and do performance tests.

3. Saicast download: not the bandwidth hog we had feared - maybe people are just coming to know about this feature slowly.

4. Nessus audits for our machines, ITC. Also told R about it. Planning on Snort/Tripwire also.

5. Phplist - exporting users and importing - need to first delete blacklisted (meaning unsubscribed) users and also unconfirmed users, since importing auto-confirms. P also reports crashes for importing all 20k+ users, so he's exporting 5k at a time or something like that.

6. R on security implications of ERP software running on JBoss without SSL, ettercap and such. Various ways of making it SSL, like and also worst case fix of using a remote login with SSH!

7. Lots of Mandir recordings.

8. Video studio recording floor D contemplating
Mackie TT24 and Marian Marc X 24.

9. The Yamaha AW4416 in Mandir is having hard disk problems, I think. Sometimes (when it is hot) doesn't shut down normally, with the hdd light continuously lit, stuck at 'change mode to Song' or 'Save Song'. Maybe formatting the hdd will help?

10. Many cards blown on the Annual Motion slot: Is it due to overheating or is there a short or is there a defect in the cards which came back after repair? Also, down to last spare lamp for Star projector.

posting for posting's sake

Lots of stuff to be put in here, but I need a breather in which to do it. Lots o' audio to be processed, fires which need to be put out, etc etc...

Sunday, August 19, 2007

fiber cut

Our internal fiber was cut at PS by some earthmoving equipment, so I've to use a USB key and sneakernet , walking to the Studio to finish work and access the Net.

Monday, August 13, 2007

Krishna reinstall

Had to reinstall krishna - forced into it by a compromise - so mail and search services were down for a day. Luckily Mandriva 2006 and 2007.1 are not too different, so many apps worked as before with just a copy-paste of the config files. Including the databases.

wordpad corrupts IIS Metabase.xml file

Once again, after my earlier post, had this bad experience. This time even after stopping IIS and then opening the metabase. So, it is definitely wordpad's fault, notepad doesn't corrupt, so use notepad alone for editing metabase.xml. ( %SystemRoot%\System32\Inetsrv\MetaBase.xml )

Saturday, August 04, 2007

copying text from a locked pdf file

1. Used PDF Edit tools from to remove the lock
2. This is shareware, adds watermark text which says
You can order the program at

3. Used pdftohtml - - to convert to html
4. Used find and replace in a text editor like kwrite to remove the watermark text after text conversion.

Sunday, July 29, 2007

text formatting with vim and vi

Vim helped me out twice over the last few days.

A virus spam complaint about our postfix server - could use the "find" command to easily locate the surrounding lines in /var/log/mail/info to show that it was just bouncing a virus mail.

Find (forward) in vi = /characters_to_find
Find backwards = ?characters_to_find
Find next = n
Find next in the opposite direction = N

The next tip was from a thread in the comments section of an article on freshmeat on how to make emails palatable to the Linux community.

we vim users have an extra-nifty trick available.
gq} will reformat the current paragraph, while magically preserving > > -style quoting!
gq/^--/-1 will do it from the cursor until your signature, which is even better.
The second part is not working for me - it complains about no match for ^--

But gq} works when there are paragraph breaks - two newlines.

Thursday, July 19, 2007

iBook + iCab, but no ethernet

iCab installed on the iBook, browsing is now up to par, but the ethernet port seems to be broken - switch light flashes green instead of steady green.

Getting DivX to work with TT's tutorial, updating software using the list at - is useful only for Windows software.

Update: Upgrading to Quicktime 6 broke DivX playback. Downgrading to QT 5 involved first removing QT6 and then installing QT5. Removing software on the mac = dragging all associated files to the Trash. Used Sherlock to find files with 'Quicktime' in their name. DivX works with QT5 and the 3ivX codec using DivX Doctor, but files with resolution 720x480, for example, play at some 10 fps, probably because the processor can't keep up.

Wednesday, July 18, 2007

GMail and Blogger not usable on the iBook with IE

Since the iBook had IE 5.1 for Mac, it doesn't recognize the xhtml mime type: this is discussed in the Wikipedia and elsewhere but Gmail and Blogger seem to have issues with it still. User-agent code needs a brushing up, probably. Finally got the previous post's text uploaded thru Yahoo Mail, since the USB port was recessed and the mem-key was not able to go in without an extension cable.

Short guide to the Mac for PC users

After "rescuing" the Tangerine iBook from M, I'm "trying to find it a good home". Since almost no one has used Macs here, I have this small guide to get them started.

Intro to an iBook for a Windows PC user:

1. In MacOS 9 and below, there is no Start Menu: you have to navigate to the app's location and double-click on it to start any application.

2. Menus remain at the top, closing the window doesn't shut down the app.

3. Just like Alt-F4 in Windows, use Apple-Q in MacOS to quit an app - or choose File -> Quit from the menu.

4. List of all open apps, something like the taskbar, is available on the rhs of the menu on clicking the button there.

5. The equivalent of Windows Explorer is called Finder.

6. Drag and drop the CD-ROM / removable disk icon to trash in order to eject a CD / removable disk.

7. The online Help system is quite good.

make a small planet

Daily Dose of Imagery has an interesting post on how to produce images like this.

Saturday, July 14, 2007

extracting audio from DVD

To get an audio-only file: guide at
found via - the guide uses DVD Decrypter and Goldwave, I used WinAmp with Disk-Writer plugin instead of Goldwave for the .wav conversion. Initially, the WinAmp playback of the mp2 file and saving to file was buggy - clicks at every second or so. Found that it was playing back fine in Windows Media Player. Found some info at this page - leading me to remove the mp2 extension in the list of the Nullsoft MP1-MP2 plugin and add it to the Directshow plugin instead. Then it works fine.

Ctrl-P in WinAmp -> Plug-ins -> Input -> Choose relevant plugin, hit the configure button, add / remove extensions in the File Association Extension list.

Tuesday, July 10, 2007

firefox download manager

Wanted a download manager with the option to queue downloads, so that our net connection wouldn't get overloaded with too many simultaneous downloads. DownThemAll seems to be a good solution. It has options for using as a download accelerator, too.

Sunday, July 08, 2007

wifi, SPDIF, tv out and dual display

More tests on the Acer Aspire laptop:

Wifi finally enabled thru ndiswrapper. It probably works with the Atheros driver from madwifi latest svn build, but didn't try it. Took quite a while get it working because I tried to take short-cuts which didn't work. First tried with the kernel source given in the DVD, didn't work since an update had upgraded the kernel from 2.6.17-13mdv to 2.6.17-14mdv. Then, I disregarded a forum post saying the latest madwifi patches will be needed, and madwifi stable didn't work. Then used old version of ndiswrapper on the DVD, didn't work with the Windows driver. Finally worked with latest stable ndiswrapper tar.gz. I've not tested with a hotspot, just saw that Mandrake Control Centre and ifconfig recognize the interface wlan0. Left it disabled since A doesn't have wifi at home.

TV out:
Works in Windows, NTSC, after going to Intel display properties tab after clicking display properties Advanced button, needs the connector to be plugged in before the settings appear. Doesn't work in Linux.

External Monitor:
Works in Windows and Linux, Windows has option of switching between Extended Desktop on CRT, Cloned Desktops on LCD and CRT, LCD only and CRT only modes, while on Linux Cloned displays on both is the only option. If external monitor is connected, BIOS, GRUB etc display only on the external monitor. When Ext Monitor and TV-out work, video overlays on those displays were working too - videos played in KMplayer and Xine for Windows and Linux tests.

Details of wifi exteriments:


inside the madwifi directory, ran
make KERNELPATH=/usr/src/linux-2.6.17-13mdv 
make KERNELPATH=/usr/src/linux-2.6.17-13mdv install
cp -rf /lib/modules/2.6.17-13mdv/net/* /lib/modules/2.6.17-14mdv/kernel/net
Kernel couldn't load the module on modprobe.


Got new kernel source, did again. Then,
modprobe -v ath_pci
gives in /var/log/messages
Jul  2 09:43:21 aceraspire kernel: ath_pci: (
Jul 2 09:43:21 aceraspire kernel: ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 17 (level, low) -> IRQ 17
Jul 2 09:43:21 aceraspire kernel: wifi%d: unable to attach hardware: 'Hardware didn't respond as expected' (HAL status 3)
Jul 2 09:43:21 aceraspire kernel: ACPI: PCI interrupt for device 0000:03:00.0 disabled

So trying ndiswrapper instead of trying cvs and stuff.

Using the ndiswrapper installation instructions:

lspci gave
03:00.0 Ethernet controller: Atheros Communications, Inc. AR5006EG 802.11 b/g Wireless PCI Express Adapter (rev 01)

lspci -n gave
03:00.0 0200: 168c:001c (rev 01)

Next to check out the windows drivers and use them.


C:\Program Files\Atheros\Wireless\Driver\net5211.inf

With the ndsiwrapper 1.21 which was included in Mandriva 2007.1, /var/log/messages gave
Jul  3 13:29:48 aceraspire kernel: ndiswrapper version 1.21 loaded (preempt=no,smp=yes)
Jul 3 13:29:48 aceraspire loadndisdriver: loadndisdriver: load_driver(361): couldn't load driver net5211
Jul 3 13:29:48 aceraspire kernel: ndiswrapper (import:241): unknown symbol: ntoskrnl.exe:'ZwDeleteKey'
Jul 3 13:29:48 aceraspire kernel: ndiswrapper (load_sys_files:215): couldn't prepare driver 'net5211'
Jul 3 13:29:48 aceraspire kernel: ndiswrapper (load_wrap_driver:113): loadndiswrapper failed (65280); check system log for messages from 'loadndisdriver'


Finally installed latest stable ver 1.47 from, installed wireless tools, now all ok.

Friday, July 06, 2007

making DVD slide shows

Found Windows and Linux tools for making DVD slide shows for K*R :
Windows: DVD slideshow GUI
Linux: Slideshow Creator

Edit: But they have their idiosyncracies... slcreator needs gambas, so I directly tried it's backend, dvd-slideshow. Dependencies like ImageMagick > 5.5.4, mjpegtools, dvdauthor were already on saispace2, so tried installing and running it from there. The bundled dir2slideshow script easily produces the required input text file. But Imagemagick (composite) gave errors - lines similar to these:
composite -compose src-over -gravity center -type TrueColor -depth 8
unknown option src-over.

Running dvd-slideshow on aceraspire - Running the program with the images located in a remote samba share gave an error, the smb share getting disconnected. Most probably some issue with samba on the aceraspire. Copied the pix locally and ran, all 605 pixs at once. Chugged along, each 2-second cross-fade taking nearly 15 seconds to render! But the whole process took only 2.5 hours for 1.5 hour long video file to be output as a vob.

Running DVD-slidehow-GUI on Windows on saispace2:
If captions are enabled, AVISynth subtitle engine gives an error when there are 18 or more images, saying can't find the temp file DVDsGUItemp.ssa even tho' it is in the path mentioned in the error dialog.
AVISynth Open Failure - TextSub: Can't open "q:\path\DVDsGUItemp.ssa"

I suspect it is because the program is addding too much white space at the beginning of the ssa file - with 1-2 pictues, the subtitling works, and as more pix are added, the ssa file gets more white-space at the beginning. And again, after removing the subtitles in preferences, the program works, but takes up so much memory that the system (512 MB RAM, 512 MB swap file) runs out of memory if all the 600+ images are added at once. So, doing them 100 at a time. It also takes roughly 4 times real-time - so a slide show of 5 minutes takes 20 minutes to prepare the MPEG2 file.

wget saves the day

K*R wanted some wedding pics of a relative, from a US photo site which I won't mention here. They had a painful java applet interface, one photo viewable every 30 seconds, for ordering only. Checked the code, found the path to the images, and wget was able to suck them all out easily! Used the following code from to create a text file of images:
for i in $(seq 605); do echo "http://url _ $i _ .jpg"; done > list.txt
and then used
wget -i list.txt --random-wait --wait=2

Saturday, June 30, 2007

java plugin problem

In spite of following the instructions given at Mandrivausers there seems to be some problem with the java plugin on the Acer, probably due to the update to Firefox . Interestingly, Konqueror is able to pick up the plugin from the /usr/lib/mozilla/plugins folder, and java is working fine with it.

blogger issue with captchas

There seems to be some issue with blogger captchas after the auto-save is introduced - every single time it refuses the captcha first entered with "ERROR - Enter the letters as they are shown in the image." if the post has been auto-saved.
Edit: searching for captcha on the Blogger help group led me to this thread, so now I've submitted the review form noting that I'm not a spam-bot.

solving audio quirks

My first laptop post was perhaps overly euphoric. There's an issue with the audio - plugging in headphones doesn't automatically mute the speakers. Thankfully, there's a solution, from The Acer Aspire 3680 entry noted that muting the "Surround" in the mixer, Kmix in my case, mutes the speakers, with sound still coming in the headphones. Also, the function keys - Fn-F8 for muting, Fn-DownArrow for decreasing volume and Fn-UpArrow for increasing - don't work. Another tweak which was required was to change the "Master Channel" by right-clicking and choosing 'Select Master Channel' - it was PC speaker, changed to PCM. This is so that now a single click on the Volume Control should be enough for controlling sound, without needing to open the full mixer.

Another nice link from linux-on-laptops was via the forum to this page - nice links to free audio software including Ardour.

Friday, June 29, 2007

installing java plugin

Surprisingly, Java plugin was not installed properly on saispace2. After the upgrade to firefox2, did that too. The arcana was from and in my case, the command was
ln -s /usr/java/jre1.5.0/plugin/i386/ns7/
found by doing
rpm -ql jre

video player shootout

checking out media players on Mandriva 2007: Mplayer aspect ratio seems to be broken - seems to assume a 4:3 screen, and since the screen is not 4:3, is skewed. VLC and xine were OK. Totem and KMplayer seem to have a gamma problem - picture is washed out. And the players have problems with 3D desktop enabled. With Metisse, mplayer doesn't play without changing the vo option. VLC gets blocky - pixel interpolation seems to have gone for a six. Xine and Kmplayer with xine develop an interlacing problem. With Compiz and Beryl, VLC plays ok in windowed mode but black-screens on giving full-screen command. Xine is OK.

Tuesday, June 26, 2007

Mandriva 2007.1 on Acer Aspire 3684NWXCi

Got this machine for A - supposed to come pre-loaded with Linux, but the naughty dealer has put in an OEM version of pre-activated XP. 80 GB hdd was partitioned into 20 GB pieces, so the easy way out was to just leave everything as it was except to pop in Mandriva 2007.1 Free DVD and install it, removing the "D:" partition.

First looks - very impressive, with 3D desktops in three different flavours, each one configurable till one drops... Everything tried till now has worked out of the box - even the usual suspects ACPI battery monitor, sleep, WiFi, etc. The display was 1024x768 on first boot, but on opening drakconf and going to Hardware -> Change screen resolution , it prompted to change driver to the accelerated 915 driver, and then on X restart changed to 1280x800 as it should be. Then the 3D desktops - quite nice eye candy... More later.

Monday, June 11, 2007

using the dialup - backup connectivity

Leased line failure, had to go back to dialup for a week. Dnj helped PB to locate the modem in the server room itself, with a long telephone cable connection over lan cable laid in just 30 minutes. kppp on krishna connected OK, but for the connection to work, the eth1 had to be disabled - it had the default gateway. For using from another machine, connected over eth1 - like me, for example, instead of disabling eth1, just commented out the
line in /etc/sysconfig/network . Since I'd also commented out (actually deleted) the line
after the leased line came back online, I had to restore it using drakconf and later disable shorewall.

Thursday, May 24, 2007

The new domain is now operational. There was an error with the mail server: I'd forgotten to add to as per the readme and another thing was that I'd used a CNAME as the MX record which is not allowed, according to Corrected.

Tuesday, May 15, 2007

making NTSC / PAL changes persistent

Using the video camera for skype as mentioned earlier, the NTSC setting was not being saved in the video source settings - it was reverting to PAL on reboot, when skype restarts. Googled and found a solution here. Downloaded VideoWDMControl v2.2, put it in the startup so that as soon as the machine boots up, the source can be set. But still, it would be better if the changes could remain after a reboot.

Thursday, May 10, 2007

PDF Split and Merge

Via, a freeware for splitting and joining PDFs for R - another idea for doing this was to print to pdf stating print pages 1-3 or whatever. This guy has a nice revenue model - asks for donations for the compiled version of enhanced version, while giving away the source, and the basic version, free.

skype with video

Over the last few days, some activity on skype, tried out the webcam feature using the Sony Handycam TRV-36. Nice, full-motion video, good even in full-screen mode, unlike Yahoo.

DVD Decrypter for reading DVDs with errors

DVD Decrypter's nice retry feature and error correction mechanism are pretty robust. In case some file is not readable otherwise, copy to hard disk using "File" mode and then run DVDShrink if necessary in "Re-author" mode to create ISO file. This way, files which Fair Use Wizard can't encode directly are also made available.

mounting various large hard disks

Some days back we'd mounted a 250 GB hd on developer on the linux machines using samba - the fstab entry is
//path/to_share /path/to/mount/folder smbfs rw,credentials=/path/to/credentials.txt,uid=500,gid=500 0 0
where the uid and the gid are the user and group ids of the user who needs rw access to the share. For finding a user's uid and gid, the command is
id username

On our Jo'berg server, the hard disk is on the same machine, so the fstab entry for mounting it is given in a previous post.

Wednesday, May 09, 2007

helping TB with another domain

Spent an hour with TB's manager's domain from nettigritty. Authoritative name servers for the domain were not configured properly. Logging in to

In the Management console, clicking Domain Registration, Clicking on Modify Name Server in the second row, changed the name servers from etc to

This did the trick. Dns changes took approx 10-15 minutes, then it started working.

Tuesday, May 08, 2007

copying missing files to Jo'berg hard disk

From the daily email "SGHBACK 846 : Automatic Audio files Statistics Check for SGH" copied and pasted to kwrite and made appropriate find/replace so that the lines were like
nice -n +10 cp 'ANN_BHAJANS_SWAHILI_END.mp3' ../audio -v
copied to audioold, did chmod +x and ran. Also, the new audio has noexec, since it is mounted as user. So, any such stuff needs to be run from some other partition with the full path.

Monday, May 07, 2007

new hard disk install at Jo'berg

Added to fstab
/dev/hdd1               /home/sgh/audio2         ext3    rw,user,owner   1 2
Had to do a
chown -R sgh:sgh audio2
since the files had some other ownership stamp. Stopped playout, umounted audio, mounted hdd1 as audio. Unfortunately the process was complicated by many files being missing in the new drive. Copying from the audioold directory....

Saturday, May 05, 2007

iptables firewall config

saispace was giving too much trouble - bad network cable? - so connecting directly now instead of through NAT. So, set up firewall. Important part is the default
-A INPUT -i eth0 -j REJECT
just before the last COMMIT in the *filter table.

Friday, April 27, 2007

accessing Win2003 shares with Samba

The shares on Win2003 were not being seen on saiwaves komba2. Tried smbclient commandline, able to see those shares which require password. So, made share with permissions not set only for "Everybody" (which is the default), but also added the particular username for which I had the password. Then the share is seen, can be mounted. Added to fstab so that it mounts on boot. Useful info at

The uid gid of a user can be found with id -u username and id -g username as given at

The encryption problem mentioned at is not an issue in our case, with the encryption being turned off before I started checking this problem, probably because the machine is not a domain controller.

Wednesday, April 25, 2007

wireless networking

Played around with the Linksys WAP54G which had landed at PDS mapping the signal strength with the Acer laptop - reaches nearly 200 feet in open air when kept outside the window. Upto corridor of our building too. But practical use? Not really - typing into USB key far easier for my needs.

Sunday, April 22, 2007

problem with google apps start page

TB had some trouble with "verify your domain" in google apps start page creation. The google apps help group had this info:

I was having the same problem that you are having and I just got a
response from the Google Apps Team saying that you need to have the
"Next generation" control panel activated for "Start page" and "Docs &
Spreadsheets" to work, if you have the "Current version" control panel
activated you still can see the option for "start page" but you can't
activate it.

Steps to change control panel:
1. Log into your account and go to "Manage this domain".
2. Go to "Domain settings" (it's under "Services").
3. Go to "Advanced settings" and click on "Edit"
4. Under "Control Panel" you have the option to change to the "next
generation" control panel, select it.
5. Click on "Save Changes

After you should be able to activate the Start page.
Did that and it worked.

Wednesday, April 18, 2007


Last year I'd tried the Ubuntu 5.10 Live CD on a low spec machine - PII 350 with 128 MB RAM - and had been less than impressed. On a whim, just tried it on the Acer laptop
and so on ) and was favourably impressed. Display correctly set to 1280 x 800, and apparently full ACPI support - battery monitor shown on panel. Mandriva did not have any of these.

Thursday, April 12, 2007

Number of subscribers to satellite radio

Saw an old email of mine, referring to a article about WorldSpace having around 75,000 subscribers in India. XM and Sirius combined have around 10 - 15 million in the US. Interestingly, the numbers are roughly in the same ballpark range as the number of millionaires in India and US, too - around 80,000 and 8 million respectively. Not to say that only millionaires subscribe to WS, but the socio-economics of it....

Wednesday, April 11, 2007

toshiba laptop again

As noted in my previous post, the power problems finally brought the laptop back. External jack method was the solution, with D doing most the work. Then, the WiFi and speakers were not working - once again KR opened it and fixed it.

Thursday, March 29, 2007

Toshiba laptop power problem

H brought in a laptop, a Toshiba Satellite M35X, with the power problem and solution as given at - he had done all the homework. Using the beautiful disassembly guide from irisvista.comKR opened it up with occasional help from me and did the job. On putting it back, it did not show any display. In the evening, came back and checked again, while it was charging all the while - turning the speakers on with the switch provided, heard error beeps - 1 short, 3 short, 3 short, 1 short. Was it the Phoenix BIOS motherboard bad signal 1-3-3 ?! No - I suspected the RAM. Removed it - a single 512 MB DDR, the same signal. Replaced it in the other slot, no beeps! Put it back in the first, this time seated it properly at 30 degree angle and more inside, slid in without any problem, now booted fine. But the soldering or the power jack still has problems, jiggling the power plug makes and breaks the contact. Maybe he can live with it, or maybe he wants to use the external jack method.

Wednesday, March 28, 2007

XP bug in handling zipped files

When XP copies files from a "Compressed folder" into another directory, that is to say, extracts from a zip file, it creates a temp folder inside
C:\Documents and Settings\\Local Settings\Temp 
but forgets to delete the temp folder afterwards if the files are readonly. So, the temp directory fills up...

Microsoft says call 800-MICROSOFT for reporting bugs. In case anyone in the US reads this, they can do so. Meanwhile, I'll post this on an XP Newsgroup as 'bug in extracting read-only files from zip file'.

Tuesday, March 27, 2007

Power problems

Power problems over the weekend. Saturday night, heard some bang, burning smell. It seems transformer is shorting. Monday night power temporarily restored using School Hostel transformer. The 1.5 KVA Numeric UPS which has input section trouble taken to Studio, from where it is supposed to be picked up and taken to ATP for repair. M, the repair guy, says the circuit board is damaged, may cost a bit for repairs.

Wednesday, March 21, 2007

Tuesday, March 20, 2007

ActiveSync toggle

DM's trouble was probably caused by ActiveSync remaining running while he pulled out the Bluetooth dongle - the next time he put in the dongle, ActiveSync was probably locking the previously used COM port, so the next COM port was being used. Using ActiveSync toggle to stop ActiveSync from running all the time may help - directed there from PocketPCfreeware via googling activesync startup.

Monday, March 19, 2007

bluetooth blues

DM has problems with his Bluetooth dongle syncing with his PDA - the COM port keeps incrementing, and if it goes above 20 the sync doesn't work. Googled Bluetooth COM port and found a post with the same problem which had been solved with the method given in this FAQ article using a MS KB article to remove spurious com ports.

Saturday, March 17, 2007

Added three streams log processing to Analog

Using the method given for virtual hosts, added the three streams to the Analog file for combined stats. Can of course have individual stats by commenting out the other streams...

Analog configuration

Added PAGEINCLUDEs for asp and mp3 in analog.cfg on fs3 so that the requests and pages would match better in the Downloads section webstats.

Sai Inspires backups and hard disk space

From PB: Found that sai inspires messages have not been sent for the day - 9th March. Restarted mysqld and httpd (mysqld failed to start). tail /var/log/mysqld/mysqld.log showed [ERROR] Can't start server: can't create PID file: No space left on device. /var was full. Moving apachebounces cleared up nearly 2 GB, restarted mysqld... it started. But sending messages with processqueue still failed, with [ERROR] /usr/sbin/mysqld: Can't open file: 'phplist_bounce.MYI' (errno: 145). tail /var/log/mysqld/mysqld.log showed [ERROR] /usr/sbin/mysqld: Can't open file: 'query_log.MYI and so on. Googling gave solution

So, logging in to the
mysql -u root -p 
prompt, did that, and issue solved.

free wav editor and bookmarklets

A had sent me these links to Bookmarklets and Wavosaur.

Wednesday, March 14, 2007

On-demand with announcements joined

For on-demand with announcements, for KA dialog and Bhagavad gita slokas, using mpgtx - has alias mpgjoin to join ann and main files and putting in renamed folder. Created a new set of podcast php files for renamed songs and renamed specials. Need one more where the Prasanthi Mandir Bhajan will be served from the normal location, but only the name will be changed on the fly.

fs1 C: filling up

Found fs1 C: filling up - turned out to be log files. C:\WINDOWS\system32\LogFiles one folder had 20 GB, another 3 GB. Moved to D: , will zip, backup and delete.

removing claps

Removing claps in bhajan recordings - well defined claps near the mic are being removed pretty well by "Remove single click now" in Cool Edit Pro's Click-Pop Elimination filter dialog under Noise Reduction menu. Filtering clicks and pops with "Old Record Quiet audio" preset does a reasonably good job of large selections.

Tuesday, March 13, 2007

Today's achievements

Half an hour correcting dl.asp delivering 0 bytes to IE:
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile(strFilePath)

L bumped up the audio on AsiaStar, now it's fine.

Rest of the morning doing Bhajan processing.

Afternoon tracing schedule problem with DST: found probable locale change so that
if (date > #11/03/2007#) and (date < #04/11/2007#) then
has stopped working and now needs to be
if (date > #03/11/2007#) and (date < #11/04/2007#) then
So, changed it to locale independent
if (date > DateSerial(2007, 03, 11)) and (date < DateSerial(2007, 11, 04)) then
instead. We're not changing the changeover times because then the Latin Americans would have four changes to their regular programming every year - following US DST and their own DST.

And evening was spent on playlist generation.

Monday, March 12, 2007

newline in csv breaks database tables

A single bad newline in a description field had the schedule page down for the last half hour while we traced and corrected the problem... Caution needed when copy/pasting descriptions especially from text files / emails as in the case of Telugu programs!

bhajan processing

Starting slowly on Bhajan processing. Yield is roughly an hour's worth for a morning's work.

Sunday, March 11, 2007

changes to add PHP 5 compatibility

The forms in maillist were not PHP5 compatible: as noted by P, in PHP5, the posted variables are not automatically available, but requires the addition of lines like
Did the necessary additions by searching for the name=parts and thus the required variablename in the forms. Partially implemented, so that most frequently used pages work.

changed Daylight savings times

Changed the code for daylight savings times for USA-Canada and Israel for 2007 checking out the info from

on-demand links on schedule page

An interim solution implemented, which will work only for single file items. Probably, multi-file items will need a rethinking along the lines of my previous post. Current implementation uses a single extra filename field in the remote database. And the logic to automatically add this is
if ( ($CATEGORYNAME=="Special") OR ($CATEGORYNAME=="Discourse")  )

if (strcasecmp(trim($NEXT_DESCRIPTION),trim($DESCRIPTION)) )

if the condition fails.

audio distortion at AsiaStar uplink

There seemed to be considerable distortion in low frequencies, and M wanted the jingle during the start and end of Moments of Oneness to be broadcast undistorted. The line in the playout scripts was
mpg123 -o alsa09 -g 70 -q -a $DSP_DEVICE   "$line"
But the gain factor of 70% was not being set - probably some permissions issue. After IM and emails, L found the audio card bad, since using another one seems to give clear audio. But currently the DBMax is byepassed, so audio levels are sometimes low. Next task is to get it thru the DBMax.

Saturday, March 10, 2007

play avi and wmv on MacOS X

Since we were mulling over the MirrorDome and such systems, just checking if DivX files play with QuickTime - this article links to some plugins to achieve this.

Windows media components for Quicktime is supposed to let you play Windows media files on Mac.

Friday, March 09, 2007

renewing postgres database from dump

My local copy of the SGH postgres database was out of date, so I picked up the dump from saiwaves
pg_dump sgh > /home/sgh/sghdbdump
Before loading onto my system, I had to remove the existing database with
dropdb sgh
then create it again with
and then run
psql -d sgh -f sghdbdump
Sirf kuch hi lamhon mein apka swadisht database tayyaar!

Wednesday, March 07, 2007

downloadable links on the schedule

For implementing downloadable links on the schedule page, we'll need some database changes at our end also - a "flag" saying allow/don't allow download - so that the appropriate data can be dumped into the csv file for import into remote database. Experimenting with adding a filename field to the AsiaStar schedule table...

Tuesday, March 06, 2007

new on-demand code

Quietly removed the embedded XSPF player from the on-demand pages, replacing it with the mp3player from opening in a new window using a simple target="_blank" In replacing the old pages' code, learnt some regular expression syntax from KWrite's regular expression editor -
1. Reg Exps have to be only on a single line - end of line symbol $ terminates the regexp.
2. object.*$ means object followed by any characters till end of line.

Watch TV online

Got this link from Digg or Wired or somewhere:

iPod repair

Saw a Wired article on "iPod mechanics" repairing broken iPods, and checked out But the cost of replacing a hard disk on the old broken 1st Gen iPod is greater than the cost of buying a new flash-based mp3 player....

used iMacs

Found some nice deals via a google ad for used iMacs at - Apple iMac 233MHz Bondi 96MB, 4GB, CD for $29.99! But unfortunately we can't get them by normal shipping methods - there's a $200 anti-dumping duty, it appears!

virus attack

Like almost any all-Windows shop, the PDS was hit in 2nd half of Feb by a virus/worm which was creating a fun.exe in all folders, and spreading to all machines via shared folders. Norton Enterprise antivirus was not catching it or maybe because it was already loaded into memory, it was recreating instances. P finally cleaned it with AVG free + using msconfig to stop it from loading on startup.

problems connecting to our playout server

In the first part of Feb, we had some trouble connecting to our playout server at Melbourne. The traceroute was taking too many hops. Now, for example, the traceroute reaches the server in around 22 hops. A little on the high side?
traceroute to <snip> , 30 hops max, 38 byte packets
3 ( 6.730 ms 6.518 ms 6.491 ms
4 ( 7.045 ms 7.027 ms 7.012 ms
5 ( 8.562 ms 7.862 ms 8.308 ms
6 ( 10.766 ms 7.818 ms 7.894 ms
7 ( 109.642 ms 105.444 ms 105.941 ms
8 ( 106.086 ms 105.597 ms 114.480 ms
9 ( 272.903 ms 273.216 ms 272.864 ms
10 ( 277.114 ms 277.567 ms 277.532 ms
11 ( 279.050 ms 279.150 ms 280.268 ms
12 ( 398.757 ms 446.588 ms 398.916 ms
13 ( 399.456 ms 400.323 ms 399.194 ms
14 ( 354.208 ms 377.895 ms 355.543 ms
15 * ( 352.962 ms 359.593 ms
16 ( 367.183 ms 354.246 ms 372.219 ms
17 ( 368.156 ms 368.916 ms 376.512 ms
18 ( 370.836 ms 367.982 ms 375.395 ms
19 ( 369.349 ms 388.766 ms 398.202 ms
20 ( 370.382 ms 378.105 ms 416.715 ms
21 ( 375.345 ms 376.441 ms 409.865 ms
22 * * *

Force Refresh browser window

To force a refresh of cached content:

shift+reload in Mozilla-based products and control+refresh in Internet Explorer

remove from print queue

As root, to remove all print jobs from print queue
lprm - 

Monday, March 05, 2007

trying de-clipping tools

Trying de-clipping tools like Cool Edit Pro's built-in and Acoustica's built-in on bhajan recordings. No use. Since it is the singer mic alone which has the distortion, and since it is added to all the rest, the mixed signal can't be cleaned by these sw.

Tuesday, February 27, 2007

H2H virtual folder

Changed the H2H virtual folder journals into a physical folder with a single line asp page redirecting to

site outage

Our web-hosting provider had a looong outage - "corruption in Plesk and SQL server". Finally they reset and reloaded the server with backups circa Dec 2006! Last night uploaded newer files when ftp access was finally restored. This morning, set MX and other DNS records and set pls MIME type (without which IIS returns 404 for pls files!). Now we have to wait for the day-long DNS TTL for the changes to propagate. Email, other sites etc all affected...

Tuesday, February 20, 2007

Fujitsu Stylistic LT Tablet PC

Trying out the old Fujitsu Stylistic LT Tablet PC lying around at PDS. Unfortunately, either HDD or HDD controller is bad, so it freezes at random and sometimes doesn't boot. Win98 without generic drivers for USB mass storage - at least, it didn't recognize a 32 MB USB mem key I put in. Couldn't get the IR wireless keyboard to work either - probably because the AAA cells were dead. Won't spend any more time on it since frequent random freezing is just too aggravating.

Monday, February 19, 2007

spikes in traffic on festival days

Taking a look at Google Analytics graphs for saicast, spikes are seen for the Ati Rudra Maha Yagnam's Poornahuti, Birthday and Shivarathri. So, maybe we should put content on the site so that on festival days people can see previous years' festivals on the home page?

Tuesday, February 13, 2007

Wikipedia SOS CD - finally made for Sony Reader

As mentioned in my previous post, things are not so easy since the Sony Reader doesn't understand html, and also doesn't follow links to external files. Final solution chosen was HTML2LRF, with each alphabet as a separate file. Each article then gets listed in the Table of Contents of that file.

Nitty-gritty of making the files:
1. cd L:\wpcd\wp\b
2. dir /B > l:\direct.txt.html
3. Open direct.txt.html in Mozilla and copy / paste to wordpad - this removes the carriage-returns.
4. Find/Replace .htm with .htm l:\wpcd\wp\b\
5. Copy / Paste into command prompt which is already in the bin directory of HTML2RTF (otherwise doesn't work) with the suitable -o -t and so on.

Finally uploading to esnips public folder -

And as a single zip file with at
Edit: The single zip file no longer available there, will post a new link if and when I get hold of the original file.

Sunday, February 04, 2007

First Generation Airport Base station (Graphite) with Windows

As noted in my earlier post the Airport Base station needs a Mac for configuration. Even after that, tho it is set up to do DHCP, it doesn't give IP addresses to a WinXp client. May be a bug with this particular Base Station. Anyway, manually giving an ip in the client works well enough. Range, when Airport is in PDS server room, covering both studios and reaching nearly, but not quite, to front of R1.

spam from our forms

Preventing spam from our forms - validating all fields which go into the headers, removing \n and \r as suggested in
and then testing with

Saturday, February 03, 2007

Airport 4.2 for Windows

Airport 4.2 for Windows doesn't seem to work with the old (graphite?) Airport Base Station. After resetting the base station, ping to works, but the admin utility doesn't recognize the base station. Using the "Other" button and giving the ip + pwd => An error occurred... Error Code -6753

Edit: Apple's site says Airport Admin Utility 3.2 for Windows "does not work with the original AirPort Base Station (Graphite)."

and also confirmed by a compatibility chart.

Will try with the Mac @studio.

where does all the time go?

08.40 Seeing if there are urgent emails
08.50 Finding 2 tonne AC gone bad, starting CDs import
09.30 SGHM0156 has already been entered.
09.35 realized I don't need to import to db, since my db is out of date
09.40 directly deleting the "sent" files checking CDs.
10.10 shutdown - power failure at 10.
10.12 power returned, restarting everything.
10.25 finished deleting. Checking leftover files in "sent" folder...
10.35 found most of them in SGHM0149 in db
10.36 clearing some space in audio directory - no - all Telugu already deleted.
10.38 checking if all streams are on schedule - yes
10.45 checking the complaint about out of schedule stream
10.51 found it to be outdated. Finishing subscription mails.
11.00 adding "maxlength" to all fields in Subscribe.htm and Feedback.htm
11.50 lunch
12.30 googling form injection email spam asp code - TB says he'll try for an hour.
13.00 2 Telugu prg normalize
13.15 uploading them to playout servers from krishna
13.25 updating Description and annlink on saiwaves after importing to db
13.50 AC - condenser change may solve fan problem
13.50 address book additions to google address book
14.10 Cover story of H2h new issue
14.30 To Mandir for recording after tea.
18.00 @ studio installing XP Volume Licence key edition on Acer Laptop
18.30 Microsoft's key change tool does not work with Volume Licenses.
18.45 Running an "upgrade" install over existing install to get the VLKey in place.
19.45 searching for wifi driver on etc, not found
19.50 Acer's ftp site not responding
20.00 Installed wifi driver from Acer CD, trying to connect with Airport base station
21.00 Installed Airport for Windows from Apple site.
22.50 Various ip address/pw combos not working to configure Airport, will try tomorrow.

Wednesday, January 31, 2007

downloading windows media stream

I'd done this a long time back, just verified that it worked with the "latest" site too - using Ethereal, got the rtsp url, fed it to Net Transport.

Monday, January 29, 2007

update on X forwarding with Putty

Update to my previous post. Now the X forwarding jumping over two hosts is working, when I changed the "Remote X auth protocol" in Putty from XDM to MIT Magic Cookie.


Various miscellaneous jobs.

1. Processing Moments of Oneness - 8 episodes in one hour.

2. Installed Skype, Xming (X server) and Yahoo messenger on Windows because now onwards most of my time I'll be doing audio work. Installing Skype with the default options in the installer works ok, but changing the install folder to a different drive, for example, was causing skype to crash. Another problem is that saiwaves X apps don't work on Windows. Incorrect X authentication, it seems.
X11 connection rejected because of wrong authentication.
annlink: Fatal IO error: client killed

3. Writing backup CDs of various stuff and removing from HDD - wmv, SW, audio, etc.

4. AfriStar had some playout skipping at 0515 GMT - wonder why. BOC operators report some restarts over the last 2-3 days, too. 0530 changeover seemed to have solved the problem. Later, didn't connect - as suspected, the DHCP had changed the IP, waited for the next dns update at, and two minutes later, connected as usual.

5. Strange problem with Cool Edit Pro on saispace2 similar to earlier problem on dharma - saving wav files with some sort of header info so that the file appears to be a RIFF file to SF. Saving as au files as a workaround. Solution was to toggle on and off the setting Options -> Settings -> Data -> Auto-convert all data to 32-bit on opening restarting Cool Edit Pro after the change. Also changed Multitrack premixes at Options -> Settings -> Multitrack to 16-bit Premixes

Sunday, January 28, 2007

ssh problem resolved

I'd been unable to log into another account with ssh on krishna, using the method I'd mentioned before, RSA Auth. The problem was with directory permissions on the .ssh directory in that user's home directory - needs to be 700 - 600 is not enough. Changed, now it works.

Huawei SmartAX MT882 ADSL Router

Configuring the Huawei SmartAX MT882 ADSL Router is very similar to the earlier configuration steps I'd written for the MT 841 earlier. Until PPP is clicked in the WAN settings, the username/password boxes don't appear.

Flying Air Deccan

I've got some more posts backlogged. Will catch up in due course. Meanwhile, here's a howto on flying sans frills.

Check on their website and/or call-centre to verify that flight is on time, just before going to the airport. Go to the airport to arrive an hour before the flight. Check-in begins upto 2 hours before the flight, but since we're talking of a 70 seater ATR 72, the crowd is not much, and one can afford to be casual.

Walk into the departures lounge. The security guard may want to see your ticket since visitors are not allowed inside. Then he'll wave you through. If the check-in time has begun - can be seen from the flight status notice boards too - you can go to the Air Deccan counter and show your ticket to be issued the boarding pass. You'll need to check in extra luggage for baggage handling now. "Photo identification" is required now, but just a formality - xerox of PAN card etc should be fine. Probably won't even ask you. Even the CISF people for the security check were quite relaxed and smiling. Due to the small number of passengers, maybe.

Air Deccan ground staff seemed to take being on time seriously - they probably want to retain their statistics lead or whatever - so they were in quite a hurry to make up for the ten minutes delayed arrival of the flight. Walk out to the aircraft waiting just outside the terminus... or take a bus there if your airport is bigger.

Free seating - I've heard of people "rushing for seats" and so on, but none of that on this flight, since it was only half full. Leg room is of city bus variety, just like on Indian Airlines A320 last year, but the seats here recline only 2 inches. Anyway, it's only an hour in the plane, so it's all right. After all, can't expect to recline in a no-frills airline. No free food either, of course - not even toffees. The noise level inside was lower than the Airbus - the turbo-props are quieter. And the ride was quite smooth - no different from a large jet - may be different in bad weather, I suppose. But overall, the experience is OK for an hour's commute.

The air-hostesses came up with coffee for Rs. 20 and sandwiches for Rs. 40 and so on. Cookies for Rs. 10 were the hot items which "ran out" by the time they were half-way up the aisle. And the comments about air hostesses on Indian Airlines being more human than the rest are probably right - these ones, maybe because they were young and nervous, were finding it difficult to smile. And totally stumped by my question, "Is this a Dornier or an Avro?" (It was an ATR, of course). The Indian Airlines lady was quite confident of her reply, "26,000 feet" or something like that, for my question last year on how high we were flying.

Touchdown, walk out if you have no baggage to claim. At Bangalore airport, penny-pinching travellers like me can just walk out of the Airport, 10 minutes of brisk walking gets you to the bus stop where there are buses to the city centre ("Majestic") every 10 minutes or so.

An interesting footnote. In the plane, the airhostesses were hawking some wares, passing on some coupons which the passengers tick for buying some items. In the APSTRC bus, later, an enterprising pair of guys were carrying out an auction of various cloth material, shawls and so on, with free gifts of combs and so on to anyone who participates in the auction. I suspect the latter had more sales volumes.

Wednesday, January 17, 2007

war stories of migration

1. PB added a module to SGH.mdb named "ImportCSV"... it had a line "Am*.csv" - unfortunately this was somehow matching with not only AmerStream.csv, but also AsiaStream.csv and AfriStream.csv! This was causing AmeriStream schedule to have 114 items instead of 38, for example. Changing it to Amer*.csv solved the issue!

2. maillist and shoutstats have issues with PHP5. shoutstats updated to new version 0.8.4, solved issue of not displaying multiple servers. automailer.php is currently not taking the args supplied as a GET request. Current workaround is to supply the date by hard-coding in the php file by find-replace!

3. afristream dies when ameristream or asiastream changes playlist. Don't know why, current workaround is to run just after the changeover.

4. saiwaves audio directory has only 2 GB left. So, currently krishna's audio directory (which has 24 kbps files) is mounted with smbmount on saiwaves

5. radiosai.asp has some code-changes to reflect the three change-over times instead of a hard-coded single change-over time. The date calculation for the page displayed when visited for the first time has to be fine-tuned - if cookie exists, must take appropriate changeover time instead of the hard-coded one to calculate date.

6. running etc on saiwaves - not working initially, since SEQUENCES were not existing. PB manually created them with psql:
CREATE SEQUENCE file_id_fileid_seq  START 16279;
and so on.

Monday, January 15, 2007

certificate renewal

Got an email The certificate for localhost.oT5171 will expire in 27 days

Ran the latter prg as per email's recommendation
The certificate needs to be renewed; this can be done using the '/usr/bin/openssl' or the '/usr/lib/ssl/apache-mod_ssl/' programs supplied with Mandrakelinux.
Hope it worked, tho probably something more than just running that script is required.... like maybe copying and pasting the generated cert and so on.

Edit: Probably the last few lines of the tutorial here:

Was quite simple - the mail said that the file /etc/ssl/apache/server.crt was causing the error.

Ran '/usr/lib/ssl/apache-mod_ssl/'

This generated server.crt and server.key in pwd

mv server.crt /etc/ssl/apache/server.crt
mv server.key /etc/ssl/apache/server.key

service httpd restart

Sunday, January 14, 2007

Adding a new broadcast centre

1. Added code to scripts/ copy-pasting from orig code for other centres.

2. Created sub-folder in playlist folder, like

3. Created entry in broadcast_centers tables in sgh pgsql database.

That's it!

Then, of course, other things have to be updated - like the schedule page and playlist email subscription page on the website.

And then the php scripts for generating the csv files and automatically emailing the schedules. Ah! That's where the sphagetti code resides!

Mandir microphones

There are the products I believe are currently used in Mandir:

Swami's mic - ATM Gooseneck Model 857 - AT857QMLa

And most important, the Wind Shield (pop filter) for Swami's mic is the High Performance one from Shure - A99WS Microphone Windscreen.

The mic used at the Indoor Stadium was tied to the edge of the glass teapoy like structure used as Swami's podium - the Shure EasyFlex mics 18 inches.

Wednesday, January 10, 2007

Shoutcast server quirks

One of the methods suggested for starting Shoutcast server(s) automatically on Windows is to create a "Scheduled Task". But as far as my experiments go, this works only if
1. you have auto-login enabled
2. you are starting only one instance of shoutcast.

If not, then srvany is the way to go.

And another thing is the way Shoutcast handles "Backup file". It will play a looped file for currently connected listeners if the source drops connection. But:
1. the path to the file should not have spaces, you can't put quotes in the ini file either
2. a source must connect and then disconnect for this functionality to work.
3. the source cannot be a relay - it has to be a conventional source, and this shoutcast server must not be configured as a relay. the server can be a relay also - but....
4. new listeners will only get "Service Unavailable" - only those who connected before the source disconnected will get the loop.
5. enabling intro files does not modify this behaviour - new listeners will still get "Service Unavailable" if the source disconnects.

creating our own services in Windows

The method of using srvany to create our own services: with download link from here. But Microsoft site says this doesn't work for batch files. But the included srvany.wri file says
OPTIONAL: under the above key, create an 'AppParameters' value of type REG_SZ and specify the parameters for your app.
So that should solve our problem. It says on installing a service,
Make sure that you go into the Control Panel and use the Services applet to change the Account Name and Password that this newly installed service will use for its Security Context.
Default being Local System account. The default seems to be OK for us. But in the procedure given, one inconsistency found by trial and error: It does not matter if the filename given in 'Application' value has spaces in the path, no quotes are required. But if the 'AppParameters' has a path with spaces, it needs to be enclosed in quotes. AppDirectory behaves similarly, and also requires that it should NOT end with a \ - so, our value in AppDirectory should be "C:\Program Files\Shoutcast" - not "C:\Program Files\Shoutcast\".

Monday, January 08, 2007

pdfs on the Sony Reader

Some user-generated pdfs work fine on the Reader. No resizing, of course, but the page-turns are quick enough and links work fine. Example book Oliver Twist from Also another "Survey - The Brain from the Economist" which has some illustrations too. Transferred using PRSUtil (works fine after .NET framework was installed) and Connect reader SW - in both cases, the results were the same.

using the Reader without Connect software

I'm trying to add files (PDF and RTF) to the Sony Reader PRS500 without going through the Connect SW from Sony. User developed utils from mobileread forums.

PRSUtil - tried, but it says
The system cannot execute the specified program.
- Is it because .NET framework needs to be installed? Let me check.

libprs500 - Involved process:

Following the wiki, I've downloaded and installed the other items. Running
L:\Python25\scripts\easy_install libprs500 ran for a while, then stopped with

error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to

So I tried downloading the PyXML-0.8.4 tar.gz manually, went into the directory, ran install -c


No, that's not right, it error: option -c not recognized

Then tried build -c mingw32

This time it said error: command 'gcc' failed: No such file or directory

So I checked in the mingw32 bin directory (which was installed with QT).

Added L:\MinGW\bin to the PATH by going to Control Panel -> System -> Advanced -> Environment Variables

RESTARTED the system (or else path is not updated) and then tried build -c mingw32

OK, worked.

Then install - still gave the same error of VS2003 not found. Oh, it's trying to build it again. So,

checked --help - install has options --skip-build as well as --no-compile. Aha! Did install --skip-build


Ran L:\Python25\scripts\easy_install libprs500

This time it gave

error: Couldn't find a setup script in c:\docume~1\sgh\locals~1\temp\easy_install-vvkkzb\

This is in spite of having already copied the contents of this zip file to the site-packages directory before the install. Probably because this compiled version is for Python2.4.


running prs500 info gave

Traceback (most recent call last):
File "L:\Python25\Scripts\", line 5, in
from pkg_resources import load_entry_point
File "l:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\", line 2479, in
File "l:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\", line 585, in require
File "l:\python25\lib\site-packages\setuptools-0.6c3-py2.5.egg\", line 483, in resolve
pkg_resources.DistributionNotFound: pyusb>=0.3.5

OK, now try to compile pyusb from source. Downloaded from sourceforge - but this just had the same 80 kB usb.pyd which I already have in site-packages! So, checked the mentioned above, the path itself doesn't exist, because the setuptools-0.6c3-py2.5.egg is a binary file, so no wordpad editing possible. So I'm stuck.