Friday, September 27, 2024

google street view to video of trip

I had an idea of using google street view imagery and converting it to a video using google apps script or something similar. Obviously, many people have thought of this earlier.

https://github.com/TeehanLax/Hyperlapse.js
from
https://www.geographyrealm.com/create-videos-using-google-streetview-hyperlapse/

And the way to make it work seems to be to add an API key,
https://github.com/TeehanLax/Hyperlapse.js/issues/40#issuecomment-642969953

And apparently the API key now needs a billable account.
Mentioned here,
https://github.com/jblsmith/street-view-movie-maker
and forked for python3 here,
https://github.com/vardhman/street-view-movie-maker/tree/python3-support

So, currently no plans to try it out.

Google Sheets charts "add a series to start visualising your data" error and solution

Generally, we just select a range in Google Sheets and choose Insert -> Chart to get a chart automatically created from that range. But while debugging this issue, I had imported data from a text file which I had saved as csv after find/replace of spaces with commas, but google would not create a chart, instead showing "add a series to start visualising your data" and when I would add a range, it would say improper format.

It turned out that Google sheets had treated the numbers as text. So, the solution was to select the relevant ranges, Format -> Number -> Scientific (and then change back to Number or Automatic if required) . Once that was done, the automatic creation of charts worked.

Tuesday, September 17, 2024

H5P error on Moodle 4.1

An error was reported in an H5P module in one of our Moodle instances. Copy-pasting from my response - 

The error says, undefined function str_contains()

From this page:
https://stackoverflow.com/questions/66519169/call-to-undefined-function-str-contains-php

"str_contains() was introduced in PHP 8 and is not supported in lower versions."

 Currently we're running Moodle 4.1 LTS (Long Term Support) which runs on PHP 7.4. We have an upgrade plan to upgrade to Moodle 4.5 LTS in October or so, when we would also upgrade the PHP version as well as the MySQL database version, along with the server Linux kernel version. We're waiting for October so that the LTS version of Moodle as well as the Linux kernel will be out - https://moodledev.io/general/releases .

I've explained the rationale for the upgrade here,

https://hnsws.blogspot.com/2024/04/moodle-upgrade-path-41-to-45.html

After the upgrade, this issue should be sorted.


Friday, September 13, 2024

circuit breaker numbers

 How to read the numbers on a miniature circuit breaker (MCB) -
https://www.electricaltechnology.org/2015/08/how-to-read-mcb-nameplate-data-rating.html

First letter in the rating stands for the type of curve.
B curve for sensitive electronics - short circuit rating of 3-5 times the standard rated current
C curve for motors - 5-10 times
D curve for highly inductive / capacitive loads - 10-20 times.

Numerical part indicates safe current. And we should use a load 80% of this rating. Like 16A load --> 20A breaker.

Example:

C60H <-- product number
B25    <-- B curve 25A breaker.

Thursday, September 12, 2024

revisiting dvd backups

Someone had been gifted a box set of 16 DVDs, but they were unable to play them due to region restrictions. They asked me for help. So, revisited DVD Decrypter after more than 15 years. Still works fine on Windows, except that with Win10, while exiting, it gives a few error dialog boxes, 'Failed to set data for '' ' and so on. 

On Linux, DVD Decrypter under Wine is supposed to work with SCSI emulation, but I was unable to get it to recognize the DVD drive - the links in ~/.wine/dosdevices  f:: and f: are being automatically assigned correctly to link to the device /dev/sr0 in my case and the mount point respectively, so probably the need is to go to nt40 mode. But my .wine directory did not have a config file, as mentioned in the howto section at

https://appdb.winehq.org/objectManager.php?sClass=version&iId=2587

and even creating a config file did not solve the issue. Probably someone who knows more about wine can get it to work. There are also other options as mentioned in the old wiki page at

https://help.ubuntu.com/community/RestrictedFormats/RippingDVDs

But my purpose was served by dvdbackup. Handbrake also worked, but I wanted a decrypted copy which I would encode later, so I used dvdbackup instead.

sudo apt install libdvdcss2

sudo apt install handbrake

sudo apt install dvdbackup 

mkdir new12

cd new12

 dvdbackup -i /dev/sr0 -M -v

and in another window, 

 watch du -sh new12

to see the progress as the GBs get added.

The macbook's DVD drive worked fine, as also the Windows desktop's drive. But the Lenovo laptop's DVD drive seemed to be more sensitive to scratches. The macbook's drive was probably the best. Decrypting and writing to hard drive was probably limited by DVD drive's speed, around 4x, taking 20-25 minutes per disc.

Encoding with handbrake directly from DVD on the macbook was going at approx 23 fps for the "Fast 576p" encoding method, while on the newer Samsung Galaxy Book2, handbrake encoding with the decrypted files on hard disk was going at 130 fps for "Fast 576p" and 250 fps for "Very fast 576p" - and so I went for the latter, reasonable quality. With such speeds, each disc would get encoded in under 10 minutes.


 

Sunday, September 08, 2024

revive corrupt sdcard for raspberry pi

According to the section on reviving corrupt SD cards in this page,

https://thelinuxcode.com/format-sd-card-raspberry-pi/

I tried out F3 to check for corruption.


https://medium.com/@drawn_stories/how-to-find-if-your-thumb-drive-sd-card-is-fake-with-f3-linux-tutorial-f0109bef63ea

sudo apt install f3

(I didn't need to use lsblk since I knew the sdcard was /dev/sdc for me.)

(instead of sudo umount, I used GParted to repartition to a single Fat32 partition first, and then unmounted within GParted.)

sudo f3probe --destructive --time-ops /dev/sdc

reported that everything was fine, finished in around 2 minutes.

Then, disconnected and re-connected to mount the drive, and then

f3write /media/myusername/mymountpoint

showed it would take 50 minutes for this 32 GB drive. Again, no errors.Then, 

f3read /media/myusername/mymountpoint

Also no errors. Took around 20-25 minutes. 

Then, tried cloning the working sdcard image again, into this sdcard which had failed last time

gunzip -c my-root-boot.image.gz | dd of=/dev/sdc conv=noerror status=progress

This took a bit over three hours.

31914983424 bytes (32 GB, 30 GiB) copied, 11300.6 s, 2.8 MB/s

(3.13 hours)

Completed successfully.

 



 


Saturday, September 07, 2024

deleting a Microsoft account linked to an Azure free trial

After a month of the free trial, an email reminded me to upgrade to 'pay as you go' and add a payment method (credit card) to continue to use the free services for a year. I did so. But I did not have much use for the free trial - I had tested it out for downloading from 1and1's cloud platform IONOS which some collaborators had used, and which was timing out using BSNL fiber due to downloading at around 30 Mbps. Similarly, Google Drive shared files also would time out after an hour or so.

I had found that the workaround of using rclone was a better and easier alternative to (a) create a free trial (b) create a VM (c) download on the VM (d) download from the VM to my local machine. 

So, when I got an email from Microsoft saying that all Azure logins would need multi-factor authentication (MFA), I thought I would just delete the Azure free trial subscription and the associated microsoft account.

For this, 

and Microsoft account -
 
Just going to the 'close account' link in the above support page, first tried after 'Cancel'ling the Azure subscription. Apparently, that is not enough. 30 minutes after we 'cancel' the subscription, a 'Delete' subscription button become active - we have to 'Delete' the subscription.
 
It is only after we delete the azure subscription that we can exit the tenant - had to delete tenant and not exit the tenant because this account was the sole user and hence the 'Global Administrator' for this tenant - before it allowed to close microsoft account -
https://learn.microsoft.com/en-us/entra/identity/users/directory-delete-howto
 
After the 'delete microsoft account' page completed, it just dropped me into login.live.com which asks me to log in - no confirmation page that the account has been marked for deletion etc.

If I try to log in with the account marked for deletion, it says that this account is marked for deletion, and logging in will unmark it for deletion, so we need to choose 'Cancel'.  
 
So, in short, the steps were:
1. Cancel the subscription from Azure portal
2. Wait 30+ minutes, then delete the subscription from Azure portal
3. Wait for a few minutes for their servers to update, then delete the tenant from Entra Admin Centre
4. (Wait a few minutes for their servers to update?), then delete the microsoft account from the link on the support page.
 
 

Monday, September 02, 2024

raspberry pi not booting, error writing to SD card when reflashing with dd

One of the Raspberry Pis we use for video play-out in the waiting area was not booting. Simplest test was to use the other Pi's SD card and try booting with that one - worked. So, wanted to image that mini SD card to the one which was not booting. 

https://www.cyberciti.biz/faq/unix-linux-dd-create-make-disk-image-commands/
sudo dd if=/dev/sdc conv=sync,noerror bs=64K | gzip -c > my-root.image.gz
took around 45 minutes -
32 GB SD card with 5.5 GB used with df -h, due to gz it became 7.7 GB

Could monitor through watch -
https://www.baeldung.com/linux/dd-monitor-progress

watch -d ls -alh my-root.image.gz

But when trying to write back to the sdcard which was not booting (file system tests showed no errors after 'repairing'), 

sudo su -
# gunzip -c my-root-boot.image.gz | dd of=/dev/sdc status=progress

But after 10 minutes or so,

dd: writing to '/dev/sdc': Input/output error

https://superuser.com/questions/35349/dd-clone-hard-drive-input-output-error-though-chkdsk-says-ok

Tried conv=noerror -

gunzip -c my-root-boot.image.gz | dd of=/dev/sdc conv=noerror status=progress

Still the same error.

Then tried writing the disk image to another (64 GB) mini-sdcard which happened to be here. That worked without errors, and the R Pi booted up fine. So, maybe there are some physical errors, we might need to reformat (full format) and copy the files back (instead of cloning.)