Wednesday, May 31, 2006

dynamics processing is different

Dynamics processing in Sound Forge sounds different from the filter present in Cool Edit Pro. For long I've stayed with a particular setting:

But putting the same settings in SF doesn't give the same results - the waveform is more flattened, and sounds more squashed, too. Preliminary tweaking with attack and release times didn't help. SF version is pretty old - 4.5. For that matter, the Cool Edit Pro 1.1 is old too - latest is Adobe Audition 2.

made shoutstats work again

After the upgrade on krishna, shoutstats was not updating the graphs. I'd suspected all along it was because rrdtool was not installed. Yesterday wanted to kill some time, so poked around krishna, found only librrdtool was installed, rrdtool itself was not, and was not available in the CD repository. rpmfind.net is your friend. Added the relevant ftp site there, and hey presto. (This skips the hour or so of dependency hell trying to download each package individually, not knowing what package contains the dependency (RRDp) - it was perl-rrdtool - and so on. Also took an hour to download the filelist from the slow rpmfind.net ftp site.)

Then I'd to go into the update.php and index.php and remove the hardcoded paths to rrdtool - probably added by us on the old krishna. Once that was done, working fine.

Tuesday, May 30, 2006

highlight announcements timings rounding off

Modified our bash shell script to round off the highlight announcements timings to 15 minute intervals:

MINUTES=`echo "scale=1; ($MINUTES/15)" | bc -l`
MINUTES=$(printf "%2.0f" $MINUTES)
MINUTES=`echo "scale=0; ($MINUTES*15)" | bc -l`

if [ "$MINUTES" = "60" ]
then
HOURS=`echo "scale=0; ($HOURS+1)" | bc -l`
MINUTES=00
fi

if [ "$HOURS" = "24" ]
then
HOURS=00
fi

MINUTES=$(printf "%02d" $MINUTES)
HOURS=$(printf "%02d" $HOURS)
#this gets them the leading zeros

Earlier code was

MINUTES=`printf %02d $(echo "scale=0; ($MINUTES/5)*5" | bc -l)`

This only rounds DOWN to the nearest multiple of 5.
Never rounds up correctly.
(Edit for the leading zeros code: 1st June)

Monday, May 29, 2006

validated feeds - finally!

Finally got the podcast feeds right, got them validated with feedvalidator.org

podcast php coding

Worked a bit more towards the podcast. Generating html from php code running locally.

It took nearly 4 hours to debug the http HEAD in php to get the filesizes - the library from http://lwest.free.fr/doc/php/lib/net_http_client-en.html
had a bug in that the HEAD function was also calling a ProcessBody function: since the HEAD did not return a body, the ProcessBody was waiting till the socket timed out or something like that, 150 seconds for each successful call! Also, the Debug variable needed some tweaking.

Later, the xml had a few bugs to iron out - <itunes:category> had to be one of the pre-defined ones, guid couldn't be repeated, publish date was not RFC 822 compliant, had to do string replace for space characters to %20...

Friday, May 26, 2006

added Panasonic dvsd codec

Downloaded the free Panasonic dvsd VFW codec so that VirtualDub can work with video captured with Microsoft Windows MovieMaker. The filter chain needs deinterlace first...

Saturday, May 20, 2006

underscore not allowed in hostname with squid

Well, the title says it all. A URL with underscores in the hostname part works with a "direct connection", but not through squid.

Workaround: Escape codes are given in places like this - http://www.dragonwinds.com/resources/html-codes.shtml are not enough - they are meant for the HTML.

http://www.squid-cache.org/mail-archive/squid-users/200208/0565.html
has a discussion on it and says that you need to recompile squid for it to work with underscores.

MX records not being served by ADSL router

We were not getting our automated mails from Jo'burg playout server after going on the ADSL line: earlier it was on their LAN.

Found lots of hostname not found errors in /var/log/maillog

host -t MX gmail.com was not returning anything, while
host -A MX gmail.com was working.

cat /etc/resolve.conf gave

nameserver 192.168.1.1
search localdomain

So the ADSL router was specifically blocking -t MX! Added a working dns server, BSNL's nameserver 61.1.96.69, after checking
host -t MX gmail.com 61.1.96.69 was working fine.

After /sbin/service network restart
when I did
cat /etc/resolve.conf

I again found it had gone back to
nameserver 192.168.1.1
search localdomain

Found this by googling 'resolv.conf updated from network restart':
http://linux.cudeso.be/linuxdoc/tweaky_net.php
saying
When you are connecting to a network that's using a DHCP-server, it's possible
that the settings you have placed in /etc/resolv.conf are overwritten
everytime you receive a DHCP-lease. You can prevent this by adding the
following line to /etc/sysconfig/network-scripts/ifcfg-eth0
PEERDNS=no

So I added that, then did
/sbin/service network restart

Then cat /etc/resolv.conf gave
search localdomain
nameserver
nameserver

and
host -t MX gmail.com gave
gmail.com mail is handled by 10 alt1.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 10 alt2.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 50 gsmtp163.google.com.
gmail.com mail is handled by 50 gsmtp183.google.com.
gmail.com mail is handled by 5 gmail-smtp-in.l.google.com.

So now seems good. And I got a test mail too.

Friday, May 19, 2006

recovering from partial uploads and MD5

At least on our Jo'burg playout server, where bandwidth is scarce and http outgoing is allowed:

wget -c http://krishna.radiosai.org/filename

And later verify the MD5 hashes with

openssl dgst -md5 filename

Thursday, May 18, 2006

known bugs in our database scripts

1. If first few letters of previous item are the same, and if both items are of the same category, second item will not be listed in the schedule.

Fix - change the comparison code... TBD

2. If previous day's playlist has an item at exactly $CHANGE_OVER_TIME , schedule generation php page will complain "SIGNATURE TUNE NOT FOUND"

Fix - manually change the time of the offending item by one second...

3. Sarva dharma bhajan handling - schedule shows two listings, one with zero duration, esp for Prasanthi Mandir bhajans.

Fix - ??

Wednesday, May 17, 2006

Acer Travelmate 242x - getting sound to work on Linux

Just followed the instructions given by the Troubleshoot button in drakconf's 'Hardware' section:

lspcidrake -v | fgrep AUDIO for which driver is used by default:
it was i810_audio

changed to that driver.

found aumix was not installed. Installed it.

Found alsa was not running in runlevel 5. Made it run in drakconf 'Services'.

Restarted machine, opened kmix, made sure sound not muted and put to 50% volume, working fine.

Linux on Acer Travelmate 2423NWXCi - 242x probably

Current complaints with the default install of Mandrake 10:

1. Touchpad needs clicking on the buttons for left and double click - click and double-click on the touchpad itself doesn't work.

2. No sound.

3. No battery meter, other power control stuff.

LAN works, Wireless LAN and WinModem may not, but I'm currently not using them.

Tuesday, May 16, 2006

audio on demand

Implementing audio on demand or podcasting - made a template page by hand - PB is now on the job to generate the page from our local SGH database with php...

Monday, May 15, 2006

dynamic dns

In addition to the usual work of making playlists, recording from MD etc, today C from WS rang up - configuring the playout server to use an ADSL line with dynamic IP.

Using a free domain from changeip.com, wrote a one line script to do the dns updates:


wget "https://www.changeip.com/update.asp?u=$USERNAME&p=$PASSWORD&cmd=update&set=1&offline=0"


Using http didn't work - it was being set to the ISP's proxy IP. Thankfully https worked. Put it in the cron to run hourly.

Thursday, May 11, 2006

quick and dirty DVD writing

found that there was NeroVision Express already on my system, using which I could drag and drop some 640 x 480 mpg files from dig cam and make a DVD....

AVICodec

Used Avicodec from http://avicodec.duby.info on BKM's recommendation - quite good, supports a wide variety of formats, gives info about the file + codec used + resolution etc

Tuesday, May 09, 2006

adventures with fsck

Copying files with "Roxio Restore" on XP - system hangs if any other app tries to access DVD drive. And left a corrupted file on /dev/hda1 - /mnt/WinF, ext3.

On boot in Linux, "check forced" "try manual fsck" at some point, and it was taking a looooong time - thought it hung. So, booted with Mandrake CD1, "rescue" at boot prompt, got a shell, mounted the root partition, edited /etc/fstab to comment out mounting /dev/hda1, deleted the corrupted files, booted normally. Then man fsck, gave

fsck -t ext3 /dev/hda1

The filesytem still had errors.

Corrected the errors when it asked, finished in around 15 minutes or less. Phew!

experiments with download service

On May 4th, did some experiments with download service - asp pages which will pop up download dialogs and cloak the actual filenames instead of directly serving the mp3 file with an http request. Also, capable of serving up multiple files by popping up multiple dialogs! Based on the ASP101 script at http://www.asp101.com/articles/jason/filedownloadlist/default.asp

Have to think of how much to automate - asp pages being generated by php querying our local database - how much to leave manual...

The dark side of google

Some of the disadvantages of Google Adsense - a bad experience narrated at http://business.timesonline.co.uk/article/0,,13129-2123601,00.html

Monday, May 08, 2006

link checking sw

Tried out various link checking sw for finding broken links quickly and easily.

http://www.dead-links.com/ was using HTTP HEAD , so was getting FORBIDDEN responses for most of our htm pages - issue with IIS not giving 200 response for anything other than .asp or .html or something like that....


http://validator.w3.org/checklink
had the same problem.

JCheckLinks - I couldn't get it to work due to my lack of Java app installing experience.

Linklint - appeared too complex!

http://www.unixdaemon.net/delicious_checker.html - meant for Del.icio.us links specifically, and needs certain PERL modules....

Finally ended up using Xenu's Link Sleuth - relatively fast and uncluttered, on Windows (Sathya). Of course, radiosai.org has more broken links in PA and Journals which I have no intention to correct now, so have to choose preferences carefully...

PB's contrib - Phplist auto date subject and message

Added date placeholder in subject /admin/sendemaillib

$cached[$messageid]["subject"] = $message["subject"];
if($cached[$messageid]["subject"]== "(no subject)")
{
$system_date_now = date("dS F Y");
$cached[$messageid]["subject"] = "Sai Inspires - " .
$system_date_now ." from Prashanti Nilayam";
}

Now, though the mail is created and sent as "no subject", the users get the mail with subject Sai Inspires - 04th May 2006 from Prashanti Nilayam and so on.

Update on Date: 21/05/2006 8:38 am:
Changed the date placeholder in subject and message ( in file
/admin/sendemaillib)

Replaced the function date("dS F Y") with date("jS F Y")

d Day of the month, 2 digits with leading zeros01 to 31
jDay of the month without leading zeros1 to 31
Replaced the format output from
Sai Inspires - 07th May 2006 from Prashanti Nilayam
to
Sai Inspires - 7th May 2006 from Prashanti Nilayam

PB's contrib - making processqueue cron work

Did the following to set the cron to work for phplist processqueue...

To check the error messages in cron piped the message to log.txt
31 17 * * * /home/apachemails/phplist -pprocessqueue > log.txt

Got the following message:
[apachemails@krishna ~]$ cat log.txt
PHPlist version 2.10.2 (c) 2000-2006 Tincan Ltd, http://www.phplist.com

Error: USER environment variable is not defined, cannot do access check.
Please make sure USER is defined.

>From google got the following solution:
http://www.tequilafish.com/2005/11/17/phplist-with-crontab-user-environment-variable-is-not-defined/

This happens because when a crontab executes, the *$USER* variable is not
set. We must set it in our script. So open up the phplist file and add the
following:
USER=youusername
export USER

The entire file should now look like this:
CONFIG=/path/to/phplist/config/config.php
export CONFIG

USER=yourusername
export USER

/path/to/php /home/yourusername/path/to/phplist/admin/index.php $*

Note that you also must set the *$commandline_users* variable in your *
config/config.php*:
$commandline_users = array("yourusername");

With all of that in place, you can automate your queue and bounce processing
with a crontab like this (adjust your paths accordingly):
# Suppress crontab emails
MAILTO=""

# Process phplist queue daily, every half hour
0,30 * * * * /home/yourusername/phplist -pprocessqueue

# Process phplist bounces once a day, 5am
0 5 * * * /home/yourusername/phplist -pprocessbounces
In our case:
USER=apachemails
export USER

now the cron works fine :)

Wednesday, May 03, 2006

out of station!

All these days I was out of station, so no posts for a month! Anyway now I'll start with PB's description of how he got PhpList working.... after finishing more urgent work.