Sunday, February 14, 2016

smooth plot in Matlab

This post has some useful techniques for using in Matlab, for smoothing data using
http://stackoverflow.com/questions/12987905/how-to-make-a-curve-smoothing-in-matlab

If curve-fitting toolbox is present, smooth can be used. Or we can roll our own, as mentioned in the link.

Saturday, February 13, 2016

video stabilization plugin for virtualdub

Video stabilization used to be available only in high-end video editing software. Realized now that Virtualdub has a plugin, too! And its development dates back to  2003. Used the Deshaker plugin from
http://www.guthspot.se/video/deshaker.htm
for a video of an oscilloscope trace, pretty good!

Friday, February 12, 2016

multiple issues with sending bulk email

SSSIHL tied up with Benchmark for sending some 4000 emails, they wanted to make it into a newsletter every couple of months. There were multiple issues with the email sending.

  1. The first time around, the sssihl.edu.in SPF record had not been updated to include benchmark servers, which resulted in spam filtering blocks for most of the mails. Along with SPF update, Benchmark also recommended whitelisting the Benchmark mail server IPs for sssihl.edu.in mail servers. 
  2. Found that Google Apps allows whitelisting. Updated the SPF record.
  3. Then found that the SPF record was returning an error, too many lookups, via the test at  http://www.kitterman.com/spf/validate.html - googling showed that having Godaddy's  include:smtp.secureserver.net in the SPF record causes a very large number of lookups. Moved the sending of emails from the Godaddy server to google apps, removed that include, then the SPF validated. 
Finally most of the emails went through after the valid SPF. 

cleaning up C drive

All these years, I had relied on various tips and tricks for cleaning up C drive on Windows, and had never used the Properties -> General tab -> Disk Cleanup utility's "Compress old files" feature, because it used to take a long time to run. But yesterday I did, and it made 9 GB available on a drive which had only 600 MB free!

Add 2 GB to Google drive storage

K sent me an email telling me about "an annual ritual by Google. I did it last year too and got 2GB."

Do the security checkup and get 2GB added:
http://www.theverge.com/2016/2/9/10940046/google-drive-free-2gb-space-security-checkup

http://googledrive.blogspot.com/2016/02/safer-internet-day-2016.html

Have now added a google calendar reminder for this :)

Tuesday, February 09, 2016

Apache 403 Forbidden errors

P had a problem after he migrated data from an old hard disk to a new hard disk on our internal server. A couple of folders in the hard disk were supposed to be available via the local webserver - but after the migration, those were returning 403.

Finally, the issue turned out to be permissions for the parent directory. Gave the permissions, also had to add Indexes to the Options line in apache2.conf for one of the folders, all done.

https://wiki.apache.org/httpd/13PermissionDenied

Sunday, February 07, 2016

retuning tv set-top box

Doordarshan DTH, now called FreeDish, migrated from INSAT-4B to GSAT-15. P sir and R called me for re-tuning their set-top box. Since the satellites are nearby, there was no need to re-align the antenna.

R had managed to enter the correct values of frequency, polarization and symbol rate in TP edit mode. It only needed a scan of the correctly entered transponder values. The relevant menu item was in the Installation menu, Scan current ANT.

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.