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.

Saturday, August 15, 2026

4k fulldome frame saving speeds - OpenSpace 0.22 ARM on VMWare

Running Win11ARM on VMWare, 12 GB RAM, 5 cores on a Mac Mini M4. 

Running OpenSpace on local drive, was saving 4k frames of ts_002 of "The Search" in around 800 to 1500 ms. 

Running on Z drive, was saving 4k frames of ts_002 in around 5000 to 6000 ms - probably because it is a network drive.

Crashed after 1695 frames. Maybe because screensaver came on? Or maybe not - it would have run for more than two hours before crashing. Maybe out of memory etc.

Edit - So, now I have moved the VMWare VMs to an external SSD formatted with Mac filesystem - Mac OS Extended (Case-sensitive, Journaled) - using Disk Utility on Mac - so that OpenSpace can run and save to local filesystem - possibly faster than the Linux machine with 8 GB RAM and NVidia 1050 graphics card. 



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/