Monday, October 10, 2016

email ids for a new domain

Similar to my earlier posts, copy-pasting from an email I sent:

Google Apps for domains (now called GSuite) no longer has the free option for new customers.
https://support.google.com/a/answer/2855120?hl=en
"As of December 6, 2012, Google stopped offering Free edition to new customers. If you already had the Free edition, you can continue using it for free"

 Microsoft Live email  has also stopped new registrations for free domain support -
http://www.zdnet.com/article/microsoft-ends-support-for-custom-domains-in-free-email-service/

Zoho offers free for upto 10 users only,
https://www.zoho.com/mail/help/email-hosting-with-zoho.html

There are many paid options, I could discuss them with you if you are interested. And for the extremely tech savvy, you can also run your own mail server. Initially when we started with our domain's emails, we used to forward the emails to gmail from our own mail server. But that is a lot of hassle.

If you want Google GSuite free, an option would be to get the educational version, which remains free. But that has terms and conditions.
https://support.google.com/a/answer/2856827?hl=en

Sunday, September 25, 2016

formatting bold lines in MS Word table

Needed a specifically formatted table with some bold lines and some lines without bold face. Did the bold lines as per
http://superuser.com/questions/276778/how-to-adjust-the-thickness-of-some-lines-in-a-word-table

That is,
"Under Table Tools/Design menu, go to Draw Borders and adjust the line values to your preference. Then click on Draw Table and a pencil icon will appear. Click on any line and voila! The line is now set to your liking."

Wednesday, September 21, 2016

speed comparison - Matlab vs C vs python vs perl

I had found C code to be around 150x faster than Matlab for my implementation of the Monte Carlo code in Matlab.

User time:        3 sec for the C program
elapsed_time =  453.2500 sec  for the Matlab program

This stackoverfloe discussion has some interesting points to make - use Matlab first to get correct results, then increase speed with C, beware of errors in C libraries.

These benchmarks show python to be 3x to 100x slower than C - so, translating from Matlab to python in search of speed gains may not make sense.

These benchmarks show perl having similar speeds as python for loops - so I needn't explore perl, either.

Friday, September 16, 2016

miui permissions

On the Xiaomi Mi3 phone which runs the MIUI skin for Android, the method for setting permissions for apps is slightly different from the method for stock Android phones. The method for MIUI is via the Security App on the home screen, Security -> Permissions -> Permissions -> (Choose the type of permission like Contacts etc) -> enable or disable per app.

This is for MIUI Global 7.5, running on Android 6.0.1

Sunday, July 17, 2016

Income tax e-filing with e-verification

In earlier posts, I had detailed the process for e-filing Income tax returns in India. This year, from Assessment Year 2016-17, the verification can also be done online, by logging onto Netbanking portal of a bank where my PAN number is associated with my account. So, no need to print and post the ITR-V form.


In HDFC bank's netbanking portal, the e-verification is currently available under Requests - Income Tax E-filing on the left-hand side.

Around a month after I submitted the return in June, my tax refund has been credited, too.

Sunday, July 10, 2016

checking for bad blocks on hard disk

The IBM ThinkCentre given by K for use by Ke's son had some disk issues - the hard disk was my former 160 GB laptop hard disk. Probably bad sectors and so on, so I had to do the Linux equivalent of running scandisk. Ubuntu 16.04 apparently doesn't support shutdown -Fr now for scanning on reboot - maybe due to systemd?

So, booted using USB flash drive and ran
sudo umount /dev/sda1
sudo e2fsck -c /dev/sda1

Apparently e2fsck with the -c option marks bad blocks using the badblocks program. 160 GB drive took 1 hour 30 minutes to scan - would have taken around 45 minutes if not for the 97 errors.

Output of badblocks 97/0/0 apparently means  read/write/corruption errors. Since I'm doing a read-only test, only the read errors show up.

Sunday, July 03, 2016

browsing Windows shares with Master Browser down

The Studio network's master browser was set as the local server, which now has smbd service stopped. So, smb4k, konqueror etc were not displaying shares when queried with smb hostnames like smb://hostname
- ip addresses were required.

In order to query the ip addresses, google led to this post, so a listing, albeit clunky, is obtained with
nmblookup -S WORKGROUP
where WORKGROUP should be replaced with the name of the workgroup in the network. smb4k lists the workgroup names, so that can be a first step.

Edit: PB adds a better way:
nbtscan -qe 192.168.127.0/24

Thursday, June 23, 2016

converting putty key to open ssh keys

Used the method given here to convert, using
puttygen mykeyfile.ppk -o ~/.ssh/id_rsa.pub -O public-openssh
and
puttygen mykeyfile.ppk -o ~/.ssh/id_rsa -O private-openssh

After moving the keys to .ssh, we also have to chmod 600 or else ssh will not take these keys by default. We also need to name them id_rsa and id_rsa.pub for ssh to use them by default, without having to specify ssh -i keyname username@server.

fixing dual-boot time differences

With earlier versions of Linux, the method was to choose UTC = yes in /etc/default/rc5 and so on. With Ubuntu 16.04 and above which use systemd, the method is to enter
timedatectl set-local-rtc 1

Monday, June 20, 2016

behaviour of virtualdub frame processing

If we choose Process every other frame (decimate by 2) - the resulting avi would have a framerate half that of the source.

For example, a 30fps source, with this decimate by 2 results in an output at 15 fps. If that 15 fps output is re-saved using direct stream copy choosing 30 fps as output frame rate, then we get a 2x speeded up video. A two-step process.

In order to get 2x speeded up video in one step, choose to Change frame rate to 60 fps, and then Convert to 30 fps.



Tuesday, June 14, 2016

cloning laptop hard disk

My laptop hard disk started showing SMART errors with Crystal Disk Info. Got a new Seagate 1 TB SSHD for replacement. Macrium Reflect Free could not clone - the bad sectors made it abort. Clonezilla did the job in around 4 hours for the 160 GB hard disk with three partitions, using an external USB dock for the new hard disk.

But the cloned hard disk did not boot. Booted with Windows XP install DVD, went into recovery console and did fixmbr. Then XP booted, but showed only C and D drives. Since in any case I would need to copy files from E:, might as well increase the size of C: by deleting D:. Used Partition Wizard for increasing C: size, created D: and E: as fresh partitions, and left free space for Linux. RichCopy copied over the D: and E: contents, ignoring errors, in just about 90 minutes. Now most apps work as expected, except some which complain about path not found - maybe they look for My Documents in C:.

Later, installed Kubuntu 16.04 on a trial basis, using mini.iso and a network install - the process took around 90 minutes.

Tuesday, June 07, 2016

checksums on Windows

As mentioned on this page, installed and tried out WinMD5Sum and Checksums calculator. Found that one of my iso downloads had a checksum error.

Wednesday, June 01, 2016

WHM + CPanel setting up ssh access

To set up shell access via ssh to a server for which I have Web Host Manager (WHM) and CPanel access:

1. Import my existing ssh public key to the server via the CPanel of the relevant user - by clicking Manage SSH keys - for this, as this post mentions, the key should be prefaced with ssh-rsa and should not have line breaks within the key.
2. The key should be authorized - from the Manage SSH keys interface, by clicking on the Manage authorization link. Now ssh login via key exchange using that key would be possible, for that user.
3. In order to get to a root shell, that user has to be added to the wheel group, after making sure that user is in a full shell and not a jailed shell - via WHM in Home >> Account Functions >> Manage Shell Access and Home >> Security Center >> Manage Wheel Group Users respectively.

Sunday, May 08, 2016

problems with X crashes on newer Ubuntu

My Ubuntu install has had problems with random freezes after an upgrade to 12.04. Finally, when starting to do some serious simulation work, I decided to do something about it.

The first thought was that firefox was causing the crashes, since the freezes would start most often while starting firefox. But then, found the crashes happening when starting other apps as well. Suspected X, or the display driver, and wanted to use vesa instead. Many of the methods listed, like blacklisting nouveau, did not work with 16.04  - even after reboots, nouveau driver was being listed as used by lsmod.

Final solution was to create a /etc/X11/xorg.conf - which does not exist by default. As mentioned at many places, the procedure to do this was:
Switch to a console. Ctrl+Shift+F2, for example.
Kill the display manager with sudo service lightdm stop (or whichever dm is running)
Generate a new xorg.conf with sudo X -configure
Edit the xorg.conf.new created in current directory, replacing all instances of nouveau with vesa
Move it with a rename to /etc/X11 with sudo mv xorg.conf.new /etc/X11/xorg.conf
Restart X with sudo service lightdm start

Unfortunately with Vesa, the screen refreshes are very laggy, even with Lubuntu. But no crashes. 

Saturday, May 07, 2016

Thursday, May 05, 2016

python using a single core for numpy

A point which came up when using pynlo:

A longish reply for the question why python uses only one core for numpy -
http://stackoverflow.com/questions/15639779/why-does-multiprocessing-use-only-a-single-core-after-i-import-numpy

In short, core affinity can be reset using
os.system("taskset -p 0xff %d" % os.getpid())
after the module imports. But this would be useful only for multi-threaded programs, of course. 

Wednesday, May 04, 2016

mounting a samba share with read-write permissions

Mounting a shared network drive on our internal server running Ubuntu - to make it read and write enabled, PB reports the command to be:
sudo mount –t cifs //ip-address/Share_name /local/mount/path –o username=correct_uname,uid=local_uid,gid=local_uid

Then, the local_uid user has read + write permissions.

Edit: 11 July 2016

This post about listing hostname with ip address is useful.

Also, PB adds one more tip - for mounting shares with spaces, use single quotes
sudo mount -t cifs '//192.168.1.1/SHARE WITH SPACES' tempmount  -o username=guest,password='',nounix,sec=ntlmssp

Tuesday, May 03, 2016

installing and using pynlo

Looking around for supercontinuum generation literature, came across PyNLO's documentation. Tried to install and use it. Was a bit of a struggle at first, but finally it all came together.

Issues:

  1. Anaconda3 version 4.0 installation on Windows XP failed - reported that it failed to change path variable etc, but more importantly, the exes were not running - "this is not a valid Windows executable".
  2. On Ubuntu 14.04, tried a direct pip install. Some dependency issues. Thought upgrading to 16.04 would help - ran out of hard disk space - 13 GB. Formatted and installed Lubuntu instead. With many hiccups on the way - like while doing a manual partitioning, we must not touch the swap space - because that is where the installer stores the installation files!
  3. With Anaconda3 and pynlo, errors like Missing parenthesis in call to print - so had to install Anaconda2 instead.
  4. Trying installation with pip install pynlo - installation of the required pyfftw failed with the error  fftw3.h: No such file or directory - it needed libfftw2-dev as mentioned in the comments at this post
  5. After pynlo installed also, running the example script gave errors IOError: [Errno 2] No such file or directory: .../pynlo/media/fibers/nist_fibers.txt and on copy-pasting general_fibers.txt to nist_fibers.txt, an assertion error - pynlo/interactions/FourWaveMixing/SSFM.py, line 662, in conditional_fftshift assert chksum == np.sum(abs(x)) AssertionError
Solutions:
  1. Currently pynlo needs Python 2.7 to run, won't run on Python3. So, install Anaconda2 and not Anaconda3. 
  2. On Windows, this page says that Windows XP is supported only for Anaconda versions 2.2 and below, so downloaded 2.2 instead of the latest.  
  3. Installing libfftw2-dev on Linux with apt-get install libfftw2-dev solved the pyfftw install issues. Similarly, on Windows, the way to install it is given at https://pypi.python.org/pypi/pyFFTW#downloads - ie. download the fftw dlls and put them in the same folder as the pyfftw wheel folder before install. The pyfftw whl file was installed as pip install wheelfile.whl without any issues. 
  4. Using the latest git code solved all the pynlo issues, using
    pip install git+https://github.com/pyNLO/PyNLO.git like this post
  5. Git for windows was installed from https://git-scm.com/download/win
  6. On Windows XP, everything was 32 bit, and the example took 55 seconds to run. On 64-bit Lubuntu, it ran in almost the same time. Lubuntu's desktop CPU meter indicates that it was using only one core of my dual-core Athlon, ie. 50% cpu.   

freeing up space on ubuntu

This post has lots of useful information in the answers. I removed libre-office and old kernels to get 1.5 GB. For the removing the old kernels, I followed
1. uname -r to know current kernel
2. sudo apt-get remove kernelname1 kernelname2 etc after doing
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove
sudo apt-get install localpurge
and
rm -Rf /tmp
etc.

The listing of all packages with sizes with
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less
is also a nice trick to use. 

Monday, April 25, 2016

too many files bug and php error reporting

Our audio search page had a bug where if too many files were selected, the results would not be displayed. With the help of S & B, constructed a workaround. The form was submitting all fields of the large table, instead of only submitting the hidden variables which had the fileids. So, made the main form submit to a dummy destination, and made another form with the hidden variable, submitting to the actual destination. That solved the issue, which was that there were too many fields being submitted. We did not have to change max_input_vars.

While troubleshooting, we wished to see detailed error reports. The way to do that was
ini_set('display_errors',1);
error_reporting(E_ALL);

for each php page.

Wednesday, April 06, 2016

cyberoam fail-over issue

PB had a problem where the 2nd gateway was not being automatically used as failover when the main gateway failed. Apparently it was due to the way in which Cyberoam had been configured. Tech support explained it, and PB fixed it. 

Tuesday, March 29, 2016

Xmms alternative

P reports that Xmms is no longer available on Ubuntu 14.04, and some of the ubuntu forum posts have broken links. His solution was to recompile and use Audacious instead. 

dns limitations on our mail server

We were doing some explorations of the feasibility of remote hosting our mail server which sends out daily emails to around 50,000+ subscribers. Seeing some posts about rate limits to Google public DNS servers etc, and our own experiences with DNS failures, we should perhaps run our own DNS server as well as mail server if we plan to shift the email server. 

Sunday, March 27, 2016

Firefox problems with HTML5, Vimeo and Youtube

One issue seen with Firefox - Vimeo embedded player not appearing on screen - seems to have been sorted out at some time - the current version 45.0.1 does not seem to have this issue. Or is it that it still has issues with embeds like iframe src="//player.vimeo.com/video/xxxx instead of src="https://player.vimeo.com/video etc ? There are lots of people with issues with Firefox and Vimeo.
http://techawakening.org/vimeo-videos-not-working-in-firefox-solution/2490/

Then there is the persistent stutter - for audio as well as video using html5 playback from Firefox on Windows. The only solution for that seems to be to force Flash player playback. This can be done for youtube as in my earlier post.



problem reading memo field

After a PHP upgrade from 5.3 to 5.5, one of our php applications reading data from an Access .mdb file had an issue - other fields were displaying fine, but the data from the memo field was showing blank.

After poking around for a couple of days, PB finally found the solution to be the one suggested in the comments at
https://bugs.php.net/bug.php?id=52658

That is, he had to add the optional cursor_type parameter SQL_CUR_USE_ODBC like
$cnx = odbc_connect('$databaseName', 'user', 'pass', SQL_CUR_USE_ODBC);

 Then it works. 

Tuesday, March 22, 2016

Airdroid vs ES File Explorer

One more post about my Xiaomi Mi3 phone. Though this is probably applicable to all Android phones.

I'd earlier used ES File Explorer to transfer files to and from Windows shares to the phone over Wifi. But when transferring to shares with a large number of files, or while transferring large files, ES File Explorer would keep popping up a 'Failed' dialog box, and would need repeated 'Retry' attempts to transfer multi-MB files. Finally looked for alternatives, and found Airdroid's features include file transfer. I use it in 'local network' mode, by typing in the ip address, so extra charges, no need of external network etc. ES is still useful for local file browsing etc.

Xiaomi Mi3 with Android 4.4.4 - soft home and back buttons

After my last post about my phone, there were some more developments. Now the headphone socket does not work at all. But thankfully the earpiece works fine. Then, after frequent falls onto hard cement floors, the left corner of the screen cracked slightly, and the home, back and recent apps buttons on the bottom bezel of the phone stopped working.

Since I had heard of apps with 'soft home button', I installed several of them. None of them seemed to work with Xiaomi's MIUI. Then I installed MyHomeButton which creates a notification in the notification pull-down screen. This worked, but with the drawbacks that:
  1. It would not start on rebooting the phone - I have to remember to open the app settings, turn off and turn on the check-boxes for Home and Recent Apps, then the notifications would appear. 
  2. No back button.
  3. Use requires a swipe from the top to bring down the notification bar, a swipe sideways to view the notifications, and then a tap to activate the home button. A bit cumbersome.
I lived with the above drawbacks till today, when I installed Back Button Gesture Launcher. Or rather, the trial for the paid app. Since it is a paid app, it had a somewhat helpful 'Help' section, which mentioned that for the onscreen button to be visible, what settings need to be enabled on Xiaomi -
  1. Settings -> Installed Apps -> Downloaded -> Back button -> Permission Manager -> Display pop-up window, Enable. 
  2. Settings -> Additional Settings -> Accessibility -> Back button -> Accessibility, Enable. 
Now, this app is a paid app, and one of the comments directs users to install the Back Button app instead, which is a free app. So I did that, after uninstalling Back Button Gesture Launcher. Granted the permissions again, and ready to go. A small issue with this app is that the icons don't seem to be movable from their location on the right side of the screen. But that is probably not a big issue.


Tuesday, March 08, 2016

funny characters seen in Putty session

After a server upgrade (I think), I started seeing funny characters when using Putty to ssh into our local server, like

P suggested this might be the solution,

That is, change character translation in Putty to UTF-8. The setting is in Window -> Translation. Worked.




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.

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/

fulldome clip - GALACTIC JOURNEY

GALACTIC JOURNEY - fly your audience across immense regions of deep space with this accurate visualisation of 120,000 galaxies viewed from the southern hemisphere. Courtesy of the Anglo-Australian Observatory, Paul Bourke, Peter Morse & Glenn Rogers
FILM TYPE
Cosmology
Key Stages 3-5, General audiences
Length: 2.5 min


Available from BFI,


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

Monday, June 29, 2015

extracting audio from mov file

A quicktime video file (.mov) from eplanetarium displayed unknown input format in KMplayer, which did play it, but was not being recognized by directshow. Avidemux was able to extract the audio - chose audio output PCM and saved it as .pcm - then Cool Edit Pro could read it. 

Thursday, June 25, 2015

problems with Unicode fonts on QuickTime7 for Windows

Working with the eplanetarium team for Indian language subtitles, we ran into a road-block - the workaround seems to be only burnt-in subtitles.

The issue seems to be that QT7 on Windows - and MediaShow, which runs on QT - does not support Unicode for subtitles. Excerpts from my emails below:

... I tried this technique given here,
http://www.7tutorials.com/changing-display-language-used-non-unicode-programs

Unfortunately, the Hindi option does not even appear ... The reason seems to be that only ISCII Hindi (Devanagari script) is supported and not Unicode Devanagari, as seen in the code conversion tables. So, it may not be possible to display the Unicode Hindi characters using the current subtitling tool and playback tool combination on Windows. Unicode capable playback tools seem to be able to display, like KMPlayer ... One caveat for Indian languages is that many operating systems have limited support for complex scripts. We may have to check if your subtitle creation software as well as the subtitle display software have proper Indic support. If not, the script would be jumbled. ....


Tuesday, June 16, 2015

Assignments in Matlab

One of the students requested pointers for some assignments or mini projects he could do in Matlab. Here was my reply:

Since I'm not familiar with abstract math problems with Matlab, I'll have to suggest what I know about, and also what is got by googling. So, please take these only as vague pointers, discuss with your concerned teacher before proceeding further.
1. Visualizations. Matlab has got very nice built in plotting tools. Visualizations of fractals, chaotic system equations, other differential equations etc could be done. The Mandelbrot function is already implemented, you could play around with it to learn more, and implement other fractals.
http://in.mathworks.com/help/distcomp/examples/illustrating-three-approaches-to-gpu-computing-the-mandelbrot-set.html
If you make high-resolution circularly symmetric movies, you could also help the planetarium,
http://fractalfoundation.org/videos/
All sorts of value-added stuff can be done with visualizations - making guis for varying parameters, interactive graphs, etc etc.
2. Matlab has got a Symbolic Math toolkit. All sorts of higher level math can be modelled using this, like
http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=5191494
http://in.mathworks.com/products/symbolic/features.html#key-features
3. Linear Algebra problems, Manifolds and such are very much solvable with Matlab, so taking up some problems with these might be useful, eg.
http://www.manopt.org/and many more,
https://www.google.co.in/search?q=manifolds+with+matlab
4. Scilab and Octave are open source Matlab clones. If you are looking at the programming side, there are many small functions which can be written for Scilab and Octave for better Matlab compatibility. 

Thursday, June 11, 2015

dropped samples - clicks on Audition recordings

Found this issue of dropped samples - leading to clicks - on Audition recordings at Studio with the Audiogram interface. And maybe even with the Presonus too. The workaround was to record using Nuendo. S emailed with the solution as implemented by PB - 

The clicks problem recurred and PB has once again reset the Preferences/Audition folder.
Now it is fine. 

Finder/Go/Option key/Library/Pref/Audition -->Trash

Wednesday, June 10, 2015

full playback of downloaded youtube 1080p videos

In my earlier post, I had noted that the files repaired with mp4box -isma still would not play with DirectShow etc. Finally did a better analysis of the issue and found a solution.

As the mp4box documentation says, mp4box -info file.mp4 gives information about the file. Found that the downloaded youtube mp4 file, after the -isma fix, had three streams, like
Track # 1 Info - TrackID 201 - TimeScale 90000 - Duration 00:30:14.033
Track # 2 Info - TrackID 2 - TimeScale 90000 - Duration 00:00:01.000
Track # 3 Info - TrackID 1 - TimeScale 90000 - Duration 00:00:01.000

So, taking out only the genuine video track, in this case TrackID 201, made the file playable. In my case, I added the audio from the 360p file also, as below.

mp4box -add E1080p.mp4#201 -add E360p.mp4#audio E.mp4

So the output file E.mp4 contains the video track with TrackID 201 and the audio track from the second file - this file plays fine with DirectShow. 

Friday, June 05, 2015

recording tests with Zoom H1

The Zoom H1 I had sent for RK's Hindi voice-over has arrived here now. It can also work as a USB mic. Simplest way to record seems to be with Cool Edit Pro.

With Reaper, have to make sure that the sampling rate is set to the same sampling rate as on the H1, otherwise the recording comes out with breaks. File -> Project Settings -> Project Sample Rate, then Options -> Preferences -> Audio -> Device -> Audio System has to be set to ASIO and again the sample rate has to be set.

Noise floor is impressively low. A sample I recorded at the Studio on the Presonus digital mixer there, using a dynamic mic and with air-conditioning on had a noise floor of -50 dB. Compared to that, from my office room, with the computer, AC, fan etc turned off, the Zoom H1 with input level set to 40% had a noise floor of -63 dB! That was recording to the micro-SD card. With computer on and recording via USB - using the H1 as a USB mic - the noise floor was around -54 dB - mostly the computer fan noise. Bird sounds and outside traffic sounds were below -50 dB when the mic was next to my mouth,  input level set to 40%, covered with a foam windscreen (pop filter). With AC on, a floor of around -45 dB. 

Saturday, May 30, 2015

correct aspect ratio of mp4 file without re-encoding

I wanted to correct the aspect ratio of an mp4 file without re-encoding. Videohelp.com forums had this question answered. In my case, the video was 640x268 pixels, and was supposed to be 4:3.

x * 640 / 268 = 4/3 ; So  (1/x) = 640 * 3 / 268 * 4 = 160 / 89, approximately = 16/9

So, my commandline was

mp4box -add inputfile.mp4#1:par=9:16 -add inputfile.mp4#2 output.mp4

One caution - temp file seems to be created in the default Windows temp folder, or perhaps in the same folder as the input file - did not verify which. Overall operation takes as much time as two copy commands - "importing" and "writing" done separately.

Wednesday, May 27, 2015

dicom viewers

idoimaging.com lists a whole lot of DICOM and other image format viewers. Searching there for viewers which do 3D volumetric rendering, found 3dimviewer - capable and free. 

Tuesday, May 26, 2015

testing website before changing DNS

Testing websites before changing the DNS - this is something which I need to do often. I've relied on the Telnet based method in the past. But when the content needs to be checked, it's better to do the hosts file based method. Dreamhost has good documentation on this, and also on flushing DNS.

So, on Windows XP, edit C:\Windows\System32\Drivers\etc\hosts
and run
ipconfig /flushdns

Will need to restart browser after flushing dns cache, too. 

Tuesday, May 05, 2015

Oculus Rift trials

Finally a post on the Oculus Rift DK2. I had tried out Google Cardboard earlier, and wanted to see how much better the Rift is. Unfortunately the system specs needed are very steep. Smooth 70 fps+ framerates were obtained only on a machine with the following specs, which costs more than Rs. 2 lakhs:


A Mac Mini was not enough - the frame rate was 10 fps for the Tuscany Demo. A few of the Rift demos I sampled were the following:


Short notes:
VRSurgery - view is like a big screen tv with a wide field of view.
3d gallery - interesting and works OK.
HiyoshiJump - a simple demo
bungee - no hmd detected - probably this does not work with DK2
surface of mars - an OK demo
spacewalk - limited?
Malfunction - hmd?
mars walk - field of view not as good as "surface of mars"
chair in a room - an OK demo
earthvr - needs a good internet connection and good specs for the machine
roculus - a lo res demo
vrspacetunnel - wrong registration - probably doesn't work with DK2
Titans of space worked at 15 fps on the Mac Mini
Unity demo - at 10 fps on the Mac Mini
Trying a fisheye movie Cosmic Colors on liveviewrift - not very clear focus, equirec mode
vrplayer not available for Mac, so can't do a head to head comparison with Google Cardboard.
Edit - KolorEyes player is available for both Cardboard (Android) and Oculus. Renders well.

My conclusion of Rift vs Cardboard - Cardboard's strength is affordability -smooth display, no rendering lags on low cost hardware. With a powerful machine, Rift shines due to configurability, input methods, hand tracking possibilities, etc. 

Monday, April 06, 2015

Optoma projector HDMI quirk

While testing a VGA-to-HDMI converter box, came across this quirk with our Optoma TX1080 projector. It did not recognize the HDMI input if the HDMI signal was changed after the projector was powered on. The fail-safe workaround was to do a hard reboot of the projector, removing the power cord, and then putting on the projector with a valid HDMI signal present - then it detects, and is able to change resolution also if the HDMI resolution changes.

The VGA to HDMI box was able to convert almost any resolution which my PC output to HDMI, sending  720p, 1080p and even resolutions of 1600x1200, 1280x1024 etc - the aspect ratio setting on the projector could be set to original pixels or 16x9 or 4x3 etc, and a suitable picture resulted. 

Tuesday, March 31, 2015

Adobe Audition settings export

A wanted to export settings from Audition and import it on another machine. My reply was:

Here is the method for exporting and importing application settings from audition,
https://helpx.adobe.com/audition/using/customizing-saving-application-settings.html

Choose File > Export > Application Settings. Then specify a filename and location.

To reapply the settings at a later time, choose File > Import > Application Settings.

For exporting presets, this forum post  :
https://forums.adobe.com/thread/1042236
gives detailed instuctions on how to find the presets folder.

Then this page says, how to export mixdowns, sessions etc
https://helpx.adobe.com/audition/using/whats-new-cs6.html

Choose File > Export > Session As Template to create multitrack templates that speed up recurring projects requiring similar settings, tasks, and source files. To apply a template to a new session, choose File > New > Multitrack Session, and then choose a Template option.

To archive whole sessions or move them to other systems along with markers, metadata, and source files, choose File > Export > Session. In the Export Session dialog box, customize exported source files by selecting Save Copies Of Associated Files, and clicking Options. To change file format, select Convert Files. To export full or trimmed source files, choose Media Options.

Choose File > Export > Mixdown, and review the Mixdown Options section. Click Change to output tracks as separate files, or simultaneously output mono, stereo, and 5.1 masters.

Monday, March 09, 2015

players on Android for radiosai streams

Adapted from a support email to a listener who complained that radiosai on a Lenovo tablet worked sometimes and did not work sometimes.

The various options are listed at
http://radiosai.org/Pages/Streaming_Audio.htm#mobile
One way would be to try out the different apps listed there.

Unfortunately, we have found that various Android devices have various incompatibilities. Some players work on some devices while some don't. Apps like Tunein radio are very likely to work, since they have large installed bases.

Opera mobile browser plays our streams from the player linked from the home page radiosai.org when "Opera Turbo" is turned off. It does not seem to play the streams when Turbo is turned on. Chrome mobile browser plays too. 

Tuesday, March 03, 2015

fulldome clip - DNA flythrough

DNA FLY-THROUGH - A dramatic journey through the DNA double helix.

FILM TYPE
Biology
Key Stages 3-5, General audiences
Length: 1 min
Full preview: http://bit.ly/1tgKIGw
Available as: 1920px MOV
No User Agreement to complete.


From BFI,

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

free planetarium show - Astronomy Photographer of the Year 2014

ASTRONOMY PHOTOGRAPHER OF THE YEAR 2014 - the Royal Observatory Greenwich proudly presents selected images of the Astronomy Photographer of the Year 2014 competition. Exhibited in glorious 360˚ and showcasing incredible images of the sky, you will marvel at spectacles from both within our Solar System and from distant deep space. More photographs than ever of solar features, eclipses, aurorae, nebulae, star trails and much more were received as entries from around the world this year - and for the first time, even a photograph taken from the edge of Space!

FILM TYPE
Astronomy / Music / Art
Length: 12 min
Full preview: http://bit.ly/apy2014
Available as: 1024, 1080, 1536,1920px MOV


From BFI,

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

free planetarium show - Astro photographer of the year 2013

ASTRO PHOTOGRAPHER OF THE YEAR 2013 - imagine sitting comfortably in a dark planetarium. You look up at the 360˚ screen and the room explodes with images of the Universe. The Astronomy Photographer of the Year competition, run annually by the Royal Museums Greenwich, attracts the very best photographs of the Cosmos from around the world. Immerse yourself in the breathtaking beauty of the heavens, enjoying the spectacle with ambient background music.

FILM TYPE
Astronomy / Music / Art
Length: 12 min
Full preview: http://bit.ly/apy2013
Available as: 1920px MOV
 


Distributed by BFI,


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

free planetarium show - Clockwork skies

Another Ott planetarium show from BFI,

http://www.bfi.gb.com/
CLOCKWORK SKIES - explore the motions of the stars, Sun, Moon and planets - are they moving or are we? Learn about daily motion and the Earth's rotation; the Moon's monthly orbit of our planet and how the Earth takes a full year to travel around the Sun. The Solar System is like a giant celestial clock powered by gravity.

FILM TYPE
Length: 5 min
KS 1 - KS2
Full preview: http://bit.ly/ott_cs
Available as: 1080 / 1536 / 2048px MOV



free planetarium show - Space Shapes

One of the Ott planetarium movies, rendered and distributed by BFI,
BFI logo


SPACE SHAPES - what's the difference between a sphere and a disc? A ball and a pancake? Lift off in a rocket and find out! Fly to the Moon and discover an 'orbit'. Visit the planets to see if they are round like a ball or round like a pancake. What about the Solar System, is it round like a pancake or round like a ball?

FILM TYPE
Length: 9 min
Reception & KS 1
Full preview: http://bit.ly/ott_ss
Available as: 1080 / 1536 / 2048px MOV


free planetarium show - solar system adventure

The BFI lists this show,
with a short intro and more info,

SOLAR SYSTEM ADVENTURE - embark on a 12-minute adventure to explore the planets, moons and countless other objects orbiting our nearest star the Sun. Make a quick stop at each of the planets to examine its makeup. Enjoy an unforgettable cruise through the rings of Saturn as you zig-zag past countless pieces of ice. Discover the mystery and beauty of our planetary neighbourhood in this fast-paced, informative film.

FILM TYPE
Length: 12 min
KS 2-5, general audiences
Full preview: http://bit.ly/bfi-ssa
Available as: 1600px MOV in English, French & Italian
User Agreement to complete.
For your copy contact: free_int@bfi.gb.com

Short link to this page: http://bit.ly/bfi_ssa


BFI logo and link,  currently it goes to their facebook page,
http://www.bfi.gb.com/


link farming for bfi

The British Fulldome Institute has a very useful feature - not only do they list free shows, but they distribute them too! But they request a link for every show. So, the next few posts are going to be about each planetarium show I requested, and with a link to BFI!