Saturday, January 30, 2016

SGH database update for MBV files

Guest post from PB.

After the local server hdd crash in Nov 2015
​,​
 we had lost the sghtelugu file_id records. On re-importing the files into the database, I missed out the info that the mbv files had a different download filename
.

Due to this sghtelugu database and sgh database had different download filenames causing end
​-user download issues.

Did the following.
​...​


1. Tried to create a soft link in dl.radiosai.org expecting that http download link would automatically get redirected to the  softlink. But this did not work. It downloaded the file without the modification.

2. The only way is to update the records 
​both sghtelugu and the schedule page database (radiosai)

a. Created a SQL query that would give me the update SQL statements :

psql -d internal_db -A -F ',' -t  -c "SELECT 'UPDATE our_primary_key SET download_filename = \'' || download_filename || '\' WHERE filename = \'' || filename ||'\';' FROM our_primary_key WHERE filename <> download_filename AND filename ILIKE '%mbv%' " -o /home/sgh/update.sql

​This sql statement searches for all the MBV files where the filename is not matching the download filename in our internal database and forms a update sql list. 


UPDATE file_id SET download_filename = 'MBV_2003_08_MODIFIED.mp3' WHERE filename = 'MBV_2003_08_UNMODIFIED.mp3';
UPDATE file_id SET download_filename = .... etc 

about 1358 records

b. Executed this set of update queries on sghtelugu database. This step cleans up the local sghtelugu database

c.​
​ Then modified the update.sql file by using find-replace the database table name and column names like

UPDATE web_db_table_name SET dfileName = 'MBV_04_MODIFIED.mp3' WHERE fileName = 'MBV_04_UNMODIFIED.mp3';
etc

d. Logged into our website Plesk and then to phpMyAdmin database and executed the modified update queries.

Friday, January 15, 2016

Shoutstats update

After our internal server upgrade, Shoutstats stopped working. P did some digging and found that not only were rrdtool and php5-rrd not installed, but with the later versions of PHP, the short tags

Monday, January 11, 2016

quick review of Netflix India

A very quick review of Netflix's India offering, comparing it with the choices for Netflix streaming in the USA.

  1. The selections are very different, of course. For example, the Indian selection does not have "Who framed Roger Rabbit", many of the genres in http://ogres-crypt.com/public/NetFlix-Streaming-Genres.html are just missing in the Indian version. (link removed when Blogger unpublished this post)
  2. There are around fifty Indian movies (only) - youtube's selection is much wider for Hindi movies.
  3. Ditto for documentaries, eg. BBC documentaries. 
  4. If you want to switch countries using a VPN like PureVPN, you can't use Firefox's Private Mode - Netflix doesn't work well with Private Mode. (link to quora page removed when Blogger unpublished this post - https://www.quora.com/Why-doesnt-Netflix-allow-you-to-watch-movies-with-Chromes-incognito-mode ) You have to clear the website preferences using History -> Clear Recent History -> Time Range to Clear -> Everything -> Details -> Cookies, Cache and Site preferences (for Firefox). 
Edit: 15 Jan.
As of now, if you connect to a US VPN, you can access all the US titles even if your Netflix account is from India. 

This page (link removed when Blogger unpublished this post - http://www.finder.com/in/netflix-india-vs-netflix-us-titles-list ) has a comparison of titles available in India vs US - two and a half pages of titles available in India, eighteen pages of titles available in USA with maybe a page or so available in India but not available in the USA. 

Edit: 7th Nov 2022 - Blogger unpublished this post saying it violates community guidelines. Removing links and asking for a review. In what way does this violate community guidelines, I wonder.  

Wednesday, January 06, 2016

Chrome not loading https pages

Related to my earlier post, I found that Chrome on XP was not loading the https pages. Apparently this is related to XP reaching end of life and not supporting the latest ECC in https, as mentioned in the last post at the page
https://code.google.com/p/chromium/issues/detail?id=451311

So, for loading the https pages with this issue on Windows XP, the workaround is to use the latest Firefox.

CSS loading issue

A Tomcat page, loading from port 8443 using https, had the issue that the first time it loads, all formatting was lost - CSS was not loaded. A page refresh would load the CSS.

My diagnosis was that the relative url to the CSS was being interpreted by the browser as a call to http and not https:8443, and was failing the first time. This turned out to be correct, since giving the full path to the CSS file, like
href=https://servername.com:8443/path/to/file.css
instead of
href=../file.css
(with quotes for the links, of course) solved the problem.

Saturday, December 12, 2015

Hostgator dedicated server self-signed certificates

The self-signed certificates on a Hostgator dedicated server were nearing expiry, and notification emails like 'The SSL certificate for xxx on yyy.com will expire in less than 30 days' were starting to appear.

After going through domain verification on chat, found that they don't do SSL install support on live support.

Then, followed the WHM link given in the notification email sent by cPanel,
You need to install a new certificate as soon as possible. You can do this with WHM's Manage Service SSL Certificates interface at
https://yyy.com:2087/scripts2/manageservicecrts.

There was a button for 'Reset certificate' - just clicked that, and the self signed certificate was renewed for a year.

Sunday, November 29, 2015

sftp changes in batch mode

We have been using sftp in our scripts for uploads to servers etc and had configured automated emails listing the names of files uploaded. After a server upgrade to Ubuntu 14.04, the sftp emails did not display the filenames. After poking around a bit with -v etc, P found the solution:
Modified the scripts from
sftp -b  /path/to/putaudiofilesdl user@server.name.com 2>&1 |tee -a $MAIL_FILE
to
script -q -c 'sftp -b  /path/to/putaudiofilesdl user@server.name.com' |tee -a $MAIL_FILE
and later
cat $MAIL_FILE |tr '\r' '\n'| grep -v 'ETA' | grep -v 'sftp>' | grep -v 'Progress meter enabled' | sed -e /^$/d | sed 's/\/path\/backwards\/of file\///g' | sed 's/100%.*$//g' > /path/tmp/test.txt

and in the file putaudiofilesdl, adde the keyword
progress
before the put command, to enable the progress meter. 

This needs the terminal window to be wide enough to contain both the filename and the progress meter, or else the filename gets truncated. So I modified my Putty saved session - changed number of columns under the Window setting to 180. Then when the script is run with screen, the emails are as desired, with the filenames. 

Saturday, November 28, 2015

locale issues with ssh login from Mac

P reported this problem and solution - he uses a Mac to log on to our Linux servers.

Some commands are failing on ssh login and vnc login

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

They work with local login.
Changing the preferences of the Terminal solved the issue of ssh.

Sunday, November 15, 2015

firefox html5 not showing HD options

While checking out the radiosai live stream videos, found that firefox is not offering the HD options. Found that this is a common complaint. The solution seems to be to use an addon to force the flash player on firefox. Now the 720p option is available.

Thursday, November 12, 2015

using RichCopy to backup files

Used RichCopy to backup files to an external hard disk. Has the filters I need - copy if size is different, etc. This blog post is also illuminating - RoboCopy vs RichCopy vs SyncBack vs EMCopy vs XXCopy vs XCopy vs KillCopy.

Wednesday, October 14, 2015

shortcut for working with multi-language audio and channel configuration

When working with WAV to AC3 encoder, we can drag and drop files into the window instead of clicking on the MUX Wizard button and choosing the respective channels. WAV to AC3 encoder needs 48 k 16 bit mono wav files in the default configuration, and the file order is
L
R
C
SL
SR

This is also the order in which the MUX files are saved from within the MUX Wizard.

Our channel configuration order is
FL - speakers
FR - Hindi
C - Telugu
SL - English
SR - Malayalam / Tamil
SW - Not used / Kannada

Monday, September 21, 2015

google spreadsheets firefox issue

I had an irritating issue of google spreadsheets showing screen corruption when any cell was clicked. This issue started after the sheets update in which they introduced the "Explore" button on the bottom right.



One workaround is to click on the small downward arrow to the right of the column headers A, B, C, D etc. When the column menu comes up and we dismiss it by clicking again on the column header, the sheet seems to get cleaned up. But only temporarily. Waiting for Firefox or Sheets to get this fixed. 

Edit: 6 Jan 2016 - this seems to be fixed now.

Thursday, August 20, 2015

resizing matrices in Matlab

In my previous post, I'd mentioned processing 2-D matrices to put them into relevant rows and columns instead of just 5 numbers per line. This rearrangement of matrix elements uses the reshape function. In our case,
A_rz=reshape(A_rz',1,numel(A_rz));
A_rz=reshape(A_rz,30,30);
A_rz=A_rz';

using MCML - Monte Carlo light transport in multi-layered scattering media

is referenced in Wang and Wu's Biomedical Optics. Some points I noted for its usage are given below, in addition to the documentation available in the book as well as the included paper in the download.

  • I used Fabrice Bellard's Tiny C compiler to re-compile the code on Windows. It's only a 386 kB standalone download, as against gcc's MinGW and CygWin options which are installers which download more files.
  • After extracting the zip file, you can add its location to the path variable - Control Panel -> System ->  Advanced -> Environment Variables, and then restart the system, or add it to the commandline for a temporary session.
  • Compile, link and create executable with just
    tcc -o mcml.exe mcmlmain.c mcmlgo.c mcmlio.c mcmlnr.c
    Done in less than a second.
  • Incident light angle has direction cosines (0,0,1) by default, can change in mcmlgo.c
  • The output 2-D arrays of Tt_ra, Rd_ra, A_rz are formatted in the ASCII output file as 5 numbers per line(!) and not as lines and columns related to the 2-D array. This can be modified in mcmlio.c - or, of course, when the array is imported into something like Matlab, it needs further processing.
  • Large txt files are created by mcml in case large numbers are specified for dz, dr and da - these will need txt file editors which can handle large files. Files upto a few hundred MB were OK with PsPad, other options are gVim etc as noted here.
  • Section 3.5 of the Biomedical Optics book talks about overflow in the grid - we have to note this - that the last grid element in the direction of the overflow collects the weight - and have to discard that point. In reconstruction Fig 3.4, for eg, the first grid element reading has to be discarded - T_t(0). - or perhaps this is because the measured value is T_t (total transmittance) and what we need is T_d (diffuse transmittance). The angle a (or alpha) in R_d(a) is angle of reflection, so it goes from 0 to pi/2.
  • Section 3.5 also talks about how we should choose the grid size - numbers of da, dz and dr along with values of dz and dr - as a rule of thumb, each grid element should measure about 10% of penetration depth or transport mean free path.

Friday, August 14, 2015

free up space on C drive - MSOCache

Wanted to free up space on C drive. Found this superuser post about moving MSOCache folder to another drive. The mklink solution suggested there did not work, probably because I am on Windows XP and not Win7. But I did the registry editing technique, using advanced regedit to find and replace C:\MSOCache with D:\MSOCache

extracting data from open UDF session

We received some data on a DVD which had an open UDF session - DVD session had not been closed. On Mac and on Windows explorer, the disc displays as empty. Nero Burning Rom's Disc Info showed the open session, but my DVD writer has some writing issues, so I was unable to close the session with Nero 8. The writer which is working is on a machine which has Nero 6, which does not have the Finalize session option. Googled for closing UDF session, and videohelp forums pointed to ISO buster. I had ISO buster, which was able to extract the files with no issues.

Sunday, August 09, 2015

USB printer issues

A TVS MSP 345 dot matrix printer connected using a parallel to USB converter cable to the laptop's USB port did not print today. Tried re-installing the driver, still no go. Then, cycled through the three virtual printer ports in printer properties -> ports,  USB001, USB002 and USB003. It finally worked with USB003.



Friday, July 03, 2015

google transliterate bug and workaround

Using the "Input tools" on Google Docs, transliterating to Devanagari (Hindi) script - at time, the cursor disappears and input does not occur where we want it to go.



This seems to happen on Firefox when the choices drop-down is clicked with a mouse instead of using the keyboard shortcut.


So, the workaround is to use keyboard shortcuts, like 4 for Baahut above etc. 

In case it does get stuck, refreshing the page gets you back to where you were, and then you will need to re-select the input tools. A less troublesome recovery, which sometimes works, is to type some more, and when the choices drop-down appears, hit the escape key. 

Tuesday, June 30, 2015

fulldome short - 2015 - Year of Light

2015 YEAR OF LIGHT - the International Year of Light is a global initiative adopted by the United Nations to raise awareness of how optical technologies promote sustainable development and provide solutions to worldwide challenges in energy, education, agriculture, communications and health. In this short immersive film by Carl Zeiss, seven minutes of memorable visualisations highlight various significant aspects of light. Visible or invisible, light is everywhere. We are reminded of its omnipresence and how - amongst other things - light creates moods and emotions, is turned into electricity, is a manufacturing tool and is used for communications.
FILM TYPE - Science
Key Stages 2-5, General audiences
Length: 7 min

Available from British Fulldome Institute,

http://www.bfi.gb.com/