Wednesday, September 02, 2026

dotnet api timeouts and action taken

The developers on one of our apps noted that 
The API is intermittently failing, and we are seeing a CORS error in the browser Network tab.

Claude noted that the CORS error is misleading, and it is probably because of a backend API timeout. 

this is almost never an actual CORS policy misconfiguration — it's the browser's error message for "the actual response didn't carry an Access-Control-Allow-Origin header," which happens whenever the request fails or errors out before your CORS middleware gets a chance to run. Since it's intermittent, that's your biggest clue.

Since a lot of bot traffic was seen looking for Wordpress files, they requested blocking those bots which look for non-existent Wordpress files.

Taking Gemini's advice, 
1. Disabled php on the api server, since it's not required by our services - 
sudo a2dismod php8.3
sudo systemctl restart apache2

2. Added one more firewall rule to Cloudflare, the URL being like

ourdomain.org/security/security-rules

(http.host contains "ourdomainname" and http.request.uri.path contains "wp-") or (http.host contains "ourdomainname" and http.request.uri.path contains ".php")
then Block

Friday, August 28, 2026

All of your Google Play apps have been successfully registered

There was an email from Google saying that Android apps in the Play store (and outside) need to be registered, and we need to register keys if we are signing outside the Play Store.

One of our apps was being signed outside the Play Store, so in the URL
play.google.com/console/u/6/developers/android-developer-verification
clicking the arrow against that app, it asks us to add the public key.
To find the public key,
where I'm using this method in a github action,

      - name: Extract SHA-256 fingerprint only
        run: |
          BUILD_TOOLS="$ANDROID_HOME/build-tools/34.0.0"
          "$BUILD_TOOLS/apksigner" verify --print-certs app-release.apk \
            | grep -i "SHA-256"

I clicked on Add Key and added the digest, at first it showed Pending verification, in 10 minutes it showed verified.

Here is part of Gemini's reply on why this key is needed - 

To ensure your app functions flawlessly whether it is downloaded from the Play Store, sideloaded by a QA tester, or downloaded directly from your website, your backend services (Firebase, Google Cloud, etc.) should always have both fingerprints registered:
  1. The Google Play App Signing SHA-256 (found in Play Console -> Release > Setup > App Integrity).
  2. Your Local Keystore SHA-256 (the one generated from yourkey.keystore).

major changes needed for Moodle app

I asked Gemini 3.1 Pro Preview via aistudio.google.com -
Does the Moodle Android App at https://github.com/moodlehq/moodleapp support optimization using R8?

Gemini said, in short, "The short answer is no, not out of the box. The Moodle App is optimized using Angular/JS minification tools (Terser/Webpack) rather than Android's native R8. You should not enable R8 in the Moodle App's Android build configuration, as it will likely break the bridge between the app's JavaScript and native Android plugins."

Then, I asked, 
Then how can this app (and other similar cordova apps) meet the upcoming quality requirements in https://android-developers.googleblog.com/2026/08/app-quality-memory-optimization-secure-onboarding.html ? The play store quality check tool seems to mandate R8 optimization.

Gemini's answer is pasted below.

The recent Google Play announcement from August 2026 (enforcing new memory and
code optimization standards by February 2027) definitely changes the landscape
for hybrid frameworks like Cordova, Capacitor, and Ionic, which power apps like
Moodle.

According to the new Google Play requirements, apps must have a minimum of 25%
coverage across optimization, shrinking, and obfuscation for their native DEX
code using R8 (or a similar tool), and they must stay below strict memory/bitmap
thresholds.

Here is how the Moodle app, and Cordova apps in general, can meet these upcoming
requirements without breaking their architecture:

1. Hitting the 25% R8 DEX Coverage Rule

While blindly enabling R8 (minifyEnabled true) breaks the Cordova JS-to-Native
bridge, it can be enabled safely if properly configured. To meet the 25%
threshold, Cordova apps do not need to obfuscate their entire codebase; they
just need to shrink enough of it.

  - Targeting Heavy Dependencies: In a standard Cordova app, the actual Cordova
    wrapper code and plugins make up a very small percentage of the compiled
    .dex (native Android) file. The vast majority of the native code comes from
    heavy dependencies like AndroidX libraries, Google Play Services, Firebase,
    and other third-party native SDKs.
  - Targeted ProGuard/R8 Rules: Developers will need to enable minifyEnabled
    true but use a highly specific proguard-rules.pro file. They will use
    aggressive -keep rules to protect the Cordova framework (-keep class
    org.apache.cordova.** { *; }) and plugin reflection methods so the app
    doesn't crash.
  - By allowing R8 to shrink and dead-code-eliminate the massive AndroidX and
    Google Play Services libraries while leaving the Cordova bridge alone,
    hybrid apps can easily surpass the 25% optimization threshold required by
    Google Play.

2. Meeting the Dynamic Memory & Bitmap Thresholds

The new requirements aren't just about R8; they strictly monitor dynamic memory
and background bitmap usage. This is actually the bigger challenge for Cordova
apps because they run inside an Android WebView, which is notoriously
memory-heavy.

To prevent the Play Store from penalizing or down-ranking the app, hybrid apps
will have to aggressively optimize their web layers:

  - Background DOM Management: The Moodle Angular app will need to actively
    destroy heavy DOM elements (like large course lists or forums) when the app
    goes into the background, replacing them with placeholders to free up RAM.
  - Bitmap/Image Eviction: The WebView caches images heavily. When the user
    navigates away from an image-heavy course, the app must ensure the WebView
    releases those bitmaps from memory rather than keeping them cached in
    non-visible states.
  - Garbage Collection: Relying more heavily on WeakReferences in JavaScript and
    ensuring Angular observables are cleanly unsubscribed to prevent memory
    leaks in the Node/V8 engine powering the WebView.

3. Implementing the "Zero-Tap Sign-In" (Device Migration)

The blog post also mandates the adoption of the Android Restore Credentials API
for seamless device migration. For the Moodle app, this means updating the
native Android authentication plugins to hook into Android's Credential Manager
API. Instead of relying solely on standard web cookies or isolated local
storage, the app's native layer will need to back up the user's secure token so
that if a student buys a new phone, Moodle logs them in automatically.

The Path Forward for Moodle (and Cordova)

Because the enforcement deadline is February 2027, framework maintainers have
several months to react. You can expect the following to happen across the
ecosystem:

1.  Upstream Updates: The Apache Cordova and Ionic Capacitor teams will likely
    push updates to their Android build templates that include safe, boilerplate
    proguard-rules.pro files out of the box.
2.  Plugin Consumer Rules: Native plugin authors will increasingly embed
    consumerProguardFiles in their Gradle setups. This tells R8 exactly what to
    preserve automatically, taking the burden off the app developer.
3.  Moodle HQ Patches: For the Moodle app specifically, Moodle HQ will update
    their build pipeline before the 2027 deadline. If you are compiling your own
    custom version of the Moodle app, you should wait for Moodle HQ to release
    their compliant ProGuard configurations rather than trying to force R8 on
    your own today.



Thursday, August 27, 2026

recovering h5p activites after mod_hvp bug on Moodle

This was noticed on July 24th - lots of pages on our Moodle instances were showing "The version of the H5P library H5P.Column used in this content is not valid. Content contains H5P.Column 1.18, but it should be H5P.Column 1.22."


At that time, I replied that, according to Gemini, this is a known H5P bug - https://github.com/h5p/moodle-mod_hvp/issues/632 - and the H5P core development team is actively working on a fix (Pull Request #633) - https://github.com/h5p/moodle-mod_hvp/pull/633
Gemini private URL for my reference - https://aistudio.google.com/prompts/1Ddl2aYqln8Y8wTIPtlLXG_8Fipeay_5F

Unfortunately, the next version of mod_hvp Moodle plugin was released, but it only had code to prevent such errors in future, but it did not automatically fix the existing problems.

So, took the help of Gemini again, and took steps to fix our Moodle instances. Private URL for my reference - https://aistudio.google.com/prompts/1LJYJaO3R8mjgpsd3w67TDlACd3Ni8JhL

Workflow was:

0. First download a "good copy" of the database backup - Since the buggy mod_hvp was released after Feb 2026, my choice was the backup of 22 Feb 2026. Unfortunately, this backup was 500+ MB as a .sql.gz file, where the logstore_standard_log table had not yet been cleaned up. Setting up this database on my local machine took 4+ hours for the database import. Private URL for my reference - https://chatgpt.com/c/6a8d13c5-1988-83ee-816b-082af1f2a874

sudo apt install mysql-client (was already installed)
sudo apt install mysql-server

systemctl status mysql
sudo mysql
CREATE DATABASE restore_test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
quit;
zcat your_backup.sql.gz | sudo restore_test

(this took 4+ hours - should probably have done the gunzip separately? Also, 11+ GB database at /var/ from a 9+ GB sql file - sudo du -sb /var/lib/mysql/restore_test)

sudo mysql
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT ALL PRIVILEGES ON restore_test.* TO 'myuser'@'localhost';
FLUSH PRIVILEGES;

Then to fix "Public Key Retrieval is not allowed" error in DBeaver, right-click to edit the connection, 

Go to Driver Properties.
Modify the properties,
allowPublicKeyRetrieval to true
useSSL to false

Then, by using a different port in a tunnel to the remote database, we can copy and paste data with DBeaver.


1. Fix the main library reference (e.g., Column or Interactive Book containers):

UPDATE vv_hvp h
JOIN vv_hvp_libraries old_lib ON old_lib.id = h.main_library_id
JOIN vv_hvp_libraries new_lib ON new_lib.machine_name = old_lib.machine_name
  AND new_lib.major_version = 1 AND new_lib.minor_version = 22
SET h.main_library_id = new_lib.id, h.filtered = NULL
WHERE old_lib.machine_name = 'H5P.Column'
  AND old_lib.major_version = 1 AND old_lib.minor_version = 18;

Updated rows 0

2.  Fix nested library references

UPDATE vv_hvp 
SET json_content = REPLACE(json_content, 'H5P.Column 1.18', 'H5P.Column 1.22'),
    filtered = NULL
WHERE json_content LIKE '%H5P.Column 1.18%';

UPDATE vv_hvp 
SET json_content = REPLACE(json_content, 'H5P.InteractiveVideo 1.27', 'H5P.InteractiveVideo 1.28'),
    filtered = NULL
WHERE json_content LIKE '%H5P.InteractiveVideo 1.27%';

Updated rows 7

3. Recovering "Wiped" Activities (Data Loss)

SELECT id, name, course FROM vv_hvp WHERE json_content LIKE '%"content":{"params":{}}}%';

37 rows on our instance.

4. Fixing one of the data-missing json-content fields - 
SELECT json_content FROM vv_hvp WHERE id = 30851 (from the backup)

to find the current libraries, look for H5P string in the json, 
and add to the ones below.

SELECT machine_name, major_version, minor_version
FROM vv_hvp_libraries
WHERE machine_name IN (
    'H5P.Video', 
    'H5P.MultiChoice', 
    'H5P.AdvancedText',
    'H5P.InteractiveVideo',
'H5P.Column',
'H5P.Image',
'H5P.CoursePresentation'
)
ORDER BY machine_name, major_version DESC, minor_version DESC;

Only had to find/replace CoursePresentation version, others had current versions. Then pasted the "corrected" json content in the same field of the live database.

5. Run a find/replace on the entire live database - starting first with one course,

UPDATE vv_hvp 
SET json_content = REPLACE(json_content, 'H5P.Column 1.18', 'H5P.Column 1.22'),
    filtered = NULL
WHERE course = 606 
  AND json_content LIKE '%H5P.Column 1.18%';

Updated rows 42.

Update main library id just in case.

UPDATE vv_hvp h
JOIN vv_hvp_libraries old_lib ON old_lib.id = h.main_library_id
JOIN vv_hvp_libraries new_lib ON new_lib.machine_name = old_lib.machine_name
SET h.main_library_id = new_lib.id, 
    h.filtered = NULL
WHERE h.course = 606
  AND old_lib.machine_name = 'H5P.Column'
  AND old_lib.major_version = 1 
  AND old_lib.minor_version = 18
  AND new_lib.major_version = 1 
  AND new_lib.minor_version = 22;

Updated rows 0.

Then, did for all courses,
UPDATE vv_hvp 
SET json_content = REPLACE(json_content, 'H5P.Column 1.18', 'H5P.Column 1.22'),
    filtered = NULL
WHERE json_content LIKE '%H5P.Column 1.18%';

Updated 221.


Then asked Gemini if this can be automated for data recovery for the 30+ instances of data loss - private URL for my reference -
 https://aistudio.google.com/prompts/14Bv6L5AfaOglFuUY_VJZ6F7A1cchR-FQ

That resulted in the python scripts at https://github.com/hn-88/fix-hvp/
which seem to have fixed all the data-loss in this instance.

Then, a new problem was reported on another Moodle instance - youtube videos were playing with audio only, and black screen. Putting that in a separate post here.

Moodle H5P Interactive video playing only audio with black screen

It was reported that all the H5P Interactive video activities on one of our Moodle instances were only playing audio, no video visible, black screen instead. My initial reaction was that this seemed to be another symptom of the mod_hvp bug which had prevented activities from being updated as per the previous post. But the fix in this case was slightly different.

Private URL of chat with Gemini for my reference - https://aistudio.google.com/prompts/1sowy1kk_uVUetNXh2Og3WBgVcfGQ-lQy

The query
SELECT machine_name, major_version, minor_version
FROM vv_hvp_libraries
WHERE machine_name IN (
'H5P.Video',
'H5P.MultiChoice',
'H5P.AdvancedText',
'H5P.InteractiveVideo',
'H5P.Column',
'H5P.Image',
'H5P.CoursePresentation',
'H5P.Summary'
)
 had this response.

H5P.AdvancedText 1 1
H5P.Column 1 13
H5P.Column 1 17
H5P.Column 1 18
H5P.CoursePresentation 1 22
H5P.CoursePresentation 1 24
H5P.CoursePresentation 1 25
H5P.CoursePresentation 1 26
H5P.Image 1 1
H5P.InteractiveVideo 1 22
H5P.InteractiveVideo 1 24
H5P.InteractiveVideo 1 26
H5P.InteractiveVideo 1 27
H5P.MultiChoice 1 14
H5P.MultiChoice 1 16
H5P.Summary 1 10
H5P.Video 1 5
H5P.Video 1 6

Gemini said, If you replace 'H5P.Column 1.18' with 'H5P.Column 1.22', Moodle's H5P renderer will look for H5P.Column 1.22 in vv_hvp_libraries, fail to find it, and throw a fatal error. H5P.Column 1.22 is not installed on this instance

Primary cause - Outdated H5P.Video Library vs. YouTube Player Changes. Check with

SELECT id, machine_name, major_version, minor_version, patch_version 
FROM vv_hvp_libraries 
WHERE machine_name IN ('H5P.Video', 'H5P.InteractiveVideo')
ORDER BY machine_name, major_version, minor_version;

If H5P.Video 1.6 is below 1.6.67, updating the library will resolve the issue - and gave this thread as the reference,
which was discussing the exact same issue.

After some trial and error, the correct solution was:
1. In the Moodle server's config.php, add this line near the bottom before require_once(...)
$CFG->mod_hvp_dev = 1;
2. Download link: https://hub-api.h5p.org/v1/content-types/H5P.InteractiveVideo (save the file as InteractiveVideo.h5p)
3. Go to https://your-moodle-domain/mod/hvp/library_list.php
(Or navigate via UI: Site Administration > Plugins > Activity modules > H5P > H5P Libraries)
and upload the saved InteractiveVideo.h5p in the Upload Libraries box.
4. Verify that the new version is installed with the query 
SELECT id, machine_name, major_version, minor_version, patch_version 
FROM vv_hvp_libraries 
WHERE machine_name = 'H5P.Video';
5. Now in mod/hvp/library_list.php we see Interactive Video (1.27.9) listed, and also a green button at the right to "Upgrade library content". Click on the upgrade library content button to automatically fix all the interactive videos on the site. The page goes to 100% with AJAX updating in less than 30 seconds.
6. Purge caches (sudo php admin/cli/purge_caches.php on CLI ) and test one of the videos to see if it is OK
7. Restore the config.php by commenting out the mod_hvp_dev line we added.


Monday, August 24, 2026

tests of mid-tones brightness reduction on planetarium dome

Tried out reduction of mid-tones using Blender, for reducing the washed-out over-exposed look due to dome reflections. 

For individual textures in a 3D scene, add a RGB Curves node after the texture in Shader Editor. In Blender VSE (Video Sequence Editor), we can add via "Add" menu, choose "Effect Strip," and select "Color" followed by "RGB Curves."

On the M4 Mac Mini, 3840x2160 renders were proceeding at nearly 10 fps from Blender VSE. The output of that was probably not playable smoothly on Raspberry Pi, so ran it through Avidemux with Videotoolbox (GPU assisted) HEVC codec, the default bitrates of 2000 kbps avg and 4000 kbps max are quite low, but quality is fine for simple scenes.

NAVK preferred the previous version of "Unseen Earth" in which I probably either put a mask over the bright parts or left as is - when I reduce mid-tones again, the scene becomes too dark for him. Probably I can redo the overexposed parts of "The Search" with this technique.

Friday, August 21, 2026

Cloudflare Origin Server Certificate for Wordpress instance on Hostinger

After chatting with Hostinger support, the following is the reply.
"Yes. Your WordPress instances on Premium Web Hosting support custom SSL certificates on their virtual hosts"

(Copy-pasting from an email exchange).

So, we could install the cloudflare origin server certificate as per the procedure at https://www.hostinger.com/support/1583785-how-to-install-a-custom-ssl-in-hostinger/ 

Doing this has both Pros and Cons. 

 The pro is that then we can be sure of the certificate being valid for Cloudflare - unlike the letsencrypt certificate currently present, which would need updating every three months. 

 The con is that once the cloudflare origin server certificate is installed, you can only access the wordpress site through cloudflare (or you would get a scary "certificate not trusted" message) and you would be limited by cloudflare's file upload and timeout limits.

(The team opted to not use Cloudflare Origin Certificates.)


removed defunct DNS records

After an email the previous day to verify that none of these services need to be kept, deleted a handful of defunct DNS records from a couple of our domains. One was an MX record which was not active since the migration to Google Workspace in 2019.  

Sunday, August 16, 2026

URL for images on Google Drive for other websites

Copy-pasting from an email exchange - 

Google Drive makes it a bit difficult to host images there for other websites.
Please see how to do it at

I have done a couple of test embeddings at
ourwebsite/test.html
to verify that it works.

For the second image, I have used the method given in the link  https://joe-walton.com/blog/embedding-google-drive-images-in-html-in-2024/

For the first image, 
1. I used the Share... menu in google drive to copy the link to the image, from which we get the image id as in the link above
2. I pasted the link as given by the above page, into another window, like https://drive.google.com/thumbnail?id=1W19N7j2i6vGyzHfoLQJjEtl1poEYRHij&sz=w800
3. I then copied the link to which that redirected, like https://lh3.googleusercontent.com/d/1FlbieOeCdifrNLP2ssy73SlfIU9NhD8M=w800?authuser=0

In case this method has problems, we can host the images in ourwebsite.org or ourwebsite2.org in some directory, and then paste those links to the portal settings page.

Monday, August 10, 2026

setting up passkeys with keepassxc on linux

Since Microsoft was making passkeys the default for authenticating on Azure as mentioned in a previous post, I wanted to understand more about passkeys and how to use them on Linux. This video was helpful - Convenient and secure: Manage passkeys with KeePassXC - Tutorial

So, with keepassxc, the steps were, for me on Linux Mint,
sudo add-apt-repository ppa:phoerious/keepassxc
sudo apt update
sudo apt install keepassxc

Then,

1. Need to enable browser integration
2. Need to connect browser plugin to keepassxc
3. Need to enable passkeys in the browser extension
4. Test with webauthn.io
5. https://passkeys.directory/ shows which services support

For Google account, passkey creation is via my account - myaccount.google.com/security
Under Security, Passkeys and security button at the bottom.

For Microsoft, currently passkey creation is at
https://mysignins.microsoft.com/security-info

Multiple google accounts are supported by keepassxc. Also, Android 16 phone supports passkeys out of the box. 

For Google Workspace logins, the admin must enable passkeys for users - Choose whether to let users skip their password if they can authenticate their Google Account securely with just a passkey. -  the only downside seems to be for people using security keys - "Users won't have the option to add a security key. They can still create passkeys on security keys, but security keys that support passwordless sign-in can't be added for 2-Step Verification only." 

Saturday, August 08, 2026

bundling dependencies in MacOS app

Over several trial-and-error attempts with the help of Claude.ai, these two scripts bundled the dependencies needed to run the OpenSpace app without homebrew - tested by renaming /opt/homebrew to something else. 


The bundling of dependencies was done using these two scripts, bundle-macos-local.sh and bundle-python.sh.

Friday, August 07, 2026

Passkeys by default and retirement of Microsoft-provided SMS and voice authentication

Microsoft sent us an email and has a blog post where they say

To address these evolving threats, Microsoft Entra ID is updating its authentication experience by making passkeys the default phishing-resistant authentication method, helping customers reduce reliance on phishable methods such as SMS and voice.
I asked Gemini at aistudio.google.com, "How do I Identify users who still use SMS or voice in portal.azure.com?"

Gemini suggested

  1. Method 1 - The Authentication Methods Activity Dashboard in Azure portal -  portal.azure.com > Microsoft Entra ID > Security > Authentication methods > Monitoring > Activity, "Click the Usage tab to see a high-level visual chart of which authentication methods are actually being used to sign in across your tenant"
  2. Method 2 - Export a Report using Microsoft Graph PowerShell
  3. Method 3: Check Actual Usage via Sign-in Logs - portal.azure.com > Microsoft Entra ID > Sign in logs, look at the Authentication Details tab
I asked Gemini,

I get the message "Migrate to the converged Authentication methods policy"
"Please migrate your authentication methods off the legacy MFA and SSPR policies by September 2025 to avoid any service impact."
What does that mean, and how do I do it?

Gemini replied, 

What does this mean?

Historically, Microsoft Entra ID (formerly Azure AD) had two separate, disconnected portals for managing how users prove their identity:

1.  The Legacy MFA Portal: Used to control methods for Multi-Factor
    Authentication (MFA).
2.  The SSPR Portal: Used to control methods for Self-Service Password Reset
    (SSPR).

Because managing these in two different places was confusing, Microsoft created a unified "Authentication methods policy." This new policy is a single, converged dashboard where you manage all authentication methods (Microsoft Authenticator, SMS, Voice, FIDO2, Passkeys, etc.) for both MFA and Password Resets.

Microsoft is retiring the old legacy portals by September 30, 2025. The message you are seeing is a warning that your tenant is still relying on the old legacy settings, and you need to manually flip a switch to tell Microsoft to use the new modern policy instead.

If you don't do this before the deadline, you risk service disruption (users
might not be able to register or use their MFA/SSPR methods properly) once
Microsoft turns off the old portals.

How do I do the migration?

Migrating doesn't mean your users have to set up their MFA again; it simply
means you, as the administrator, are changing where the rules are managed.

Here is the step-by-step process to migrate safely:

Step 1: Audit your existing legacy settings

Before you switch over, you need to see what methods you currently allow so you
can match them in the new portal.

1.  Sign in to the Microsoft Entra admin center as a Global Administrator or
    Authentication Policy Administrator.
2.  Check your Legacy SSPR Settings: Go to Protection > Password reset >
    Authentication methods. Note which boxes are checked (e.g., Mobile app code,
    Email, Mobile phone).
3.  Check your Legacy MFA Settings: Go to Users > All users > Click Per-user MFA
    at the top. On the new page, click service settings at the top. Note which
    verification options are checked (e.g., Text message, Call, Notification).

Step 2: Configure the new Converged Policy

Now, you must replicate those allowed settings in the new unified portal.

1.  In the Entra admin center, go to Protection > Authentication methods >
    Policies.
2.  You will see a list of methods (Microsoft Authenticator, SMS, Voice call,
    FIDO2 security key, etc.).
3.  Click into each method you want to allow (based on your notes from Step 1).
4.  Toggle the Enable switch to Yes, set the Target to All users (or specific
    groups), and hit Save. (Note: It is highly recommended to enable Microsoft
    Authenticator and Temporary Access Pass, as Microsoft is pushing toward
    modern/phishing-resistant methods).

Step 3: Change the Migration State

Once your new policy matches your old settings, you are ready to flip the
switch.

1.  Still in Protection > Authentication methods > Policies, look near the top
    of the page for a banner or a button labeled Manage migration.
2.  A flyout menu will appear on the right side of your screen with three
    options:
      - Pre-migration: (Where you are currently) - Only legacy policies are
        respected.
      - Migration in progress: - Both policies are respected, but the new
        converged policy is evaluated first.
      - Migration Complete: - The legacy policies are completely ignored, and
        only the new converged policy is used.
3.  Select Migration in progress and click Save.
4.  Take a few days to ensure your users can still sign in, use MFA, and reset
    their passwords without issue.
5.  Once you confirm everything works, go back to the Manage migration menu,
    select Migration Complete, and click Save.

That's it! Once you hit "Migration Complete," the warning message in your portal
will disappear, your tenant will be fully modernized, and you will be safe from
the September 2025 deprecation deadline.

It was in the Migration in progress state. And all the methods are shown as not enabled. I asked Gemini if I should enable them.

Gemini said, Yes, absolutely. Because you are in the Migration in progress state, Microsoft is currently looking at both your old legacy settings and the new portal. If a method is turned on in either place, your users can use it.

Here is a screenshot of the authentication methods page, after I enabled some of them. 


I'm detailing the creation and use of passkeys on Linux / Android in another post.

Saturday, August 01, 2026

saga of decommissioned UPS

Dec 18, 2025 - email to the top executive officer of one of our institutions, saying that we could possibly make use of a decommissioned 10 kVA UPS

Feb 20, 2026 - email "received with thanks". It takes 20 65Ah lead acid batteries, trying to charge the batteries with 12V charger ordered on 25th Feb.

June 29, 2026 - requesting electrical people to wire up the batteries which were individually charged

July 23-26, 2026 - internal resistance testing shows 11 of the 20 batteries are bad, which makes the UPS trip when input power fails. So, decide to not use it.

July 31, 2026 - sent the good batteries to another institution. 

Tuesday, July 28, 2026

Android app policy violation triggered by old testing tracks - Blank release fix

We have multiple tracks in google play console for one of our Android apps. Currently we don't need all of them, we need only the production track. But unfortunately, google does not provide a way to delete unwanted tracks. Also, even releases in paused tracks can trigger "policy violation" of having app releases targeting older target SDK values - we need to update every year to the latest target SDK.

Asking Gemini via aistudio.google.com about this, it suggested a "Blank Release" method - create a new release, but don't upload any aab/apk file. We can do this for each of the testing tracks which we don't need. That would make the older releases "Inactive" and prevent the "policy violation" for old releases.

I've done this yesterday for one of our apps, and it seems to be working. The changes were approved after review in just an hour or less. The policy violation popup did not go away yesterday even after the changes were approved, but today I see that the policy violation popup is replaced with "Policy status - No policy issues found" in the "Monitor and improve" tab.

While we can upload the latest release to all of the tracks, and use the "Add from library" method for each track instead of uploading, the "Blank release" strategy above avoids that busy-work, hopefully permanently.

Sunday, July 26, 2026

h5p page in Moodle does not show next activity on completion

There was this issue faced by the admins of one of our Moodle instances - "Quite a few sections use the H5P Interactive Book format and contain a video to be viewed and a few quizzes to be answered. The completion condition that has been set is to view the activities and get a grade in the quiz. Even though the conditions are met, the option to move to the next activity is not available. However, if the learner refreshes the screen, then the next activity is available. But it also clears the submitted responses in the current activity."

Gemini gave a long reply, based on which the final solution, obtained by testing on a development instance, was:

  1. Enable "Save Content State" in Site Administration > Plugins > Activity Modules > H5P
  2. Add a "Refresh" prompt for students Because Moodle cannot currently auto-refresh the page when an H5P grade is achieved
Instead of just putting in a button or javascript to refresh the page manually, we can achieve a similar result using Moodle's standard activity tools.

  1. Turn on Edit mode.
  2. Click Add an activity or resource below the H5P activity.
  3. Select URL.
  4. In the Name field, type: Save changes (or Save changes and continue).
  5. In the External URL field, paste the URL of the course page.
  6. Under Appearance, set "Display" to Open (or "Automatic").
  7. Click Save and return to course.
This will place a link on the course page that looks like a standard Moodle activity. When students click it, it essentially re-opens the course page they are already on, refreshing the backend completion triggers and unlocking the next module.

Saturday, July 25, 2026

slightly more user-friendly mass mailing script

Prompted Gemini via aistudio.google.com to make the mass-mailer using Google Apps Scripts a bit more user-friendly - displaying a checklist of actions to be performed for sending the emails, and picking up the rich-text html from a draft email instead of needing to write out the html by hand. Creating a custom menu and displaying a sidebar UI are done by these functions, using this html.

The Draft email with subject MassMailTemplate must not be deleted, it must remain available throughout the run of the script. The body of the email is taken from this Draft.

Inline images inside the draft will be sent as attachments, and it is better to avoid attachments to prevent our mails from being marked as spam. Formatted text is fine.

The Checklist in the Mass Mailer menu item is just for display, unchecking all the items can be done manually before the next send.

disk space alert and cleanup of MySQL databases with Moodle logs

We got an alert from our script that one of our servers had 95% utilization of the root disk. Asked Gemini via aistudio.google.com and carried out the following.

Find the Top 20 largest directories on the root partition:

sudo du -ahx / | sort -rh | head -20

Note: The `-x` flag ensures it only searches the root partition and doesn't scan external mounts or network drives.

Found that 29 GB was being used by MySQL databases.

Find individual files larger than 100MB:

sudo find / -xdev -type f -size +100M -exec ls -lh {} \;

Found that there were some .ibd files, with the names of Moodle table  like logstore_standard_log.ibd which were very large. Gemini suggested retaining only 180 or 365 days of logs instead of "Never delete logs" in Site administration > Plugins > Logging > Standard log.

Then, to get back space ...

First, logged on as the administrator of a particular database which we do not need, and dropped that database.
mysql -u thatusername -p
drop database unuseddbname

(sudo mysql does not work on this server, a root password is set, but I did not need the root password.)

That gave us 3-5 GB. Then, there were two options for Moodle logstore_standard_log - either just truncate the table - very quick, get back disk space instantly - or copy over the last 180 days' logs to a new table and then delete the old table.

(Other methods suggested by Gemini were very slow, mentioning only the good options below. Just deleting entries from a table would require an OPTIMIZE TABLE step afterwards, which would need enough disk space to create a full copy of the table.)

CREATE TABLE prefix_logstore_standard_log_new LIKE prefix_logstore_standard_log;

# find starting id to reduce copy time, since id is an indexed field
SELECT id FROM prefix_logstore_standard_log 
WHERE timecreated >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 180 DAY)) 
LIMIT 1;

INSERT INTO prefix_logstore_standard_log_new 
SELECT * FROM prefix_logstore_standard_log 
WHERE id >= YOUR_NUMBER_FROM_ABOVE_STEP;

The copying of log entries into the new table took 51 seconds using this method for our smallest db.

The quick and dirty way, of deleting all the logstore standard log entries (this is only the "what has the user clicked" data - grades etc are not deleted) -
TRUNCATE TABLE prefix_logstore_standard_log; 

This completes in less than a second, and makes disk space available immediately.

Thursday, July 23, 2026

Azure portal - Review Azure Copilot agent access settings before 1 August

There was an email from Microsoft, letting us know that if we don't take action, we will be opted in for enabling Azure Copilot agents. In general, my instinct is to disable every new "feature' which Microsoft introduces, because sooner or later, that will be involved in some security incident. After consulting the other admins, I disabled "Azure Copilot" on both Azure tenants I have admin access to, with the result that these agents

Observability Agent
Deployment Agent
Troubleshooting Agent
Optimization Agent
Resiliency Agent
Migration Agent

will not be available.

When we navigate to Azure Copilot Admin Center (which we can access via the search at the top of portal.azure.com after logging in) to disable Azure Copilot, there is a link to toggle the control for <User> can manage access to all Azure subscriptions and management groups in this tenant. Since they recommend turning this off, I turned it on, disabled Copilot and turned it back on. The link to this control is https://portal.azure.com/#view/Microsoft_AAD_IAM/TenantProperties.ReactView

The documentation referencing this is at

Wednesday, July 22, 2026

transition to Moodle Marketplace - mod_book unavailable

We got an email from Moodle about moving the Plugins directory to Moodle Marketplace - 

"The transition to Moodle Marketplace may require you to make some adjustments to your Moodle site set-up. See what’s changed at Plugins Directory has moved to Moodle Marketplace."

Here is the list of plugins (at the bottom of the page in this link) which will not be supported after 31 August 2026,

In case any of the plugins we regularly use are listed there, they may not work (or may not be updated) after 31 Aug.

So, VLS got back saying that he 
reviewed the complete list with the list of installed plugins. I have identified 2 plugins, viz., mod_book, atto_fontfamily. 

ChatGPT suggested running SQL to check which courses use mod_book, which I ran - 

SELECT DISTINCT  c.id, c.shortname, c.fullname,
    COUNT(cm.id) AS number_of_books
    FROM prefix_course_modules cm
    JOIN prefix_modules m ON cm.module = m.id
    JOIN prefix_course c ON cm.course = c.id
    WHERE m.name = 'book'
    GROUP BY c.id, c.shortname, c.fullname
    ORDER BY c.fullname; 

On one of our instances, there were 5 courses with 6 "books" while two others had "books" only in "test" or "dump" courses.

Creating service account for accessing Google Drive API

There was a request from the developers to create a shared drive for them in our Google Workspace, and to create a service account to access it programmatically.

Accordingly, created a new shared drive (and have added email1 and email2 as managers)

I have created the service account under an existing google cloud project under my (admin) google account (initially created for rclone), and have added Google Drive Api to the project.

The service account is called 
servaccname@projectname.iam.gserviceaccount.com

I have added this account also as a Content Manager on the Shared drive and shared the json key with the dev team.

Shared Drive storage quota - According to google help, a single shared drive can theoretically hold up to 5 TB per file, but it is strictly capped at 500,000 total items (files, folders, and shortcuts). 


I've currently not put any other cap on the storage quota for this shared drive.

Tuesday, July 14, 2026

Manage your unused OAuth clients - Google cloud

We got emails from Google cloud, "the following projects that you manage have OAuth clients that have been inactive for at least 5 months, and will be deleted in 30 days unless you take action" - checked, and we're planning on allowing them to be deleted, since those seemed to be clients which are not currently in use.

Friday, July 10, 2026

Google apps script issue - script.google.com refused to connect - google glitch

One of our servers which had a google apps script embedded in a php page started showing "script.google.com refused to connect" - the issue was noticed last afternoon. We checked that no changes had been made to the script, we did have
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
as mentioned in

The only other change was to install and set up fail2ban on the server, that was unlikely to be the cause. 

"If no changes have been made to the script, then perhaps it is a transient google problem, and might be resolved in a few hours.

If not, we would need to check if google apps scripts have any recent policy changes."

It might have been a google glitch, since last night the issue was resolved by itself. Looked like the outage was for around 8-10 hours.

Tuesday, July 07, 2026

reminder to take a break - Mac version

I wanted to recreate the earlier "reminder to take a break" cron job script on MacOS. Asked Claude about it, and it suggested using launchd instead of cron, since cron jobs run without access to the display by default. After several rounds of trial and error, here is the method that worked.

nano ~/Library/LaunchAgents/com.yourname.walkreminder.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.yourname.walkreminder</string>

    <key>ProgramArguments</key>
    <array>
        <string>/bin/bash</string>
        <string>-c</string>
        <string>osascript -e 'display notification "Time to take a walk" with title "Reminder" sound name "Ping"'; afplay /Users/yourusername/Sounds/Walk.mp3</string>
    </array>

    <key>StartCalendarInterval</key>
    <array>
        <dict>
            <key>Hour</key>
            <integer>14</integer>
            <key>Minute</key>
            <integer>0</integer>
        </dict>
    </array>

    <key>StandardOutPath</key>
    <string>/tmp/walkreminder.log</string>
    <key>StandardErrorPath</key>
    <string>/tmp/walkreminder.err</string>
</dict>
</plist>

In the above, the schedule is to run once a day at 14:00 hours. For running every half an hour from the time the user was logged on, we can use 

<key>StartInterval</key>
  <integer>1800</integer>

instead of <key>StartCalendarInterval</key>

Or, in my case, since I wanted every half an hour aligned to 0:00 and 0:30 exactly, 

 <key>StartCalendarInterval</key>
    <array>
        <dict>
            <key>Minute</key>
            <integer>0</integer>
        </dict> 
        <dict>
            <key>Minute</key>
            <integer>30</integer>
        </dict>
    </array>

We had to use a Sounds directory which we had created, since afplay could not access the Downloads directory when run from launchd.

launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.yourname.walkreminder.plist

and test with

launchctl kickstart -k gui/$(id -u)/com.yourname.walkreminder

Troubleshooting can be done with
plutil -lint ~/Library/LaunchAgents/com.yourname.walkreminder.plist
launchctl list | grep walkreminder
cat /tmp/walkreminder.err


Saturday, July 04, 2026

Running OpenSpace on ARM64 hardware like Apple Silicon Macs

The OpenSpace project has officially removed support for Mac, and newer commits make OpenGL 4.6 the minimum required version. Since Apple has frozen OpenGL support on MacOS at 4.1 (and even that is without support for some features like double-precision math in shaders), getting OpenSpace to run natively on MacOS seems difficult

Unfortunately, even earlier releases of OpenSpace can't be built for Mac, even with patches, due to external dependencies whose referenced older commits have been rebased away. 

The way out seems to be to use the older official releases with VMWare Windows 11 for best performance, with the current official release running atop VMWare only with software rendering. 

Edit: VMWare Fusion can be downloaded by following the links from https://www.vmware.com/products/desktop-hypervisor/workstation-and-fusion - a free login needs to be created for support.broadcom.com following which we can follow the link to the free downloads area and download VMWare Fusion (which runs on MacOS hosts) or WMWare Desktop (which runs on Windows hosts). As their FAQ page says, these products are free to use for educational, personal or commercial use after 2025.


There is a table of performance tests on various configurations, OpenSpace versions and drivers at
https://github.com/hn-88/OpenSpace-AppImage/wiki/OpenSpace-on-Mac#running-openspace-on-vms-in-macos

Interestingly, 0.21.x official x86 OpenSpace releases can run on Win11-ARM VMs on VMWare - the prism virtualization handles the x86 to ARM translation.

But 0.22.x official x86 OpenSpace releases can't run on Win11-ARM VMs on VMWare - the minimum OpenGL requirement has been bumped to 4.6, while VMWare's Windows drivers currently supply up to OpenGL 4.3.

In order to run OpenSpace 0.22.x with software rendering on Windows, we need to copy opengl32.dll from https://github.com/mmozeiko/build-mesa/releases/latest as mentioned at https://github.com/hn-88/OpenSpace-AppImage/issues/141 - and the dll architecture must match the OpenSpace binary's architecture. Further, the prism emulation layer can't handle x86 OpenGL dlls. So, only the ARM build of OpenSpace 0.22.x can currently run with software rendering, with the limitations like lack of molecule module, etc.

Friday, July 03, 2026

incident and response - malicious bots

One of our servers, which hosted a dot net backend as well as some wordpress sites, showed some outages two days in a row, restored by restarting. Feeding the apache access logs to Gemini via aistudio.google.com, Gemini said,

The logs clearly show an Apache HTTP
Server running PHP and hosting a WordPress application.

The logs indicate that your server was hit by an aggressive automated attack
(likely a botnet) starting around 07:33:35, which appears to have either
succeeded in exploiting a vulnerability or overloaded the server, causing it to
crash shortly after.

(Server had run out of memory). 

Gemini suggested the following - 

  1. Hide and Protect Your Origin IP - which we may not do
  2. Patch and Update the Server Software - which we're doing
  3. Implement a Web Application Firewall (WAF) - which is in place
  4. Clean Up WordPress Configuration - "Open your wp-config.php file, locate line 63, and remove the    duplicate definition of WP_AUTO_UPDATE_CORE. While this didn't cause the crash, it eats up server I/O and makes reading logs difficult."
  5. Restrict PHP Execution in Uploads Directories
  6. Implement Intrusion Prevention (Fail2Ban)

Then, feeding the access logs of the dot net api to Gemini 
and as suggested by Gemini,
journalctl -u ourapi.service --since "2026-06-28 07:15:00" --until "2026-06-28 07:45:00"

Gemini gave some recommendations like returning 0 instead of a 500 error for no data found -
"As we saw in the access logs, when the mobile app sees
    this 500 error, its poorly designed error-handling logic says: "Something
    went wrong! Retry the entire sync process!" It then proceeds to download 4MB
    of lesson data, hits the notification endpoint again, gets another 500
    error, and repeats the cycle every 15 seconds until your server runs out of
    memory and crashes."
- this may or may not be actually what is happening here, since Gemini just saw the logs and does not have access to the code.

In any case, I've enabled bot protection on Cloudflare for this domain, and also installed and configured Fail2ban.

On Cloudflare, 
ourdomain.org > Security > Security rules > Custom rules

Block .env scans
URI Path equals .env
Block

 also added Cloudflare's default rate limiting rule,

Leaked credential check [Template]
Password Leaked equals true
Block

also enabled Cloudflare's AI blocking tools - AI Labyrinth enabled, and Block AI training bots on all pages.

Then, installed and set up Fail2ban on the server, monitoring the apache web server and sshd logs. It will temporarily block ip addresses which fail authentication repeatedly, or which repeatedly request non-existent files like malicious bots.

Gemini via aistudio.google.com gave step-by-step instructions for installation and setup of Fail2ban. 

sudo apt install fail2ban -y
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

(we can optionally edit these,
bantime  = 1h
findtime = 10m
maxretry = 5
)

Enable the Apache jails with
sudo nano /etc/fail2ban/jail.local
[apache-auth]
enabled  = true
port     = http,https
logpath  = %(apache_error_log)s

In case the logpath is custom - fail2ban looks by default for
Error logs: /var/log/apache2/*error.log
Access logs: /var/log/apache2/*access.log

In the case of one of our servers, we needed to change this to
logpath  = %(apache_error_log)s
           /var/www/mysite/logs/custom-error*.log

More Apache jails to enable - basically need to add the enabled = true line - 

[apache-badbots]
enabled  = true
port     = http,https
logpath  = %(apache_access_log)s
bantime  = 48h
maxretry = 1

[apache-noscript]
enabled  = true
port     = http,https
logpath  = %(apache_error_log)s

[apache-overflows]
enabled  = true
port     = http,https
logpath  = %(apache_error_log)s

[apache-nohome]
enabled  = true
port     = http,https
logpath  = %(apache_error_log)s

[apache-botsearch]
enabled  = true
port     = http,https
logpath  = %(apache_error_log)s

Then we can test

sudo systemctl start fail2ban
sudo systemctl enable fail2ban
sudo systemctl status fail2ban

and check the enabled jails with

sudo fail2ban-client status

On one server, we had to resolve
ERROR   Failed during configuration: Have not found any log file
for sshd jail

For that, we had to change the block to
[sshd]
enabled = true
port    = ssh
backend = systemd

since that server was using systemd, and traditional text log files like /var/log/auth.log (which Fail2Ban looks for by default for SSH) are no longer created. After the change, after restarting the service, we can check that jail alone with

sudo fail2ban-client status sshd

Then, for using a different port rather than port 22 for sshd - 

[sshd]
enabled = true
port    = 2022
backend = systemd
(if port 2022 is being used) 
and so on, because that is the port which fail2ban would ban using the machine's firewall, iptables or nftables as the case may be.

To see the rules, we can use
sudo nft list ruleset # for nftables, Ubuntu 24.04
sudo iptables -nL # for iptables, earlier Ubuntu etc



Tuesday, June 23, 2026

SIR online form submission - Election Commission of India

Currently, a "Special Intensive Revision" or SIR is going on for the elector rolls in many parts of India. My colleague told me about the process going on in the local administration's office, and told me that I could submit the form online also.

An internet search revealed

Luckily, my mobile phone number was already available in the system, so when I clicked on sign-up, it indicated that my number is already registered. Then tried log in - an OTP was sent to my phone, and I could log in. 

The process which I followed was
  • Using the search function, found my name in the 2002 electoral rolls - it was on page 2 or 3, I skimmed through the results based on polling station name (we need to be able to read Telugu, the local language, for doing this.) I saved the info listed there - Assembly constituency, polling station and  
  • Next, went to the home page and clicked on "Fill Enumeration form"
  • We have to go through several OTPs, confirm our details, ensure that the name displayed is the same name as on Aadhaar - otherwise we need to do the form submission manually, details of the BLO (Booth Level Officer) are displayed.
  • Then the form opens up, where we need to fill up details and a recent photograph. The initial photographs I uploaded were not recognized "no face was recognized in this photograph" or something like that, after a wait of a minute or two. Thinking that this might be due to spectacles in the picture, clicked a new photo of myself without spectacles, and tried the upload.
  • Yesterday at around 2.30 pm, the form came up for submission after that, though the photo was not visible in the preview. But when I clicked on submit, the "Aadhaar OTP" method of verification did not succeed, it said wrong OTP every time.
  • This morning at around 8.50 am, went through the same process, this time the "Aadhaar OTP" method of verification was successful - again had to wait for a few minutes after uploading the photo in order to get the submit form enabled - and I got a downloadable receipt of the form submitted, with the new polling station number, constituency name and so on.
  • Found that I could also download my voter-id card (EPIC - Election Photo Identity Card) - from https://voters.eci.gov.in/ 

Thursday, June 18, 2026

rewrite of restic backup script and adding email alert

Found that our restic backup script had stopped running from Apr 20th - the log files were dated as last modified on that date. This could have been due to 
(a) an update overwriting the restic binary with an older version of ubuntu's restic via apt, which did not work, giving "backend not supported" errors for Azure Storage
(b) an additional issue that our Azure Storage account had become unavailable at some point of time due to a lapsed subscription 

So, created a new Storage account in an active subscription in the same resource group, which defaulted to the same Central India region for the storage account as we wanted. Used the same name as the earlier script's storage account name, and created a Blob container also with the same name as used by the script. 

Due to the point (a) above, this was not sufficient to make the script work, even for it to initialize the storage with lines like
restic -r azure:our-data-bk:/ourdata init
Fatal: create repository at azure:our-data-bk:/ourdata failed: invalid backend

As suggested by Gemini, the solution was to uninstall restic via apt, and to then download the latest restic and copy it to /usr/local/bin

wget https://github.com/restic/restic/releases/download/v0.18.1/restic_0.18.1_linux_amd64.bz2
bzip2 -d restic_0.18.1_linux_amd64.bz2
chmod +x restic_0.18.1_linux_amd64
sudo mv restic_0.18.1_linux_amd64 /usr/local/bin/restic

sudo apt remove restic

Then,
restic version
-bash: /usr/bin/restic: No such file or directory

We needed to tell bash to refresh the location - 
hash -r

Then the restic version showed the correct version, and the init also was successful. 

I wanted to get emails on future failures instead of the script failing silently, so Gemini helped with this script, which I have modified to change the passwords etc

#!/bin/bash
#This will run Restic backups from cron.
export RESTIC_PASSWORD=ourpw
export AZURE_ACCOUNT_NAME=ourname
#export AZURE_ACCOUNT_SAS="sv=2022-11-02&ss=bfqt&srt=c&sp=not_used_this_time%3D"
export AZURE_ACCOUNT_KEY="mVthisisthekey99999wPlEA=="
# not using rclone+gdrive due to slow,timeouts,rate-limits
#RCLONE_CONFIG=/home/user/.config/rclone/rclone.conf
#create new repo
# https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#microsoft-azure-blob-storage
#restic -r azure:our-data-bk:/ourdata init
# take backups
/usr/local/bin/restic  -r azure:sssvv-data-bk:/1data  --verbose backup  /var/www/1_data_disk/1_data/filedir > /home/user/1resticlog.txt 2>&1
/usr/local/bin/restic  -r azure:sssvv-data-bk:/2data  --verbose backup  /var/www/1_data_disk/2_data/filedir > /home/user/2resticlog.txt 2>&1
/usr/local/bin/restic  -r azure:sssvv-data-bk:/3data  --verbose backup  /var/www1_data_disk/3_data/filedir > /home/user/3resticlog.txt 2>&1
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
    SUBJECT="SUCCESS: Weekly Restic Backup"
    MESSAGE="Your weekly restic backup completed successfully."
else
    SUBJECT="ALERT: Weekly Restic Backup FAILED"
    MESSAGE="WARNING: Your restic backup FAILED with exit code $EXIT_CODE. Please investigate immediately."
fi
mail -s "$SUBJECT" "my@email.org" << EOF
$MESSAGE

Here is the log output:
--------------------------------------------------
$(cat "/home/user/3resticlog.txt")
EOF



Wednesday, June 17, 2026

Updating expiring Azure Linux Virtual Machine Secure Boot 2011 certificates

Microsoft Azure's email notification asked us to update the secure boot certificates before the end of the month, and pointed us to verification, and if necessary updating, steps. The "vendor recommended" documentation for Ubuntu support was a bit contradictory - saying that rollout had been paused - so took the help of ChatGPT and Gemini for completing the process. First took up a non-critical VM, completed that, and then went on to the others.

sudo snap install fwupd
sudo fwupdmgr refresh
sudo fwupdmgr update
#(say yes, yes, and yes to reboot)

Gemini reassured that the devices listed with "no updates" are not a concern, we should only check whether the mokutil tests below work OK.

As per the verification link above, 
Tested with
mokutil --db | grep "2023"
            Not Before: Jun 13 19:21:47 2023 GMT
        Subject: C=US, O=Microsoft Corporation, CN=Microsoft UEFI CA 2023
mokutil --kek | grep "2023"
            Not Before: Mar  2 20:21:35 2023 GMT
        Subject: C=US, O=Microsoft Corporation, CN=Microsoft Corporation KEK 2K CA 2023

Removed the fwupd snap, and also removed snap itself to prevent bloat
sudo snap remove fwupd
(and remove snap itself on ELS)
snap list
(if nothing other than core, core20, lxd, or snapd, can remove)

sudo systemctl disable --now snapd.service snapd.socket
sudo apt-get purge -y snapd
sudo rm -rf /snap /var/snap /var/lib/snapd /var/cache/snapd /usr/lib/snapd

Found that the L VM was already up-to-date since it was a newer VM, created in 2025.

SDev2 had to be updated in the same manner as for the HAPROXY VM above.

SSS web server also had to be updated in the same manner.

On the AWS VM, I see

mokutil --sb-state
EFI variables are not supported on this system

Gemini says,

You do not need to do anything for this AWS VM. You are completely in the clear.
Seeing EFI variables are not supported on this system means that this specific EC2 instance is not using UEFI Secure Boot at all. In fact, it is likely booting using Legacy BIOS rather than UEFI.


With that, all the VMs seem to be accounted for.