Saturday, November 15, 2025

strategies for dealing with Google Workspace account filling up

Copy-pasting from an email:

Here are some ways to clear up space in <google workspace account>

You can go to drive.google.com/drive/quota. There, you see how much storage you use in Google Drive, Gmail, and Google Photos. It also lists the largest files in your google drive, which you can delete if not needed.

2. If GMail is the service which is using up most of the storage, then you can consider deleting files based on how large the attachments are, or based on how old the email is.

To find the emails with attachments greater than 10 MB, enter the following in the search box at the top of your GMail - 
has:attachment larger:10Mb
and hit Enter. 



Similarly for attachments greater than 5 MB etc. 

(You can also use the advanced search link on top of your GMail to achieve this.)
For finding emails older than a particular date, there is a drop-down, "Any time" just below the search email box. To find all emails earlier than 2015, say, you can first clear the "Search mail" box and then choose the "Any time" drop-down, and choose custom, like the screenshot below.




Using these search methods, you can try to delete unwanted emails, spam, internet forwards, outdated correspondence, and so on.

Once emails are deleted, you will then need to go to "Trash" and choose "Empty Trash Now" if you want the space savings to be applied ASAP. Even after this, Google might take some time before the % used decreases.

In case you are not able to free up space in this way, and need to back up old correspondence, here are some ways of doing that, by forwarding to another account, or by using a product called mailstore, etc, details in the link below - 

Sunday, November 09, 2025

Send user digests - Moodle task fails - sends hundreds of emails to Admin

On one of our Moodle instances, emails are supposed to go out through Google Workspace using Google SMTP servers. That being the case, we can't send an unlimited number of emails. So, email notifications had been globally - Site Administration > General > Messaging > Notification settings, which is located at server.url/admin/message.php

When there was a request to allow emails of a particular type to particular users, after enabling the email notification plugin at the above page, the next time a forum post was made, there was a cascade of Send user digests failed and Send user notifications failed messages.

For the immediate failure messages to stop, deleted all the adhoc tasks from mod_forum,

delete from prefix_task_adhoc  where prefix_task_adhoc.component = 'mod_forum';

I had previously set emailstop=1 on the database users table, for all users except the handful which should receive emails. Possibly the reason for the failures was that forcesubscribe=1 was set for many forums for many / all users. 

So, now I set it to zero (email disabled) for all forums on this instance, with

update prefix_forum set prefix_forum.forcesubscribe = 0;

and also updated the defaults,
Site administration > plugins > plugins overview > (chose mod_forum) > settings >

site.url/admin/settings.php?section=modsettingforum

and set subscription mode = subscription disabled for both defaults,
forum_announcementsubscription
and
forum_subscription 

Also, went to prefix_forum_subscriptions table and deleted all entries - which I suppose would be various users' subscriptions to various forums.

Hopefully this is sufficient to prevent the hundreds of failed send notification tasks. 

Update 13 Nov - Again received hundreds of task failed messages. Asked Claude.ai, and made the following changes as suggested, in addition to the above.

# Individual discussion subscriptions might still exist
DELETE FROM prefix_forum_digests;
DELETE FROM prefix_forum_discussion_subs;
UPDATE prefix_user SET maildigest = 0 WHERE emailstop = 1;
# Users might be getting auto-subscribed when they post
UPDATE prefix_forum SET trackingtype = 0;
TRUNCATE prefix_forum_track_prefs;

Tuesday, November 04, 2025

run 'Issue Certificates' task more often

There was a request for setting up email notifications for one Moodle course, a particular user to be notified when any user completes that course. I had earlier set many tasks to run less often due to our server being overloaded. 'Issue Certificates' task was one of them, especially since it needed some optimizations as per this thread. Checking the logs, I could see that issue certificates was taking between 30 and 120 seconds - so, increased the scheduled task cron frequency from once a day to once an hour, for two of our Moodle instances. 

Set to run every hour at the 30th minute (8:30, 9:30 etc) on one instance and at the 45th minute (8:45, 9:45, etc) on the other instance, in Site Administration > Server > Tasks > Scheduled tasks > \mod_customcert\task\issue_certificates_task 

Wednesday, October 29, 2025

installing python modules on Linux and Windows

For trying out LLM-generated python scripts for "warping", (still works in progress)

On Windows, various python modules can be installed with 
pip install modulename
where we sometimes have to do an internet search to find the exact modulename. 


pip install pillow

On my Linux Mint machine, where I've installed python using the default deb package with apt, 

ModuleNotFoundError: No module named 'imageio'
and when trying to install with pip,

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

sudo apt install python3-imageio # this worked.

Tuesday, October 28, 2025

proctoring plugins for Moodle

Copy-pasting from an email exchange:

 ... would require us to conduct a proctored test. Moodle has several plug-ins. They are promoting 'Proctoring for Moodle'. I also find Quilgo to be good. Can we install these 2 plug-ins (and any other plug-in recommended by you) in (our dev server) for us to test them out?

Here is a list of proctoring plugins for Moodle, probably you would have seen this already. https://moodle.org/plugins/?q=proctor

'Proctoring for Moodle' is free software, but if you want to use the automated face-recognition, they ask us to contact them. "Moodle Proctoring plugin is a Quiz Access plugin designed to capture a user's picture via webcam to identify the individual attempting the Moodle quiz."

A demo is at https://www.youtube.com/watch?v=NcrE1OIj6_Q

In that video, it is mentioned that features like capturing student's screen for "suspicious behaviour" like copy-pasting into Google etc, requires Proctoring Pro.


But the "purchase" Proctoring Pro link seems to be broken. -

https://proctoring.elearning23.com/ 
https://elearning23.com/moodle-proctoring-pro-details/
https://elearning23.com/wp-content/uploads/2024/10/Proctoring-Pro-v2.0.0-User-Manual.pdf

(page not found etc)

"Quilgo® Proctoring for Moodle is a highly scalable plugin that allows you to include a camera, screen, track activity, and receive reports on test completion. Online assessments become easier and more reliable. Easy to use, no API customization or maintenance required." But the free plan is only for 20 tests, and the cheapest paid plan is $1200 for a year or $140 for a month.

https://quilgo.com/products/moodle 

A demo/tutorial is at https://www.youtube.com/watch?v=-pwwImIprSM

I have installed 'Proctoring for Moodle' and "Quilgo® Proctoring for Moodle" on (our dev server) now.

Saturday, October 25, 2025

can QUIC be added to our dot net app

There was a request from the developers asking if we can enable QUIC support to the back end of an app for which we had disabled QUIC at cloudflare to prevent issues.

My reply was,

QUIC on Apache web server (which we use as the reverse proxy for dotnet) is experimental. 

We would have to use the experimental module, or shift to another web server like nginx etc. 

Since migration to a different web server is not simple, and the QUIC module is experimental on Apache, I would recommend against enabling QUIC for now. 

Also, QUIC security headaches for admins - 

Sunday, October 19, 2025

handwriting recognition - ChatGPT is still the best

Uploading a page from my diary and checking how good the various LLMs are at handwriting recognition - ChatGPT is good for regular snaps.

ChatGPT -
JUN 7 FRI
 Social service instead of jogging as you're coming – making the Ashoka trees straight.
 Afternoon no class – we went to Mandir ~ 1:45, You came ~ 3:15. Vedaṁ, balloons, exerts, song – W/N pg writing & study this time Krishnamoorthy, IMI – problems in C...

Claude had done well at coding - better than ChatGPT and Gemini, but fared worse in handwriting recognition - Claude's version -
JUN 7 FRI
Bowl Service instead of dragging so forth coming - making the little trees sharply. Afternoon no class - we went to Nandu ~ 1:45, Su came ~ 3:15. Yadav, balloons, esotts, songs N/N pg writing & study his tone. Kishnamathy I/W - problems in C...

My corrected version - 
Social service instead of jogging as You're coming - making the Ashoka trees straight. Afternoon no class - we went to Mandir ~ 1:45 pm, You came ~ 3:15 pm. Vedam, balloons, escorts, song – WIN prg  during waiting at Mandir & study hours time. Krishnamoorthy, 1st MSc - problems in C...

Edit - 9 Nov - But when I edited together 5 pages to form a single long page, ChatGPT started hallucinating instead of transcribing!

Excerpt from ChatGPT's version of July 5-14 - 
JUL 5, FRI
 Toured Siddalingeshwar Plantation.
 Found good crop condition — 4½ acres of Amlan.
 Evening went to A.P.S. meeting at old students’ association.
 9:45 P.M. came home.
 Supper.

Actual corrected version,
"Pseudo heterodyning" - frustrating as could get only π phase change. Used signal analyzer to acquire data. S4 again seminars on 902...

Timetable again reverting to old schedule, 9 to 3, from Monday.




Saturday, October 18, 2025

claude is good at coding

Pleasantly surprised to find that Claude.ai, running the Sonnet 4.5 model, with just a free plan and a single prompt, created a usable UI for a timeline editor in html / javascript, when supplied with javascript helper functions copy-pasted along with the prompt - the initial commit is at




Edit - Subsequent commits were needed to make it actually functional, connect to OpenSpace, etc. using code copied from Jeff Nee,


The "finished product" is here,

Tuesday, October 07, 2025

Moodle Course Completion

Extracts from an email thread, S asked the question and answered himself - 

...we have a custom report 'Course Completion Status' in one of our Moodle instances.

There is a field 'Course Completion - Completed' and this field should show 'Yes' when the course is completed and 'No' when the user is still doing the course. And then there is another field, 'Course Completion.Student Progress' and this field shows the percentage progress.

For (one particular) course many teachers have completed the course (the percentage is 100); certificates have been issued to them. However, the field 'Course completion - completed' is set to 'No' and not 'Yes'. What could be the problem? Even the system report 'Activity Completion' has all the activities ticked. 

Found out the issue - within the course, the course completion criteria weren't set up. To mark the course as completed, at least one criterion should be enabled. 

In the course page - More->Course Completion, enable one or more conditions. I have enabled 'Custom Certificate-Course Certificate'. And immediately, all the people who have received certificates have been marked as 'Completed'. 

Friday, October 03, 2025

hidden restrictions in Airtel's "unlimited 5G" plans

According to this youtube video, there are some terms and conditions which are shown only in the Airtel app, by which

  1. If Airtel thinks it is being used for commercial purposes, they can restrict the "unlimited 5G"
  2. If the data transferred exceeds 300 GB in a month, they can consider it "commercial"
  3. Tethered use of 5G data - using a mobile hotspot - is not included in the "unlimited 5G"
And one of the comments in that video pointed out that the reason why at some times the 4G data cap gets used up even though 5G is displayed in the status area on the top right of Android phones, is because of Airtel's use of 4G infrastructure to deliver 5G - in which case, the 4G billing gets used. And apparently, the difference can be noticed on Samsung phones with the 5G logo which is displayed. 

It seems 5G with a white background = true 5G.




And 5G with white text = 4G masquerading as 5G.

And this seems to be confirmed by this page, 
https://androidsrc.net/android-samsung-phone-symbols/




Sunday, September 28, 2025

Youtube 360 VR videos with a poor internet connection

Most of the time, our office internet connection can't support 2160s resolution for 360 VR videos on Youtube. My current solution is to download the youtube videos using yt-dlp - 

./yt-dlp_linux https://www.youtube.com/watch?v=yHQYd5i7CAE

and then watch.

internet problems with our old wifi router

Found that I had to restart the router often - sometimes more than once a day - when DNS would fail. So, instead of using the router's DNS, decided to use 8.8.8.8 - changed the IPv4 settings on the desktop (Linux Mint - "Advanced Network Configuration" - to use a static ip and added the DNS address. Did not make any changes on the router.

Tuesday, September 23, 2025

Google Apps Script - get the email of signed in user

There was a request to create a Google Apps Script which would do some spreadsheet lookups based on the email of the user, who would authenticate by signing in to the deployed web app - which would be deployed as having access to "Anyone with a Google account".

Apparently the script would work for anyone having an email id in the same workspace domain, but it would not work for users with generic @gmail.com email ids. 

Session.getActiveuser.getEmail() has the problem that it would need the script to run as the user who is logging in (and not as the creator of the script). Apparently this restriction does not apply for users within the same google workspace - 
"the user's email address is not available in any context that allows a script to run without that user's authorization, like a simple onOpen(e) or onEdit(e) trigger, a custom function in Google Sheets, or a web app deployed to "execute as me" (that is, authorized by the developer instead of the user). However, these restrictions generally do not apply if the developer runs the script themselves or belongs to the same Google Workspace domain as the user."

So, made a workaround - first, a script which will run as the user who is logging in, which will get the email - and then POST it to the second script, which will run as the creator of the script, which will process the information. At the POST step, we could add our own authentication using some salted hash etc. 

The first script would be something like - 

function doGet(e) {
  let userEmail = Session.getActiveUser().getEmail();
  let targetUrl = "https://script.google.com/macros/s/AKfycbyx4CbCNIpgmLd2iaWF4buFh_WZtIyOY3vpwdht_Gillycyflpgu1C2bN-j77P2CD3j/exec"; // Replace with your other script's URL

  let html = `
    <!DOCTYPE html>
    <html>
      <body>
        <p>You are signed in as <b>${userEmail}</b></p>
        <form method="post" action="${targetUrl}" target="_blank">
          <input type="hidden" name="userEmail" value="${userEmail}">
  <!-- add other hidden inputs with salted hash or whatever for extra authentication -->
          <button type="submit">Proceed</button>
        </form>
      </body>
    </html>
  `;

  return HtmlService.createHtmlOutput(html);
}

// With deployment access to "Anyone with a Google account"
// Execute As "The User accessing the web app" 


And the second script would have a doPost() like -

function doPost(e) {
// e.parameter contains form fields
let userEmail = e.parameter.userEmail;
// do whatever other parameter checks for extra authentication

// Call your function to fetch data
let result = getData(userEmail);

let html;
if (result && result.found) {
let data = result.data;
html = `
<!DOCTYPE html>
<html>
<body>
<h3>Data Details</h3>
<p><b>Data1:</b> ${data.Namefield1}</p>
<p><b>Data Num:</b> ${data.Num}</p>
<p><b>Data Program:</b> ${data.Program}</p>
</body>
</html>
`;
} else {
html = `
<!DOCTYPE html>
<html>
<body>
<p>No data found for <b>${userEmail}</b></p>
</body>
</html>
`;
}
return HtmlService.createHtmlOutput(html);
}


Edit - In this implementation, the second script would open in a new tab or new window, with target=_blank when submitting the form - I was asked if it could open in the same window. Tried it, the answer was that no, opening in the same window will not work. Probably because of “X-Frame-Options” or other HTTP headers that block embedding / cross origin operations.

Monday, September 22, 2025

warping with ffmpeg - and some filter_complex examples

Since OCVWarp uses OpenCV remap() and there does exist a remap filter in ffmpeg also, revisited ffmpeg remap in order to make use of the accelerated NVidia codecs, which ffmpeg supports. Asked ChatGPT to generate python code to create the required map files, debugged the code manually, and put the code at

Currently it's just for the spherical mirror warping of fulldome content, but could potentially be extended to all of OCVWarp's functionality.

This ffmpeg command using the accelerated hevc_nvenc codec runs at 13 fps on a desktop running NVidia RTX 1060 as against 2.5 fps using OCVWarp saving to avc1 codec out.

ffmpeg -i input.mp4 -i map_x_directp2.pgm -i map_y_directp2.pgm -i weight_alpha_mask.png -filter_complex "
  [0:v]scale=3840:2160[scaled];
  [scaled][1:v][2:v]remap[remapped];
  [3:v]format=gray,scale=3840:2160,colorchannelmixer=rr=1:gg=1:bb=1[mask_rgb];
  [remapped][mask_rgb]blend=all_mode=multiply[out]
" -map "[out]" -map 0:a -c:v hevc_nvenc -preset p5 \
-cq 23 -rc vbr -maxrate 15M -bufsize 26M \
-c:a aac -b:a 128k output.mp4

Can potentially even create a UI using Tkinter in python, which would be cross-platform.

Some notes about the ffmpeg commands copy-pasted from the readme there - 

-ss for the start time should come before the input, and 
-t for the duration should come just before the filter_complex - 

For starting at two minutes and stopping after 10 seconds duration,
ffmpeg -ss 00:02:00 -i input.mp4 \
       -i map_x_directp2.pgm \
       -i map_y_directp2.pgm \
        -i weight_alpha_mask.png \
       -t 10 \
-filter_complex "
 [0:v]scale=3840:2160[scaled];
  [scaled][1:v][2:v]remap[remapped];
  [3:v]format=gray,scale=3840:2160,colorchannelmixer=rr=1:gg=1:bb=1[mask_rgb];
  [remapped][mask_rgb]blend=all_mode=multiply[out]
" -map "[out]" -map 0:a -c:v hevc_nvenc -c:a copy output.mp4


And a problematic video was fixed using an initial crop to 4096x4096 (although avidemux could show it as 4096x4096)

ffmpeg  -i "short_nometadata.mp4"        -i map_x_directp2.pgm        -i map_y_directp2.pgm         -i weight_alpha_mask.png      -filter_complex "[0:v]crop=4096:4096[cropped]; [cropped]scale=3840:2160[scaled]; [scaled][1:v][2:v]remap[remapped];[3:v]format=gray,scale=3840:2160,colorchannelmixer=rr=1:gg=1:bb=1[mask_rgb];
  [remapped][mask_rgb]blend=all_mode=multiply[out]
" -map "[out]" -map 0:a -c:v hevc_nvenc -preset p5 -cq 23 -rc vbr -maxrate 15M -bufsize 26M -c:a aac -b:a 128k short_w2.mp4

But unfortunately, the quality of the warped output is slightly lower than what is seen with OCVWarp - slightly less sharp. Perhaps changing the workflow to first remap and then resize (instead of resize to 3840x2160 first and then remap) might improve things.

Edit - 6 October 2025 - Yes - after doing the remap filter first, at the full resolution of the input video, and then the resizing to output resolution brings up the quality to as good or better than OCVWarp. ("Better" when OCVWarp's default avc1 video codec settings don't deliver as good quality as the hevc_nvenc settings above, I guess.) A separate repo has been created for this, incorporating a Python Tkinter UI,





Friday, September 19, 2025

screen capture or screen recording with Linux on NVidia cards

One more way of doing it, in addition to this earlier post which uses a compiled tool gpu-screen-recorder, there also seems to be a script which does ffmpeg capture of a particular window - 


This seems to use ffmpeg with -x11grab to do the capturing. I've not yet tried it.

Thursday, September 18, 2025

dd command to create linux boot disk

via https://linuxvox.com/blog/create-usb-boot-linux-mint/

sudo dd if='/path/to/linuxmint-22-cinnamon-64bit.iso' of=/dev/sdd bs=4M status=progress

2810183680 bytes (2.8 GB, 2.6 GiB) copied, 140 s, 20.1 MB/s

So, on my machine, it took less than three minutes to create a 2.8 GB boot disk.

Wednesday, September 17, 2025

Fujitsu mini PC not booting

I had a couple of Fujitsu mini PCs purchased cheaply, used from amazon - but neither of them would boot up now, a couple of years after I had used them last. Suspected the BIOS battery - used these videos to help with opening them up - similar, ours was Q920 without the DVD drive - 



Got the CR2032 lithium cell bios batteries also from Amazon, put in new batteries, and they booted up fine. 


Edwiser Bridge Plugin for Moodle

There was a request to install Edwiser Bridge Plugin for Moodle which would enable integration between Moodle and WordPress. 



I was spooked by some of these requirements, and also due to 

"vulnerability in Moodle that allows unauthenticated users to access sensitive user data through unauthenticated REST API calls. - fixed in 4.5.3"

So, I replied that I would not be responsible for security issues, if any, if this plugin is installed and asked for head of the institution approval if it was to be installed. The request was then withdrawn, so it was not installed.


Tuesday, September 16, 2025

the find command and mtime - finding disk space used by old files

 Asked ChatGPT, "linux commandline to list total disk space used of all files created or modified inside a directory more than one year ago" and got the following - 

You can do this with find + du or find + stat + awk.
Here’s a one-liner that lists the total disk space used by files in a directory older than one year:

find /path/to/dir -type f -mtime +365 -printf "%s\n" | \
awk '{sum+=$1} END {print sum/1024/1024 " MB"}'

Explanation:

  • find /path/to/dir → search inside that directory.

  • -type f → only files.

  • -mtime +365 → modified more than 365 days ago (roughly one year).

  • -printf "%s\n" → print file sizes in bytes.

  • awk → sums up sizes and prints total in MB (divide by 1024/1024).

If you prefer human-readable output directly:

find /path/to/dir -type f -mtime +365 -print0 | du --files0-from=- -ch | tail -n1

This gives you a total in du’s human-readable format.





 Asked ChatGPT, "tree view of files and directories larger than 1 GB from linux command line" and got the following - 

You can combine find, du, and tree-style output to list only files/directories larger than 1 GB in a tree view. Here are a couple of approaches:


1. Using find with tree

find /path/to/search -type f -size +1G -print | tree --fromfile
  • find ... -size +1G → finds files > 1 GB

  • tree --fromfile → prints a tree structure from the list

If you want directories too (based on contents size), use du instead (see below).


2. Using du for directories/files with sizes

du -h --threshold=1G --max-depth=3 /path/to/search | sort -h
  • --threshold=1G → only show entries larger than 1 GB

  • --max-depth=3 → how deep to go

  • sort -h → human-readable sort

This shows sizes and paths (not tree formatting, but size summary is clearer).


3. Pretty tree-like display with du

du -h --threshold=1G --max-depth=3 /path/to/search | sort -hr | 
awk '{print $2}' | tree --fromfile

This gives you a tree structure of directories/files whose total size is ≥ 1 GB.


✅ If you want only the largest offenders (say top 20 big files/directories over 1 GB), you can do:

find /path/to/search -type f -size +1G -exec du -h {} + | sort -hr | head -20

For this, I had to sudo apt install tree