Wednesday, September 28, 2011

enabling NTP on our servers

While checking bounce processing, found that krishna's time was off by five minutes. Installed ntp as given here,
sudo apt-get install ntp

I guessed that the firewall might cause problems, and sure enough, checking the status with
ntpq -p
found that the peer was not being contacted, the reach was 0. Added a firewall rule for NTP for the DMZ, and all was well.

krishna bounce processing again

Nowadays I keep checking krishna's bounce processing by seeing the phplist messages page - if messages don't show bounces, that means the bounce processing has stopped. And most of the time it is cured by a simple flush of the mbox as given here. Today had to do a flush, after the day of that post - five months.

Monday, September 26, 2011

creating DiscourseStream schedule

Guest post from PB about creating DiscourseStream on schedule page:

Steps:

1. Added new BC Broadcast Center Name: DiscourseStream Bcid: 9

2. Modified the changeover time from 5:00AM to 7:00AM to avoid import issues for the schedule database

3. Modified Playlist import script for Discourse Stream and commented out Asiastar

4. Added SIGNATURE_TUNE to the beginning of playlist files that were already created.

5. Modified the cron for changeover in the remote server from 5:00AM to 7:00AM

6. Added two hrs of DD to today's playlist so that the changeover takes place tomorrow without a break and reuploaded.

7. Modified the csv script to generate csv for Discourse stream

8. Skipped the instrumentals being listed in the csv for DD

9. Modified the schedule database for discourse stream to have the changeover @ 1:30 GMT (7:00 am IST)

10. Added a single program item to start the 27th csv import (NOTE: It can be done only through IE)

11. Uploaded the csv for 27th Sep 2011

12. Modified the DD making script to add signature tune in the beginning of the playlist.

Monday, September 19, 2011

fixing problems with Listen Now page and IE

Newer versions of IE were not displaying the "Listen Now" page with the jplayer audio player. Found that the page was loading when "compatibility mode was turned on - the broken page icon on the right side of the addressbar.

Looking into the code, found a possible culprit in the Twitter embed code. It just said



in the body, put



in the head of the document.

And all was well again with IE.

Saturday, September 17, 2011

more about the iphone and farewell to it as well

Following up on my previous post, finally got it to do almost everything using a combination of tools. Almost everything, except one of my essentials - call recording. It seems to be impossible to do call recording on the iPhone without third party services calling out to their server due to hardware level limitations imposed by Apple. And apparently Android is also the same. So, I'll have to stick to my old Windows Mobile 5 phone!

Coming back to this iphone, installed the following from iTunes on the PC:


Battery Magic - uninstalled due to a startup screen which could not be removed due to non-working touchscreen portion

Planets

Compass Free - uninstalled as the iPhone 1st gen doesn't have GPS

Remote Desktop Lite

GPS Tracker  - uninstalled as the iPhone 1st gen doesn't have GPS

Battery LED!

Teamviewer

APPZILLA

EasyWriter

iTalk Recorder - uninstalled as phone call recording needs paid service.

Got Veency in Cydia installed through iSpirit which was mentioned at this forum page. Then onwards it was fairly straightforward to do anything on the phone, since the VNC client could click even in the places where the touchscreen wasn't working. Mobile Terminal was one of the nice apps loaded through Cydia.

Saturday, September 10, 2011

working around a broken iphone

Got a used iphone for Rs. 4k - reason it was going cheap was that part of the touch-screen was not responsive. This happened to be the part just above the lowest line. So, the Call soft-button in the phone keypad does not work! And so on.

Trying to get ebooks into it. SSH not working - probably not installed, though Cydia is present. Trying to install SSH gave an error message in Cydia about being unable to download files - probably an old repository. But cannot click on the OK button for the message. That was in the bad portion, and landscape mode is not available for that screen.

Tried to use the Kindle app - it needs registration, and in portrait mode, which does not work with the keypad. I did not try copy-pasting the username and pw - that might have worked. But anyway, went on to try iBooks. Unfortunately iBooks needs iOS 3.2 and higher, and this is a 1st gen iPhone with iOS 3.1.3. Then tried Stanza, that one works.

Transferring files to Stanza - all the methods seem to need Stanza to pop up a confirmation dialog asking if I want to download - and the Download confirmation button comes up in the non-working part of the screen! Finally got books to transfer using iPhone Explorer.

Tuesday, September 06, 2011

DD-WRT and Dlink DIR615 revE4

As mentioned in an earlier post, tried out DD-WRT on the Dlink DIR615. What we got was hardware version E4.

Quite simple procedure as given at the dd-wrt wiki. Ours was E4 and not E3. Read somewhere on the forums that changing the last number from 0 to 1 in the E3 firmware with a hex editor makes it work with E4. Tried that, it works. Did the Hex editing of the firmware using Free Hex editor Neo on Windows.  The firmware labelled as E4 in the dd-wrt site has 5 as the last digit - that apparently makes it not compatible with our E4 version.

But plugging it in our network, it didn't work. At first I thought it might be a MAC address caching issue, and tried cloning the old router's MAC address. That also did not work. Then did some tests and found that it was just not routing - logging into the router, ping works in both directions LAN and WAN. But the LAN can't ping the WAN and vice-versa.

Tried posting on the dd-wrt forums, here and here, but finally did not get any solution. Assuming that some hardware limitation prevents it from working as a router without NAT. And the google answers page recommended routers seem to be scarce. The Linksys WRT54G is superseded by the WRT54GH which doesn't support routing mode, for example.

Sunday, August 28, 2011

access to audio files from macs at Studio

With MacOSX, the audio directory windows share was not accessible. Reason seems to be the large number of files - seems to get stuck. Workaround - connecting with sftp using Filezilla.


In order to connect, have to import a key as given at this page from FileZilla -> Preferences -> Connection -> SFTP

In order to navigate hidden folders like .ssh in File -> Open dialog box, as given  here
press Shift + Command + Period

Saturday, August 27, 2011

burning cds on the mac

Copied some CDs on the Mac using the procedure at

Create an image using Disc Utility, (make a read-only image to make it faster) then burn the image. This method does not work for audio CDs and protected DVDs.

Friday, August 26, 2011

router failure and fail-over

Last night, power failure and UPS draining caused the servers and routers to go down. The Dlink DFL-210 router did not come back up after power returned. This morning, replaced it with a Linksys WRT54GS - cost around Rs. 3,500

The router which failed yesterday - DLINK DFL-210 - cost around Rs. 22,000

Both these models are no longer available. DFL-260 is a possible replacement, PB checking Indian market cost found it to be around Rs. 50,000.

According to posts on this page, newer routers don't have the built-in static routing which we need, dd-wrt is a possibility.

So, we're planning to try out Dlink DIR-615 and are going to try and load dd-wrt on it.

Wednesday, August 24, 2011

live video streaming test

Running Adobe Flash media encoder and C++ RTMP server locally for running tests.


First downloaded Wowza server with a free developer license and tested after installing it with the documentation given at wowza forums.

Then tested by copying the same html file mentioned above to another system.

Then tried stopping Wowza and starting the C++ RTMP server. It asked for a username and pw for the encoder to connect, found that it was located in users.lua
Entered suitable values and the encoder connected without problems. Next, tried on the other system with the same test file supplied with Wowza, and it worked.

Next step was an flv player embedded in the website.

Downloaded JWPlayer's latest version, first tried the quick-start method given in the downloaded pdf. That did not work. Reason was wrong path. Even giving full path did not work, since our server was configured not to serve .mp4 - it gave access denied. Anyway, the player was coming up embedded on the page.

Next, followed the docs at
http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12535/video-delivery-rtmp-streaming

With streamer address given as a private ip address 192.168.2.2, it did not work. Configured the router to use a virtual server at the Macbook, port 1935 for rtmp, and it worked with the public ip - used the domain name, actually.

Later, tried out the private ip address also - that also worked. The player on the remote server does not need to contact the streamer directly. Only the client needs to contact the streamer. The first time the private ip address did not work was because of other issues with embedding the player - the player itself was not appearing.

Monday, August 22, 2011

automatic email scripts

Removed the radiosai gmail id from the following scripts which were sending automatic emails:

On saiwaves :
playlist_import.sh
lame*sh


On colinux :
test_playlist_sgh_africa.sh
test_playlist_sgh_america.sh
test_playlist_sgh_asia.sh
test_playlist_sgh_discourse.sh
test_playlist_sgh_bhajan.sh

Thursday, August 18, 2011

problem with ftp upload using php ftp_connect

The php script to upload csv files automatically had not worked for a while. Checking it out:

This page says that with some firewalls you should connect to the firewall and then connect to the host etc. Tried that, doesn't work.

I suspect that the problem is with the way in which php handles ftp commands. When a put command is sent on our system, cyberoam responds saying delayed due to scanning, and then uploads.

STOR /httpdocs/program/csv/AmeriStream20110818.csv
150-Scanning file for viruses
150-There'll be a delay while we scan for viruses
150 Data connection already open; Transfer starting.
221-Scanning for virus
221 Transfer complete.

I think php's ftp library does not handle the ftp 150 commands, hence it fails.

I have currently commented out the ftp upload part in the mkcsv php script.

ERROR: duplicate key value

PB being out of action, making playlists and doing Telugu database work etc. So, while importing Telugu files, came across
ERROR: duplicate key value violates unique constraint "download_filename_file_id_ukey"

This causes some files not to be entered into database, so when importing playlist, it complains that some fids are NULL

Solution was to import files one by one till the offending file was found - a file which had the same name as an existing file, but with space in the filename replaced with underscore. Removed the old entry from database - rather, changed space to underscore for its filename.

Wednesday, August 17, 2011

setting up vnc

While setting up vnc for doing the Telugu files on the telugubc server, found that it was installed but not running. Using the same script as on saiwaves did the trick, only thing was that it needed vncpasswd to be run before running the script to start vnc, so that we set the password to something we know. And editing .vnc/xstartup is required if you want kde - I changed the default twm window manager to kde. Last line becomes startkde & instead of twm &

Tuesday, August 16, 2011

procedure for telugu broadcasts

1. Go to ~/new_telugu and copy mp3 files from relevant folder to ~/ftpsent

2. Copy relevant m3u file to ~/playlist directory.

3. cd to playlist directory and run the sed script modifying the commmandline to relevant date, which converts the extended m3u to simple m3u and appends the audio directory path.

4. run ~/scr*/lame_encoder2422.sh

5. Open playlist from step 2 in kwrite and change / to \, save as m3u

6. Open the m3u playlist in Winamp after lame finishes, to check that all files are present - total duration should be 24 hours and a bit, and it should not show a + symbol after the total duration.

If playlist generation is desired, additional steps:

7. Run scr*/main_ftp.sh which takes files from ~/ftp folder

8. upload files from ~/ftp folder to dl.radiosai.org

9. Run scr*/playlist_import.sh

10. Update missing descriptions from localhost/SGHDescription as with sgh database, if necessary copy-pasting from sgh database

11. Make csv and upload from localhost/mkcsv


bug in our playlist import script

Faced the same problem as given in this earlier post, with the schedule csv/email creating script complaining that SIGNATURE TUNE not found, "PROGRAM NOT FINALISED". The solution is to just search for entries in the playlist table where timestamp is 2011-08-16 06:30:00+05:30 (or whatever date). This can occur at midnight also - as PB pointed out, a bug in the script changes a timestamp of 2011-08-16 00:00:00+05:30
to 2011-08-16 06:30:00+05:30 during the import process. So, verify if the correct timestamp should be 00:00:00+05:30 and then edit the entry manually from 06:30:00+05:30 to 00:00:00+05:30 .

The point to be noted is that the problematic entry may not be adjacent to the actual 06:30 signature tune file, it could be at midnight also.

Saturday, August 06, 2011

updating MBV download filenames

The MBV files were imported into Telugu stream database without suitably modifying the download filenames. This caused quite a bit of confusion. PB contributed the following post :

Steps done for rectification:

1. In sgh database on saiwaves run the following query:

select 'UPDATE file_id SET download_filename=' || '"' ||download_filename|| '"' || ' WHERE filename="' || filename || '"' from file_id where filename ilike 'MBV%' \t \o update_mandirbhajans.sql ;

First row of the result set looks like:

UPDATE file_id SET download_filename="MBV_04_RAMA_OM_SRI_RAM.mp3" WHERE filename="MBV_04_SUJITH_RAMA_OM SRI RAM.mp3"

2. Save the result set to a file update_mandirbhajans.sql

3. Replace double quotes with single quotes in update_mandirbhajans.sql

4. In sghtelugu database on saiwaves execute the saved update_mandirbhajans.sql (through phpPgAdmin interface)

5. upload the updated csv files / run the update sql statements on the schedule database through the cpanel

Friday, August 05, 2011

stellarium night sky on our mirrordome

Trying out Stellarium's Mirrordome distortion mode. On the laptop I use, Stellarium cannot use the full screen when in dual-screen mode with different resolutions on each screen, and also refuses overlays like the toolbars on the secondary screen. So, used the Dual-screen clone mode with both displays set to 1280x800. With the default settings, the stars don't look so good on our dome, but some tweaks make the stars look better.

View Settings Window -> Sky tab -> Absolute scale = 2 makes everything bigger and hence brighter, and Relative scale = 0.2 or so makes the stars uniform in size instead of brighter stars being as big as oranges! This makes the night sky much better to look at, more like a "starball" effect.

viewing panoramas on fulldome - simple technique

To make a panorama viewable on the fulldome, tried the following method as given at this page as a shortcut instead of going through Blender or buying commercial software. At the bottom of this page, the type of fulldome image we need is shown. Basic method is simple - make the pan into a square image by resizing, then convert to polar co-ords. In Photoshop it is Filter -> Distort -> Polar Co-ordinates and in the Gimp it is Filters -> Distorts -> Polar Co-ordinates. This produces a fulldome master which I can later distort with tgawarper for display on our dome.

When I tried it with a pan of the SSSIHMS, a hi-res version of this picture, found that it looks squished on the dome - need original to be more squarish? Also, building is too far above the horizon. Need more sky and less ground. So, probably the solution would be to take a pan with the interesting parts near the bottom edge of the pic, and clone the sky to make it square instead of distorting it by simply resizing.