Thursday, November 12, 2026

python whole disk backup

To run the equivalent of dd on Linux on a Windows machine using an interactive python script - https://github.com/hn-88/python-interactive-hdd-restore/tree/main

Tested on a Windows 11 ARM VM with VMWare on MacOS host, similar to https://github.com/hn-88/python-interactive-hdd-restore/blob/main/test-setup-on-mac.md


For testing, the TPMS module needed to be removed for the Windows VM - otherwise, it would not allow a new existing hard disk to be added. Copy-pasting Claude's suggestions - 

Clone the VM and decrypt the clone. Shut down the Windows VM, go to Virtual Machine → Create Full Clone, then turn off encryption on the clone.

When trying to change settings on the clone, it asked for a password, which I had forgotten.

Look in Keychain Access (Spotlight → “Keychain Access”). Search for “VMware”, “Fusion”, or the VM’s name. Look for an entry that appears to belong to the VM. Double-click it, tick Show password, and authenticate with your Mac login password. Paste that into the clone’s prompt.

Then changed the settings of the cloned Windows VM - deleted the TPMS module, then it allowed the encryption setting to be changed to unencrypted. Then I could add the Linux vmdk file as another hard disk on the Windows VM.

When backing up to an image, I could connect a USB NTFS disk, and mount it directly in the Windows VM without going through MacOS - 

With the Windows VM running, go to Virtual Machine → USB & Bluetooth in the Fusion menu bar. Pick your drive from the list and choose Connect.

Using Z: mapped to the host did not work initially, because the mapping was not carried over to the Administrator shell. Moreover, that would be slower. Hence, the direct USB mapping above was the way chosen.

Z: is most likely a VMware shared folder or a mapped network drive. Windows keeps drive mappings per logon session, and an elevated (Administrator) terminal is a different session from your normal one. So Explorer can see Z:, but the admin terminal can’t, and Python reports “No such file or directory”. Either re-map the drive inside the admin terminal: 

   net use Z: "\\vmware-host\Shared Folders\MyShare"

or use the UNC path,    
python diskimage.py backup 1 "\\vmware-host\Shared Folders\MyShare\linuxim.gz"

Thursday, October 29, 2026

Moodle migration to freshly installed server - MySQL database migration

This post is linked from this index post - migrating Moodle instances from Azure VMs to AWS EC2 VMs

Here are the steps suggested by Claude for migrating the MySQL databases for Moodle from our old server on an Azure VM to our new server on AWS EC2. 

1. Create the user. Type the password at the prompt, it won't be echoed.
read -rs DBPASS; echo
sudo mysql -e "CREATE USER 'our_db_admin'@'%' IDENTIFIED BY '$DBPASS';"
unset DBPASS
sudo mysql -e "SELECT user, host, plugin FROM mysql.user WHERE user='our_db_admin';"

Error on create user, if any, is probably because user already exists. If the user is listed with
sudo mysql -e "SELECT user, host, plugin FROM mysql.user WHERE user='our_db_admin';"

just set its password using
read -rs DBPASS; echo
sudo mysql -e "ALTER USER 'our_db_admin'@'%' IDENTIFIED BY '$DBPASS';"
unset DBPASS

2. Create .dump.cnf on old server. A configuration file so that we don't need to type in the password for the many scripts which follow.
nano ~/.dump.cnf
with the contents
[client]
host=127.0.0.1
user=our_db_admin
password=dbpass-VALUE-FROM-config.php-HERE

chmod 600 ~/.dump.cnf

3. Dump all four databases. Run this as normal login user on the new server:
mkdir -p ~/dumps && cd ~/dumps
SSH="ssh -p 2022 -i $HOME/.ssh/migrate_key azureuser@OLD-SERVER-IP"

for db in ourdb1_master_db ourdb2_db ourdb3_master_db ourdb4_master_db; do
  echo "dumping $db ..."
  time $SSH "mysqldump --defaults-extra-file=/home/azureuser/.dump.cnf \
    --single-transaction --quick --routines --triggers --no-tablespaces \
    --databases $db | gzip -c" > $db.sql.gz
done
ls -lh ~/dumps

The dumps went much faster than I expected. Less than two minutes for even the largest db.

dumping ourdb2_master_db ...

real 1m46.508s
user 0m0.419s
sys 0m0.329s

...

total 427M


4. Restore and grant: On the new server.

cd ~/dumps
for f in *.sql.gz; do
  echo "restoring $f ..."
  zcat $f | sudo mysql
done

sudo mysql -e "
GRANT ALL PRIVILEGES ON ourdb1_master_db.*   TO 'our_db1_admin'@'%';
GRANT ALL PRIVILEGES ON ourdb2_master_db.* TO 'our_db2_admin'@'%';
GRANT ALL PRIVILEGES ON ourdb3_master_db.*  TO 'our_db3_admin'@'%';
GRANT ALL PRIVILEGES ON ourdb4_master_db.*   TO 'our_db4_admin'@'%';"

5. Verify. Compare table counts on both servers.
Old server:
mysql --defaults-extra-file=$HOME/.dump.cnf -e "SELECT table_schema, COUNT(*) AS tables FROM information_schema.tables WHERE table_schema LIKE our%' GROUP BY table_schema;"

New server:
sudo mysql -e "SELECT table_schema, COUNT(*) AS tables FROM information_schema.tables WHERE table_schema LIKE our%' GROUP BY table_schema;" 

All was well. The db restores took around 15 minutes for the 4 databases.

Tuesday, October 27, 2026

Moodle migration to freshly installed server - apt install and rsync of files

This post is linked from this index post - migrating Moodle instances from Azure VMs to AWS EC2 VMs

Claude's steps for installing the required software on the new Ubuntu 26.04 server, and migrating the old server's Moodle directories over -

Install list (Ubuntu 26.04, PHP 8.5, Apache)
 
sudo apt update && sudo apt upgrade -y
sudo apt install -y unzip git curl cron rsync rclone htop

sudo apt install -y apache2 libapache2-mod-php8.5

sudo apt install -y php8.5-cli php8.5-common php8.5-curl php8.5-gd php8.5-intl \
  php8.5-mbstring php8.5-xml php8.5-zip php8.5-soap php8.5-ldap \
  php8.5-mysql php8.5-pgsql

sudo apt install -y mysql-server postgresql

sudo apt install -y ghostscript poppler-utils graphviz aspell python3

Verify against the old server
 
# on the old server
php -m | sort > php-modules.txt
# on the new server (after copying the file over)
php -m | sort > php-modules-new.txt
diff php-modules.txt php-modules-new.txt

Next steps
  • Copy over the old php.ini settings (upload_max_filesize, post_max_size, max_input_vars ≥ 5000, memory_limit) and the Apache vhosts.
  • Check the MySQL and PostgreSQL major versions match the old server, or are newer, before restoring the dumps. Ubuntu 26.04 ships newer ones than 24.04, which is fine for restoring but not for rolling back. (which was fine for us.)
Claude suggested that I not shift the Moodle instances to postgres during the move - 
Tune MySQL and PostgreSQL for the 8 GB box: innodb_buffer_pool_size of about 1 GB, PostgreSQL shared_buffers of about 512 MB, and a sensible pm.max_children or Apache prefork limit. Whether memory is actually tight on your server depends on the real numbers, so check free -m on the Azure VM at peak load first.

Then, I asked for rclone commands for copying over everything. Claude suggested rsync instead, 

rclone doesn’t preserve file ownership or most permissions, and it can’t copy symlinks to an SFTP destination as real symlinks. 

For checking out the directory structure, Claude suggested some commands, which I supplied. Claude again dissuaded me from changing the architecture to use S3 storage instead of the mapped hard drive - so, as prompted, I created and attached a volume.

In the EC2 console, go to Elastic Block Store → Volumes → Create volume. Choose gp3 and the size. Set the Availability Zone to the same one as your new instance, or it won’t attach.

Then, to mount it,

lsblk -f
sudo mkfs.ext4 -L sssvv_data /dev/nvme1n1

sudo mkdir -p /var/www/ourpath
sudo mount /dev/nvme1n1 /var/www/ourpath

df -h /var/www/ourpath

sudo blkid /dev/nvme1n1

(for finding the UUID=value, for entering below) 

echo 'UUID=PASTE-UUID-HERE /var/www/ourpath ext4 defaults,nofail 0 2' | sudo tee -a /etc/fstab

Test with

sudo umount /var/www/ourpath
sudo mount -a
df -h /var/www/ourpath

sudo chown www-data:www-data /var/www/ourpath

Then, for copying over, Claude preferred tmux over my preference of screen. 

260 GB at a realistic 20-50 MB/s takes roughly 1.5 to 4 hours. Azure charges for outbound data, with some free monthly allowance, so expect a one-time charge of perhaps $10-20 for this copy (check your Azure pricing).

sudo apt install -y rsync tmux

On new server,

ssh-keygen -t ed25519 -f ~/.ssh/migrate_key -N ""
cat ~/.ssh/migrate_key.pub 


Copy-paste the key from the above to the old server,

echo 'PASTE-THE-PUBLIC-KEY-LINE-HERE' >> ~/.ssh/authorized_keyschmod 600 ~/.ssh/authorized_keys

Test on new server with

sudo ssh -i /home/ubuntu/.ssh/migrate_key -o StrictHostKeyChecking=accept-new azureuser@OLD-SERVER-IP 'sudo -n true && echo CONNECTED'

Dry run of copy - 

sudo rsync -aH --numeric-ids --dry-run --stats \
  -e "ssh -p 2222 -i /home/ubuntu/.ssh/migrate_key" \
  --rsync-path="sudo rsync" \
  --exclude='/our_data_disk/' \
  --exclude='/our_php_disk/' \
  azureuser@OLD-SERVER-IP:/var/www/ /var/www/ | tail -25

Then the actual copy inside a tmux instance, without --dry-run and --stats but adding progress -

tmux new -s migrate

sudo rsync -aH --numeric-ids --info=progress2 \
  -e "ssh -p 2222 -i /home/ubuntu/.ssh/migrate_key" \
  --rsync-path="sudo rsync" \
  --exclude='/our_data_disk/' \
  --exclude='/our_php_disk/' \
  azureuser@OLD-SERVER-IP:/var/www/ /var/www/

To reconnect to the tmux shell named migrate,

tmux attach -t migrate

To detach, Ctrl-b and then d

The /var/www rsync completed in just a couple of minutes.

Data copy dry run, excluding some directories which will be regenerated - 

sudo rsync -aH --numeric-ids --dry-run --stats \
  -e "ssh -p 2222 -i /home/ubuntu/.ssh/migrate_key" \
  --rsync-path="sudo rsync" \
  --exclude='/lost+found/' \
  --exclude='/our_*_data/cache/*' \
  --exclude='/our_*_data/localcache/*' \
  --exclude='/our_*_data/sessions/*' \
  --exclude='/our_*_data/temp/*' \
  azureuser@OLD-SERVER-IP:/var/www/our_data_disk/ /var/www/our_data_disk/ | tail -25

and similarly, replacing --dry-run --stats with --info=progress2 --partial inside tmux for the actual run. 

This rsync completed in just over 2 hours,
166,623,277,225 100%   21.67MB/s    2:02:12 (xfr#125429, to-chk=0/254935)




 

can I skip assigning IPV4 addresses to save money

Asked Claude, would Moodle be able to reach moodle marketplace for updating plugins if I opt to not assign a ipv4 address, and assign only ipv6 and point cloudflare with proxying and the AAAA record? As of now, AWS charges for IPV4 records, while IPV6 records are free.

Claude's reply was that I should test it myself, but 

GitHub has no IPv6 support as far as I know, so git clone and Composer downloads from GitHub would fail.

Since that was a deal-breaker, I went with assigning Elastic IPs to all the VMs.

confirm if our custom CMS has no x86-only binaries or PHP extensions

Contemplating a move to a possibly cheaper ARM server, asked Claude how to check if our applications would run on ARM, or if there are any x86-only binaries. Claude's suggestions below.

Find compiled binaries in the codebase - 
To run from the web root -
# List every non-text executable/library and its architecture
find . -type f \( -perm -u+x -o -name "*.so" -o -name "*.a" -o -name "*.bin" \) \
  -exec file {} \; | grep -v -E "ASCII|text|script"

Anything reported as ELF 64-bit LSB ... x86-64 is a problem. 

Also to check external programs - 

grep -rnE "exec\(|shell_exec|system\(|passthru|proc_open|popen|\`" --include=*.php .

This shows every external program the CMS calls (e.g. wkhtmltopdf, ffmpeg, ghostscript, imagemagick, pdftotext). Most of these have ARM64 builds in Ubuntu/Debian repos, but a bundled x86 copy inside your repo won’t work.

I needed to do
sudo apt install file
to run the above.

Our CMS was fine. Inside the Moodle directory, running the same command started listing all sorts of .png files and so on.

Claude suggested,

Filter for ELF instead:
cd /path/to/moodle
find . -type f -exec file {} + | grep "ELF" | grep "x86-64"

Then there were the suggestions which I did not need to follow, because I already knew the answer.

Check PHP extensions - Anything installed through PECL or compiled by hand, or vendor specific or proprietary

(we had none.)
Check for native helpers outside PHP - 
Cron jobs and systemd services: crontab -l, ls /etc/cron.*, systemctl list-units --type=service
Custom scripts in /usr/local/bin and /opt: file /usr/local/bin/* /opt/*/*

(we had none.)

So, our migration could have been done to an ARM processor. But we didn't, since the Mumbai zone / region didn't have spare ARM capacity.

migrating Moodle instances from Azure VMs to AWS EC2 VMs

Just a few days after we upgraded Moodle from 4.5 to 5.3 as in this earlier post, we had to migrate from Azure to AWS. To try out how good it would be, I prompted Claude.ai to first give me an appropriate configuration, then to step by step carry out the migration. I'll document what I did in a series of posts instead of as a single post, with this post linking to all the series.

Initial idea was to use a single ARM EC2 instance, since that is the cheapest. But found that in the Mumbai zone of Asia-Pacific region, the price difference between ARM and x86_64 was not significant, and also ARM was capacity constrained there. So, went with t3.large (burstable, two vcpus, 8 GB RAM) and an attached data disk instead of the possibly cheaper S3 storage.

But before that, I'd explored feasibility of using ARM cpus - 
So, I provisioned and started up, and asked Claude to list all the apt install commands I would need, and also the rsync commands I would need.
Moodle migration to freshly installed server - MySQL database migration 
Postgres database migration (documentation TBD)
Migrating scripts and Apache vhosts
Letsencrypt with Cloudflare proxying
Migrating the backup strategy
Migrating awstats
Tuning MySQL
Backup scripts for databases and moodle data

...More coming soon ...


Thursday, October 22, 2026

Moodle - Learner unable to move forward after completing an activity

One of our Moodle instances had an issue, as reported by the admin -  

This is an H5P page with a Video (not an interactive video), a Drag-and-drop (16 drops), an Image (reading material), and a single-choice set (5 questions), totalling 21 marks. The completion conditions are View, Receive a grade, and Receive a passing grade. 

While a few testers moved forward, this <particular user> could not. I tried a few times (using login as option), no luck. I even marked the activity completed thru the Activity Completion report. Yet, she is unable to go to the next activity. 
I unenrolled <particular user> from the course and enrolled, but the system remembers 
<particular user>

Every time I try to complete the activity, the system randomly shows the previous answers as incorrect. Even though I have provided correct answers to all the questions, some were displayed with options that I did not choose.

Conversation with Claude for my reference - https://claude.ai/chat/5e1f6865-4079-4118-ac93-5f23ef652602

Passing on that info (checks mentioned by Claude) did not help the situation. 

To understand the issue, I tried "log in as" that user, and went to the problematic section. 

There, I saw that the "Check your understanding" questions have only 1 correct answer out of 5, but probably the admin override has changed the grade to 5/5. This might have caused the inability to proceed further, since that activity is set to "receive a passing grade" and the passing grade is set to 100% but only 1/5 was actually correct. 

I changed the completion criteria to "receive a grade", "any grade" for that activity.

Then, when I 'log in as' that user, I got a pop-up saying grading has changed, "you have to retake that activity".

So I started completing that activity, completed it successfully.

There is a link there to "go back to course", as the workaround as mentioned in 

https://hnsws.blogspot.com/2026/07/h5p-page-in-moodle-does-not-show-next.html

Now, when I 'log in as' that user, the user can again retake that activity.

This seems to solve the problem.

So, if such an issue is faced with course completion with an activity, on making a small change in the course activity, the user will be prompted to retake the activity. (Claude also suggests --> "Open the activity and go to the Attempts report. Delete this learner's attempts. Moodle will then treat them as having no attempt." <-- I have not tested whether such a method works.)

If required, now the completion criterion can be changed back to 'receive a grade' and 'passing grade' instead of 'any grade'.

Monday, October 12, 2026

upgrading Moodle 4.5 on Ubuntu 24.04 to Moodle 5.3 on Ubuntu 26.04

Initial backup snapshot

https://allinonelms.com/blog/moodle-5-3

says we have one year time before moving from 4.5 to 5.3, so we can wait for Dec, Moodle 5.3.1, if plugins break. But we went ahead, and plugins broke. 

Our Ubuntu install also needed to be upgraded from 24.04 to 26.04, since MySQL 8.4 is required by Moodle 5.3.

The idea is to use sudo do-release-upgrade
(if no upgrade is available, it will tell us)
after taking a backup snapshot.

Duck.ai gave the detailed steps for 

  1. create a snapshot of the original OS disk,
  2. generate a new managed disk from that snapshot,
  3. then deploy a new virtual machine using the new managed disk. 
I did only 1. and 2., did not need to do 3. It just took a few seconds to create snapshot and generate a new managed disk from the snapshot, for our 45 GB OS disk. Just to be safe, I stopped the services, then stopped the VM, then took the snapshot.

sudo service apache2 stop
sudo service postgresql stop
sudo service mysql stop


Gemini, on prompting, listed the disadvantages of upgrading vs creating a new VM from scratch, like the need to choose old vs new config files, the need to have downtime, etc. (private link to conversation is here for my reference, https://aistudio.google.com/prompts/1X_RhD-CQTQS1DdVHShfBhK67VxMp6uYk )

Since the CMS PHP code would also be migrated to PHP 8.5 with this upgrade, tested for breaks using Antigravity - just fed in the code, and asked for what to patch. Only the deprecated FILTER_SANITIZE_STRING in login-action.php and a suggested composer update for dependencies

sudo -u www-data composer update --no-dev --optimize-autoloader

(If done with sudo, would need 
sudo chown -R www-data:www-data /var/www/html/vendor
sudo chown www-data:www-data /var/www/html/composer.lock
)

To have a temporary 'Site under Maintenance' message, a cloudflare redirect to a page hosted on github pages, Rules > Overview > Redirect rules - struggled a bit to find the location of the redirect rules page, private link to conversation is at https://aistudio.google.com/prompts/1iFwSbjXsmI1TsYEIIlQcxvDM0VfolK2I 


Errors during the do-release-upgrade

While doing the do-release-upgrade after saving the snapshot, these were the problems observed.

rclone warning - not from ubuntu repos.
will need to reinstall, maybe.

login.defs - chose to upgrade

Postgres said,
Success. Please check that the upgraded cluster works. If it does,
you can remove the old cluster with
    pg_dropcluster 16 main

certbot not upgraded, dependency problems.

Package apache2 is not configured yet. Will defer actions by package libapache2-mod-php8.5.
Processing triggers for dbus (1.16.2-2ubuntu4) ...
Errors were encountered while processing:
 apache2
 python3-certbot-apache
needrestart is being skipped since dpkg has failed
packages have been installed but needrestart is suspended

etc.

dpkg: error processing package python3-certbot-apache (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 apache2
 python3-certbot-apache

Upgrade complete

The upgrade has completed but there were errors during the upgrade
process.

To continue please press [ENTER]
=== Command detached from window (Sun Oct 11 04:49:30 2026) ===

Gemini, in this conversation, https://aistudio.google.com/prompts/1ySB2bg3r8w23ODeVyiyw-hyOXi-u8gmI said that we can safely reboot, the issue is with apache (and since apache is required for certbot, that fails too). Apache would be loading the old PHP versions, we have to disable PHP 8.3 and enable PHP 8.5. But

sudo a2dismod php8.3
ERROR: /etc/apache2/mods-enabled/php8.3.load is not a symbolic link, not deleting
ERROR: /etc/apache2/mods-enabled/php8.3.conf is not a symbolic link, not deleting
Module php8.3 disabled.

So somewhere the mods-enabled got turned into real files. Had to find all real files (and not links) with

sudo find /etc/apache2/*-enabled/ -type f

and delete all of them. 

sudo bash -c '
# Fix conf-enabled
for file in /etc/apache2/conf-enabled/*; do
    if [ -f "$file" ] && [ ! -L "$file" ]; then
        name=$(basename "$file")
        if [ -f "/etc/apache2/conf-available/$name" ]; then
            rm -f "$file"
        else
            mv "$file" "/etc/apache2/conf-available/$name"
        fi
        ln -s "../conf-available/$name" "$file"
    fi
done

# Fix mods-enabled
for file in /etc/apache2/mods-enabled/*; do
    if [ -f "$file" ] && [ ! -L "$file" ]; then
        name=$(basename "$file")
        if [ -f "/etc/apache2/mods-available/$name" ]; then
            rm -f "$file"
        else
            mv "$file" "/etc/apache2/mods-available/$name"
        fi
        ln -s "../mods-available/$name" "$file"
    fi
done
'

Now 
sudo apache2ctl configtest
was OK, and restarting apache followed by dpkg 

sudo systemctl restart apache2
sudo dpkg --configure -a

fixed certbot also. Then, since postgres 18 was running fine,

sudo pg_dropcluster 16 main

sudo apt purge "postgresql-16*"
sudo apt autoremove


Clear browser host cache for testing, git upgrade

Flush DNS and test - Edge browser on Linux, method suggested by ChatGPT 

https://chatgpt.com/c/6acb1b41-4d04-83e8-a31f-f6958c4a2bbb
has many more testing and dns tips.

edge://net-internals/#dns
and choose Clear host cache.
and choose Flush socket pools.

Then the actual Moodle upgrade using git,
https://chatgpt.com/c/6acb1c57-0e94-83e8-aa2a-31ae3e8f9ef0
git branch -r
to list the remote branches, and then, following 
or

git branch --track MOODLE_503_STABLE origin/MOODLE_503_STABLE
git checkout  MOODLE_503_STABLE

sudo chown -R azureuser:www-data .
sudo chmod -R 775 .

sudo -u www-data /usr/bin/php admin/cli/upgrade.php 

At this point, after the upgrade completed, we needed to install all the PHP modules needed by Moodle 5.3.


Post-install fixes

Took the help of chatgpt to generate the commands needed to install all the required PHP modules,
sudo apt update

sudo apt install \
  php8.5-cli \
  php8.5-common \
  php8.5-curl \
  php8.5-gd \
  php8.5-intl \
  php8.5-mbstring \
  php8.5-mysql \
  php8.5-xml \
  php8.5-zip

/usr/bin/php --ini # to find the ini file path
Loaded Configuration File: /etc/php/8.5/cli/php.ini


Edit both the cli as well as the apache php.ini files to bump
max_input_vars = 5000

upload_max_filesize = 100M
post_max_size = 110M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300


Needed to change the sites' document root in the sites-available of apache to append /public to the existing DocumentRoot value. Copied the "missing from disk" plugins to the public directory by asking chatgpt to write the commands as below,

cd /var/www/theMoodlegit

for plugin in \
    mod/quiz/accessrule/proctoring \
    admin/tool/tcpdffonts \
    availability/condition/othercompleted \
    availability/condition/stash \
    course/format/onetopic \
    course/format/remuiformat \
    course/format/tiles
do
    destination="public/$plugin"

    if [ -d "$plugin" ] && [ ! -e "$destination" ]; then
        sudo mv "$plugin" "$destination"
        echo "Moved $plugin"
    else
        echo "SKIPPED $plugin — check source and destination"
    fi
done

Had to install composer and run it, since Moodle 5.1 onwards use composer for dependencies. Without doing this, some plugins were complaining of Mustache errors, file not found etc. https://claude.ai/chat/427274e2-d874-4b60-b744-2989d51b6b72

sudo apt install composer

cd /var/www/theMoodlegit
composer install --no-dev --classmap-authoritative # (for each instance.)

Router not configured message still shows up, we need to follow the guide to set it up, would be mandatory for future versions of Moodle.

Lots of warnings like

PHP Deprecated:  Function xml_parser_free() is deprecated since 8.5, as it has no effect since PHP 8.0 in /var/www/theMoodlegit/public/lib/classes/xml_parser.php on line 190

ChatGPT recommends ignoring it till the Moodle team removes it, since Moodle 5.3 officially does not support PHP 8.5.

The installation and fixes so far took from 9 am to 2 pm with an hour's lunch break. The next day, the following were also fixed.

Theme edits and unsupported plugins 

Fix for duplicate logo appearing, by adding these lines to the Raw SCSS of Moove theme,

/* Dark mode is disabled, so hide the duplicate dark logo */
nav.navbar .navbar-brand img.logo.dark { display: none !important; }

Site Administration > Appearance > Themes > (gear icon of Moove theme) > Advanced tab > Raw SCSS textbox

(This duplication was a side-effect of us removing the Connectime branding logo advertisement of the Moove theme in SCSS.) 

Later, users found problems with courses using formattype onetopic (which has not been updated to support Moodle 5.3) - https://claude.ai/chat/5c5a6dd0-e0b9-4bfb-a41f-4b8062fabef6 - changed to topics instead in the database to fix,
UPDATE mdl_course SET format = 'topics' WHERE format = 'onetopic';
(after first trying it for a single course and testing.)

Similar fix for some other courses which were using formattype tiles - in that case, only the edit mode was affected, so the teacher admins could themselves change the course formattype to Multitopic (which is topics in the db) in the Course Settings in the UI.


Saturday, October 10, 2026

rhino runtime error for asset search

One of our Google Apps scripts failed with "Execution failed. The Rhino runtime is deprecated and no longer supported."

According to Gemini - 

You must first migrate the script to Google’s modern V8 JavaScript engine.
 ...

Step 1: Enable the V8 Runtime

Before you deploy, you have to tell Google Apps Script to use the new engine.

1.  Open your Google Apps Script project.
2.  Click on the Project Settings (the gear icon ⚙️) on the left sidebar.
3.  Under the "General settings" section, look for "Enable Chrome V8 runtime for
    Apps Script" and check the box. (Note: Alternatively, if you use the
    appsscript.json manifest file, you can manually add "runtimeVersion": "V8"
    to the file).

Step 2: Fix Incompatible Code (If necessary)

Because Rhino was an ancient version of JavaScript, it allowed some non-standard
syntax that the modern V8 engine does not support. When you switch to V8, you
may need to make minor updates to your code:

  - for each loops: Rhino allowed for each (var item in list). In V8, you must
    change this to modern JavaScript: for (var item of list).
  - __iterator__: If your code relied on custom iterators using __iterator__,
    you will need to replace them with ECMAScript iterators.
  - Run your script in the editor to ensure it executes without syntax errors.
    V8 supports modern JS features (like let, const, and arrow functions), so
    your code will likely run faster once fixed.

Step 3: Create a New Deployment

Once you have enabled V8 and tested the code, then you must re-deploy the
script.
S fixed it.

Thursday, October 08, 2026

interesting results with 60 Moodle users logged in

One of our Ubuntu servers hosting Moodle instances had been bumped from D2asv5 (8 GB RAM) to D32asv5 (128 GB RAM) anticipating 100+ users for a training event. Interestingly, even with 60+ users logged on simultaneously, RAM usage did not cross 8 GB. So, tried using D4asv5 (16 GB RAM) for this standalone server, and then tried even not bumping it up from D2asv5. But with D2 (2 cpu cores), the CPU was continuously pegged at 100%, with load average going up to 15. Probably better to bump up to D4. Logging was via https://github.com/hn-88/log-memory-cpu-usage as mentioned in the previous post, and emails being sent to me similar to this - https://hnsws.blogspot.com/2021/02/scripts-to-alert-admin-when-hard-disk.html

(for my reference, conversation with Gemini to find the number of logged in users - and what they were doing - is at https://aistudio.google.com/prompts/1rp43v9LvY7d-b6pk82fgF0dDVQPWmJh8 )

Suggested database queries were - 

SELECT COUNT(DISTINCT l.userid) AS unique_users_active
FROM mdl_logstore_standard_log l
WHERE l.timecreated BETWEEN [START_UNIX_TIMESTAMP] AND [END_UNIX_TIMESTAMP]; 

to find the number of logged in users, and to see what they were doing, 

SELECT 
    u.username, 
    u.firstname, 
    u.lastname, 
    FROM_UNIXTIME(l.timecreated) AS time_of_action,
    l.eventname, 
    l.component, 
    l.target
FROM mdl_logstore_standard_log l
JOIN mdl_user u ON u.id = l.userid
WHERE l.timecreated BETWEEN [START_UNIX_TIMESTAMP] AND [END_UNIX_TIMESTAMP]
ORDER BY l.timecreated ASC;

Edit: Digging deeper, the limited RAM use is probably due to the MaxRequestWorkers setting in Apache settings as per https://docs.moodle.org/503/en/Performance_recommendations#Apache_Performance

Wednesday, October 07, 2026

query to find number of concurrent users - and what they are doing - in Moodle

(for my reference, conversation with Gemini is at https://aistudio.google.com/prompts/1rp43v9LvY7d-b6pk82fgF0dDVQPWmJh8 )

Query to run on the database to find the number of concurrent users - 

SELECT COUNT(DISTINCT l.userid) AS unique_users_active
FROM mdl_logstore_standard_log l
WHERE l.timecreated BETWEEN [START_UNIX_TIMESTAMP] AND [END_UNIX_TIMESTAMP]; 

and similarly, to know what they were doing,

SELECT 
    u.username, 
    u.firstname, 
    u.lastname, 
    FROM_UNIXTIME(l.timecreated) AS time_of_action,
    l.eventname, 
    l.component, 
    l.target
FROM mdl_logstore_standard_log l
JOIN mdl_user u ON u.id = l.userid
WHERE l.timecreated BETWEEN 1791281400 AND 1791285000
ORDER BY l.timecreated ASC;

convert UTC to IST in Google Sheets

 Running this simple memory and cpu logger on one of our servers, the timezone on that machine is UTC, to view in IST, we just have to add 5 hours and 30 minutes, like

=A2 + TIME(5, 30, 0)

Monday, October 05, 2026

getting started with Antigravity

Got access to Google Antigravity (via a telecom provider free offer for subscribers on 5G in India). This is google's agentic coding platform, where you just tell the agent to do specific tasks, and it will do the rest, like in their intro video. I'm exploring making antigravity write code to make OpenSpace run natively on Mac using OpenGL to Metal translation via MGL - where in the best case scenario, we might be able to see native performance similar to what we found with VMWare's driver.

Thursday, October 01, 2026

increasing per user quota in Google WorkSpace

There was a request from a user to increase the Google WorkSpace storage quota from 15 GB to 100 GB for two accounts. 

I asked Gemini via aistudio.google.com how I can increase the quota of a single user, (without changing their Organizational Unit quota) and it showed me this method. Accordingly, have set 100 GB for the group called higher storage users - the two user accounts have been added as members. Later, I got a confirmation from them that the quota increase was successful.
Here is how the admin can do it:

  1. Create a Group: In the Google Admin console, go to Directory > Groups and create a new group (e.g., "Higher Storage Users"). Add the single user to this group[3].
  2. Navigate to Storage: Go to Menu > Storage[4].
  3. Manage Limits: Under the Storage settings section, click Manage[4].
  4. Select the Group: On the left-hand panel, search for and select the configuration group you just created[3][4].
  5. Set the New Quota: Turn on the User storage limit, enter the new, higher storage amount for that user, and click Save[2][3].
Note: Group limits override Organizational Unit (OU) baseline limits, making this the best way to handle one-off storage increases.[3]

And the references cited were:

Sunday, September 27, 2026

Raspberry Pi reinstall - went back to cloning instead

One of the raspberry pis in our waiting area was not booting. Some files appeared to have been corrupted - the Disks utility in Linux Mint found many errors. 

Thought I would reinstall the OS with the latest version.  Via duck search ai, identified the board - "The Raspberry Pi Model B (2011-era board) has a yellow RCA composite video connector and a full-size SD card slot." 

After reinstalling, "To set your Raspberry Pi Model B to use composite video output by default, you need to edit the /boot/config.txt file and add the line hdmi_ignore_hotplug=1 to disable HDMI output. Additionally, set the video mode by adding sdtv_mode=2 for PAL or sdtv_mode=0 for NTSC, then reboot the device. This will ensure that the composite output is used as the default display."

Still didn't work.

Tried with HDMI, then came to configuration screen after 2-3 minutes.

But saving the locale took more than 5 minutes?

So, trying sdcard integrity with f3


f3write: Can't create file ./1.h2w: Permission denied

so

sudo f3write /media/sssvv/rootfs/

1 hour 35 minutes or so shown to write to the ~52 GB free.

Creating file 16.h2w ... OK! Avg: 9.20 MB/s            
Min: 4.85 MB/s, Max: 12.88 MB/s, 100 samples
Creating file 17.h2w ... OK! Avg: 9.30 MB/s            
Min: 4.89 MB/s, Max: 13.01 MB/s, 100 samples
Creating file 18.h2w ... 33.08% -- 9.04 MB/s -- 1:04:43
...
Creating file 53.h2w ... OK! Avg: 8.32 MB/s            
Min: 4.24 MB/s, Max: 12.81 MB/s, 35 samples
Free space: 16.00 MB
Average sequential write speed: 9.19 MB/s (109773304 sectors / 1:37:13)


The files are seen in the root directory of /media/sssvv/rootfs/ and could be deleted after the test. 

But after reinstall with latest rpi legacy image of 2025, various issues like taking a long time to boot, video out not working even after sudo raspi-config set to video out enabled, etc (using HDMI output)

Instead, just cloning from the working sdcard on the other raspberry pi.


Instead of exactly the same commands, increased block size (and used pigz, which might be irrelevant) to make it faster.

sudo dd if=/dev/sdc bs=16M status=progress | pigz -c > waitingvideos.image.gz
31914983424 bytes (32 GB, 30 GiB) copied, 1914 s, 16.7 MB/s
1902+1 records in
1902+1 records out
31914983424 bytes (32 GB, 30 GiB) copied, 1913.54 s, 16.7 MB/s

# gunzip -c waitingvideos.image.gz | dd of=/dev/sdc status=progress
31911858688 bytes (32 GB, 30 GiB) copied, 6398 s, 5.0 MB/s
62333952+0 records in
62333952+0 records out
31914983424 bytes (32 GB, 30 GiB) copied, 6398.28 s, 5.0 MB/s

107 minutes, or 1:47 hours.



Tuesday, September 22, 2026

email problem - SPF and DKIM records

One of our admins reported a problem with replying to mails - they use Zoho - and copy-pasted Claude's solution - 

1. Modify the SPF record to include the zoho domain also - 
- Current value: v=spf1 include:zeptomail.net ~all
- New value: v=spf1 include:zoho.com include:zeptomail.net ~all

2. Publish the DKIM key. In Zoho Mail Admin Console > Domains > ourdomain.in > Email Configuration > DKIM > add selector. Zoho shows you a long key, which is to be added as a DNS TXT record.

The first time we did it, the DKIM record was sent to me by WhatsApp, and perhaps there was some non-printing character or line-break in the middle of the key, because of which the validator tool at https://mxtoolbox.com/SuperTool.aspx complained of invalid syntax for the DKIM key. Then I was sent the record by email as requested, and this time, copy-pasting it into Cloudflare's dashboard worked fine and the validator passed it. Currently no DMARC records are added, we can add those later if need be. And the problem seems to be solved.

Wednesday, September 16, 2026

updating to MacOS 27

The M4 Mac mini asked to download 13+ GB and update MacOS to version 27, Golden Gate - upgrading from MacOS Tahoe 26.6. Since the office fiber internet was down, I hesitated to start the process using Airtel 5G - but since 5G is supposed to be unlimited on my plan, went ahead.

It took nearly 90 minutes to complete the whole update, probably because while downloading, the 5G network was dropping down to 4G and getting throttled due to exhausting today's quota. On 5G, the download was happening at 30-45 Mbps. 

Interestingly, even after the "Downloading" phase completed and the "Preparing" phase started, there was still plenty of downloading activity as seen in Activity Monitor app. "Preparing" took half an hour. Then 8 minutes on the Apple logo screen while restarting. 

traceroutes just for general interest

I had asked an LLM about the network backhaul used by our ISPs like Airtel, BSNL etc, and was told that while there was no publicly available information about the actual specifications of their backhaul, a traceroute might give more information. Some traceroutes to google.com and nebula.tv from BSNLindicated that they terminated at their Points of Presence - POPs in Chennai - nebula.tv via Cloudflare. With Airtel, google.com seems to go to a Mumbai POP - bom.

traceroute to google.com (142.250.183.174), 64 hops max, 40 byte packets
 1  10.219.86.239 (10.219.86.239)  3.068 ms  3.368 ms  3.003 ms
 2  * * *
 3  192.168.116.2 (192.168.116.2)  64.774 ms  35.220 ms  29.967 ms
 4  * * *
 5  * * *
 6  125.21.99.61 (125.21.99.61)  36.796 ms
    dsl-ncr-dynamic-013.32.23.125.airtelbroadband.in (125.23.32.13)  28.051 ms  44.851 ms
 7  182.79.177.69 (182.79.177.69)  40.855 ms
    116.119.68.247 (116.119.68.247)  47.689 ms
    116.119.161.183 (116.119.161.183)  40.998 ms
 8  * 142.250.169.206 (142.250.169.206)  58.361 ms *
 9  142.250.230.197 (142.250.230.197)  158.451 ms *
    64.233.174.17 (64.233.174.17)  289.370 ms
10  142.251.55.67 (142.251.55.67)  38.116 ms
    142.251.55.230 (142.251.55.230)  233.997 ms
    142.251.55.42 (142.251.55.42)  37.590 ms
11  142.251.55.65 (142.251.55.65)  38.276 ms
    142.251.55.67 (142.251.55.67)  41.114 ms
    172.253.71.132 (172.253.71.132)  37.117 ms
12  bom07s32-in-f14.1e100.net (142.250.183.174)  58.148 ms  35.764 ms
    142.250.62.67 (142.250.62.67)  42.145 ms

Then, a couple of traceroutes to a US server, from BSNL fiber to home network done from a Windows machine

tracert ourdomain.org

Tracing route to ourdomain [redacted]
over a maximum of 30 hops:

  1     1 ms    <1 ms    <1 ms  192.168.1.1
  2     2 ms     4 ms     2 ms  117.192.80.1
  3     4 ms     3 ms     3 ms  10.219.29.194
  4     *        *        *     Request timed out.
  5     *        *        *     Request timed out.
  6    13 ms    13 ms    13 ms  10.200.120.225
  7     *        *        *     Request timed out.
  8    15 ms    14 ms    15 ms  115.110.161.189.static.vsnl.net.in [115.110.161.189]
  9    37 ms    50 ms    37 ms  172.25.199.34
 10    37 ms    36 ms    38 ms  172.28.124.134
 11    39 ms    36 ms    75 ms  172.25.138.206
 12     *        *        *     Request timed out.
 13     *        *        *     Request timed out.
 14     *        *        *     Request timed out.
 15     *      278 ms     *     if-bundle-12-2.qcore2.pvu-paris.as6453.net [80.231.245.13]
 16   272 ms   271 ms     *     ae0.cr2.dfw7.us.zip.zayo.com [64.125.20.63]
 17   272 ms   272 ms   293 ms  ae1.cr2.chd4.us.zip.zayo.com [64.125.25.76]
 18   257 ms     *      353 ms  ae9.cr1.phx4.us.zip.zayo.com [64.125.27.186]
 19     *        *        *     Request timed out.
 20   274 ms   272 ms   273 ms  64.125.199.194.IDIA-409280-003-ZYO.zip.zayo.com [64.125.199.194]
 21   241 ms   246 ms   241 ms  core1-edge2-lag1.phx1.codero.com [216.55.160.6]
 22   254 ms   251 ms   251 ms  216-55-160-81.dedicated.codero.net [216.55.160.81]
(and the next hop was our server in Phoenix.)

So apparently BSNL routed this request via Tata Communications (vsnl), via Paris interconnect to Zayo, and there to Phoenix. Of course, routes would vary from time to time, too.

Trying from a Mac via Airtel 5G network,

traceroute ourdomain.org
traceroute to ourdomain.org (redacted), 64 hops max, 40 byte packets
 1  10.219.86.239 (10.219.86.239)  3.615 ms  2.808 ms  2.575 ms
 2  * * *
 3  192.168.116.2 (192.168.116.2)  28.903 ms  32.648 ms  70.657 ms
 4  * 192.168.116.49 (192.168.116.49)  42.654 ms  33.930 ms
 5  * * *
 6  dsl-ncr-dynamic-013.32.23.125.airtelbroadband.in (125.23.32.13)  49.859 ms
    125.21.99.61 (125.21.99.61)  60.570 ms
    dsl-ncr-dynamic-013.32.23.125.airtelbroadband.in (125.23.32.13)  27.138 ms
 7  116.119.167.20 (116.119.167.20)  249.939 ms
    116.119.167.119 (116.119.167.119)  339.057 ms
    116.119.167.20 (116.119.167.20)  251.139 ms
 8  * * *
 9  be3271.ccr41.lax01.atlas.cogentco.com (154.54.42.101)  348.294 ms  258.764 ms  332.531 ms
10  be2932.ccr32.phx01.atlas.cogentco.com (154.54.45.161)  284.207 ms
    be2931.ccr31.phx01.atlas.cogentco.com (154.54.44.85)  256.272 ms  418.788 ms
11  be3452.rcr21.phx02.atlas.cogentco.com (66.28.4.242)  308.459 ms
    be3451.rcr21.phx02.atlas.cogentco.com (66.28.4.26)  432.845 ms  248.367 ms
12  38.122.88.107 (38.122.88.107)  253.042 ms  252.078 ms  246.671 ms
13  core1-edge1-lag1.phx1.codero.com (216.55.160.4)  273.957 ms  253.373 ms  259.721 ms
14  59-160-55-216.dedicated.codero.net (216.55.160.59)  303.754 ms  307.035 ms
    216-55-160-71.dedicated.codero.net (216.55.160.71)  259.048 ms
15  ourdomain.org (redacted)  444.128 ms  405.611 ms  409.528 ms

In this case, the route seemed to be within Airtel (Bharti Telecom) till the 8th hop, and then directly LA and then Phoenix.

 

Tuesday, September 15, 2026

unable to update plugins after a Moodle update

After upgrading our 4 Moodle instances to the latest minor version, 

Site Administration > Plugins > Plugins overview > Check for available updates button returns "Unable to fetch available updates data - unexpected HTTP response code."

Probably the cause is Moodle's Cloudflare ray rejecting the request from our server with a 403 (I verified that it was sending a 403 with curl) as mentioned in this thread, https://moodle.org/mod/forum/discuss.php?d=429373

So I'll try again later.

Monday, September 14, 2026

exporting all LLM conversations to a private repo

Started work on exporting all conversations from Gemini (via aistudio.google.com), Claude, ChatGPT and Github Copilot to a private repo. 

Claude was the simplest - clicking on my initials (bottom left) → Settings → Privacy → Export data
Got an email with a download link (valid ~24 hours) containing a ZIP of your full conversation history as JSON files within a minute. The download link actually downloaded a json file, which had links to the actual conversations and metadata zip file downloads. Then, parsed the conversations using https://github.com/tyashin/Claude-export-data-parser and a full indexed repo of markdown files was ready for me to sync to my private repo.

OpenAI says it will take a few days for them to prepare and send me the export - had to do the export from the Android app, the web version just went into a loop with Confirm export > ask for one-time password sent to email > Confirm export > ask for one-time password sent to email ... The export initiated from the Android app successfully sent an email to me with "ChatGPT - Your data export has started" and the next day, I got an email with "ChatGPT - Your data export is ready" and a download link. The data export included json files as well as a large chat.html file. Unfortunately, the chat.html had only the text of the  conversations, but no date info. So, following the path of creating a json parser for this data too, as mentioned below.

AIStudio did not seem to have any export ability, even with google takeout (please see the next paragraph). Third-party tools can scrape and export as json, what worked for me was saveai.net AI Chat Exporter. Now I've to parse the json and create an index like Claude-export-data-parser does for Claude. 

Correction to the above paragraph - AIStudio seemed to be storing all conversations in Google Drive, and downloading the directory "Google AI Studio" as a zip file seemed to get us all the conversations.

Made this public repo - https://github.com/hn-88/ai-json-parsers - with the json-to-markdown conversion python scripts generated by Gemini and Claude, which would parse the json files exported by each service and create an indexed set of markdown files. When I host this on github, (in a private repo, since some info does not need to be public) I can search for phrases in all the conversations as well as have a detailed reference of all the LLM replies (some of which are wrong, some of which are useful.)

Sunday, September 13, 2026

resizing Azure VM - moved to D2asv5

There was a request to bump up the capacity of a Moodle instance for an in-person workshop on 12th and 13th. 

Used Chrome on Android to log in to the Azure portal, shut down the instance and size it higher (D2asv4 8 GB to D4asv5 16 GB).

When down-sizing it back, found that D2asv5 (<$41 per month) was cheaper than the original D2asv4 (<$46 per month). So, used D2asv5 8 GB instead.

Saturday, September 12, 2026

app for automating sending of SMS / WhatsApp messages

This is what it does:
1. take the phone number from the clipboard
2. check if that number has an associated whatsapp account
3. If whatsapp account exists, create a preformatted whatsapp message to that whatsapp account - i.e. opens Whatsapp with the draft message, which the user can then send
4. creates an SMS draft too, in the default SMS app, which we can send if required.

Created with Claude in just one prompt - what I wanted initially, and the sequence of prompts, is at
and the one issue with the generated code and fix are at

Friday, September 11, 2026

repeated Cloudflare "human check"

One of our content admins wrote,

For the past week (or so), each time we go to our website, and even click on a sub-page, etc, Cloudflare makes us check that we are human (not a bot). See screenshot attached. 
Do you experience this as well, or is it just me?

It is a bit annoying to do it for EVERY page. Is there a way to do it randomly, or at least once (so it knows this IP address is fine), etc.?

Another admin mentioned that 

I remember (another) website team making some changes to the Cloudflare settings following the phishing attacks and bot injection issues we faced on the (other) website. I believe the human verification check you are seeing could be related to those security measures.  

And I added,

I think one way to avoid getting the bot-check "every time" would be to keep a tab open with a page from our domain - then the session would remain open for around 10 minutes, and any other page in our domain you open within those 10 minutes will not ask you for a bot-check. If you are doing some content editing work which takes more than 10 minutes, if you navigate to another page in the open tab within 10 minutes or refresh that page within 10 minutes, you can avoid the bot-checks.


logo update for sign-in with Google screen

One of our CMS admins mentioned that the 'Sign in with Google' screen still displays the old logo, and that it needed to be replace with the new logo of the organization.

The process according to Claude was,

  1. Go to Google Cloud Console → select your project.

  2. Navigate to APIs & Services → OAuth consent screen (in newer UI it may be under APIs & Services → Branding).

  3. Under the App information section, you'll see an App logo field — upload your logo there (square image, recommended 120x120px, max 1MB, JPG/PNG/BMP).

  4. Save changes. 
I had to find the account under which the project had been created from our old emails - there is no way to easily find the email id under which the project was created from the project id which is present in the php code. But Claude says that the Super Admin for Google Workspace can give themselves the permissions in order to get this info, but I did not try it. Private URL for my reference, https://claude.ai/chat/5e521ed1-ec1a-4301-8c89-f7a21939b6e1

Thursday, September 10, 2026

Moodle - Video not displayed for some users

The admin of one of our Moodle instances had this issue, "A few users have reported (I joined on Google Meet and checked) that when they play the videos in the courses (Learning site), nothing happens. "

After some back and forth, because some videos were playing, found that at least some of the problematic videos were embedded with H5P - mod_hvp in Moodle.

For the videos embedded using h5p - those videos which have mod/hvp in their URLs, the solution for this problem, as we have seen in the earlier post about this issue, is to upgrade the HVP libraries.

For the videos which are on one of the instances, we had gone through the process of upgrading the mod_hvp video libraries - as in the post linked above. Completed the same procedure for the three other instances for all the hvp embedded video content on those instances as well. 

This seems to have solved the issue.

For the videos directly embedded, not using hvp, the video does play.
If for particular users it does not play, most probable reason could be blocking of third-party cookies or blocking of some elements in the embed code in their browser, which the step-by-step procedure given by Claude earlier (listed below in edited form) might help to catch. 

1. Get exact symptoms from affected users - Ask whether they see a blank black box, an infinite spinner, a YouTube error message (e.g. "Video unavailable", "Playback on other websites has been disabled"), or nothing loads at all. Also get their browser, device, and whether they're on a school/work network or home network. This alone usually narrows it to one of the causes below.

2. Check third-party cookie and tracking-prevention settings - The video.js YouTube tech relies on the YouTube iframe API, which needs to communicate via cookies/postMessage. Safari's Intelligent Tracking Prevention, Firefox's Enhanced Tracking Protection (strict mode), Brave, and some corporate-managed Chrome profiles block third-party cookies by default, which can cause the embed to fail to initialize while the same page works fine for you if your browser allows third-party cookies or you're signed into Google.

3. Check browser console for errors on an affected user's machine - Open DevTools > Console while loading the page. Look for postMessage origin errors, blocked-by-client warnings (ad blockers), or CSP errors. The embed URL includes an explicit origin parameter (https://ourdomain.org) — if a user somehow reaches the page via a different hostname (e.g. http vs https, or a proxy/CDN mirror), this mismatch can silently break the YouTube iframe API handshake.

4. Rule out ad blockers and browser extensions - Ad blockers, privacy extensions (uBlock Origin, Privacy Badger, etc.), and some antivirus "web protection" modules commonly block YouTube's embed script or iframe outright. Have the affected user try in an incognito/private window with extensions disabled. 

Wednesday, September 09, 2026

Claude's review of swayam plus integration local plugin for Moodle

Created a wiki page at https://github.com/hn-88/swayamplus-sso-api-integration/wiki
and populated it with Claude's comments during its review of code for this plugin which had been generated by Gemini in a single prompt.

Tuesday, September 08, 2026

Google Maps Street View video

Private URL for my reference - https://claude.ai/chat/859a7468-53e7-4e90-96ce-deca9ab6f363

Claude was happy to write code for me when I prompted, "If it is feasible, please write a google apps project which will work with google street view, capturing street view images between two points which the user chooses, and exporting the images as a video journey between the two places on the map similar to what is seen by a dashcam on a car. If not feasible, please suggest alternatives."

But the code requires a project with billing enabled, apparently it does not work with the demo api key provided at https://developers.google.com/maps/demo-key

So, pivoted to making screenshots of the google.com/maps page open in street-view instead - tested using SikuliX IDE 2.0.5 from https://github.com/oculix-org/SikuliX1/releases/download/v2.0.5/sikulixide-2.0.5-linux.jar

Points to note - the delay needs to be more than 5 seconds for me, the images load quite slowly. Alt+Shift+C to abort the SikuliX task.

ffmpeg -framerate 1 -i frame_%04d.png -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2,minterpolate=fps=10:mi_mode=blend" -c:v libx264 -pix_fmt yuv420p journey.mp4

for frame blending, but a timelapse style with more frames per second would probably be needed for longer journeys. The scaling is because the libx264 codec needs even numbered pixel counts for width and height, which may not be guaranteed when choosing a rectangle onscreen.

Monday, September 07, 2026

debugging and testing local Moodle plugin with Claude

Private URL for my reference - https://claude.ai/chat/12096022-e224-4e6b-9e01-40149a93cef7

Used Claude to debug (add missing version.php, and many other omissions) the local plugin for swayamplus api integration generated by Gemini - github repo at https://github.com/hn-88/swayamplus-sso-api-integration. Also added some features like retry logic and test url generation.

The readme file has some info about how ngrok was used for testing with a mock python server - https://github.com/hn-88/swayamplus-sso-api-integration/tree/main/test-python-api-server

Some points to note:

  1. The plugin uses the "Manual enrolment" enrolment method, which is enabled by default on all courses - we can see the enabled methods by going to the relevant course > Participants > Enrolled users (dropdown) > Enrolment methods. 

  2. Guest access should probably be removed from the same place as above, in case enabled earlier.

  3. Currently the classes/privacy/provider.php is not implemented, so the mdl_local_swayamplus_enrol table is not updated by deleting rows if / when users are deleted.

  4. If the user is already present on our system, they are directly enrolled in the course.

  5. If the user is new to our system, the user is dropped into the profile completion and agreement to terms and conditions workflows. Following that, the user is actually enrolled in the course automatically, but dropped into their Profile page. According to Claude, we can add a large link to "My Courses" in the Profile page as follows: 

    1. Go to any page where you can add a block sitewide — the Front Page is the standard choice. Turn editing on.
    2. Add a block → HTML.
    3. Give it a title (e.g. "Continue learning") and content — something like a large, bold link:
      <p style="text-align:center;">  
      <a href="https://ourdomain.org/my/courses.php"     
      style="font-size:1.4em; font-weight:bold; 
      display:inline-block; padding:10px 20px;">
      → Go to My Courses  </a></p>
      
    4. On that block's own settings (gear icon → Configure), under "Where this block appears" → Page contexts, set it to "Display throughout the entire site." Save.
    5. Now navigate to any user's profile page — your own is fine. The block should appear there too (since you just made it sitewide). Open that same block's settings again, and this time change "Display on page types" to "Only user profile pages." Save.


network problems were due to overheating SFP module

On two consecutive days, internet at the Planetarium went down at around 9 am, working fine before that. The network folks tried sending light down the fiber, it was fine. But the SFP module in the media converter at our end was very hot. They swapped out the media converter, and the network started working again. 

Saturday, September 05, 2026

avidemux on Mac - default settings are fine

Verified that with the default settings on Avidemux 2.8.2 compiled for ARM on Mac,

MPEG4 ASP (xvid4) video and AC3 lav audio work for playout on the DVD player, 1920x1080.

For 4K - 3840x2160 - the Videotoolbox HEVC default settings are 2000 bitrate and 4000 max bitrate, which can be increased to 5000 bitrate and 8000 max bitrate to be on par with the settings in python-ffmpeg-warp.

Friday, September 04, 2026

investigating lack of referrals

The Moodle plugin in this previous post was not reporting any referrals for the month of August. Investigating, found that
  1. In the new site (swayamplus.education.gov.in redirected from swayam-plus.swayam2.ac.in) login is via email sent to our email id, and my previous email registration doesn't seem to work. Maybe because I had unsubscribed from course alerts?

  2. After logging in with a fresh email, found that swayamplus is no longer adding a referer id to the course URL. There is no &ref=ABC123 part in the URL.
Since they are not sending referral IDs, we cannot report what they don't send!