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.