Came across this detailed video comparison of teaching with zoom vs meet vs bbb vs teams. But it ignores one factor which is crucial for us, which is cost.
Mostly work related stuff which I would've entered into my "Log book". Instead of hosting it on an intranet site, outsourcing the hosting to blogger!
Thursday, October 28, 2021
Tuesday, October 26, 2021
git pull Moodle upgrade
The steps to do a command-line upgrade using git are summarized at
https://moodle.org/mod/forum/discuss.php?d=403666
While doing the upgrade, git complained that changes have been made, so it was aborting the pull. As discussed in this page -
https://moodle.org/mod/forum/discuss.php?d=228497
I tried
git stash
git pull
That worked.
Sunday, October 24, 2021
one-time download from GDrive - and a library to parse URLs
An interesting implementation of a temporary download link from Google Drive using Google Apps Script - https://github.com/tanaikech/One_Time_Download_for_Google_Drive
And a library to parse URLs - URI.js linked from https://googleappscripting.com/working-with-urls/
concurrent user limits for google apps script
User Tanaike has answered this question also on stackoverflow with testing details - the answer seems to be less than 30 concurrent calls to a google apps script, though if calls are separated by one second, more users can use the script.
Wednesday, October 20, 2021
difference in parsing csv - Google Sheets and Drive vs LibreOffice Calc
Monday, October 18, 2021
User rate limit exceeded in Google Apps Script
API call to drive.files.insert failed with error: User rate limit exceeded
- there are various mitigation strategies mentioned in this page, but what I usually use are calls to Logger.log - that seems to take the amount of time sufficient for staying within the 10 calls per second rate.
Wednesday, October 13, 2021
exporting Odia html text as Google doc
Exporting a set of Oriya (Odia) language html files stored inside a database to google docs using the usual technique which I had used for English, viz -
var ablob = Utilities.newBlob(assethtml, MimeType.HTML, "asset.html");
var AssetGDocId = Drive.Files.insert(
{ title: data_array[i][8] + ' temp', // Column I is Asset title
mimeType: MimeType.GOOGLE_DOCS, parents: [{"id": destFolderID}] }, ablob).id;
Did not work. Reason was that the Odia files did not specify the encoding, and consisted of content like
When "good" Odia content was created using Google's phonetic Odia keyboard provided by Google Input Tools, the exported html looks like this,
Wednesday, October 06, 2021
removing an app from the Android App Store (Play Store)
The video at https://www.youtube.com/watch?v=bqEOQzg_kp8 has the current steps -
- Go to play.google.com/console
- Click on app
- On left menu, scroll down to Setup, under which click on Advanced Settings
- Choose Unpublish.
Sunday, October 03, 2021
moving files and folders to shared drives in Google Workspace
For non-Admin users to move entire folders to Shared Drives in Google Workspace (formerly GSuite), the admin has to set suitable permissions - from admin.google.com, Admin Roles -> Create new role, call it something like Shared Drive Admin or whatever, and give that role the permission under Services > Drive and Docs > Settings > Move any file or folder into shared drives
After that, assign this admin role to whichever user needs it. Then, that user can drag and drop folders also into shared drives as below. (If this is not done, only files can be dragged and dropped into shared drives, folders have to be manually re-created.)
Dragging and dropping files from My Drive to a Shared Drive - walkthrough video below -
This could be a good option if some users on Google Workspace are running out of disk space due to files in Drive. Another option would be to move the files to another google account. This video's second half shows how to transfer files from one account to another using MultCloud. The first part of the video is inaccurate, since the file owner is not changed even if moved from Shared with Me to another folder. If not using MultCloud, the method to transfer a file from one account to another is:
- Share the file from account1 with account2 as Editor.
- Choose to make account2 the owner by clicking the "Make Owner" option as in the screenshot below.
- Account2 gets an email saying that this item appears in My Drive of account2
- Move file to suitable folder by signing in with account2
Monday, September 27, 2021
scripts to copy publicly available files from Alfresco
There was a requirement to back up all the files in an Alfresco repository to a filesystem. A google shared drive mounted using rclone was used in this case.
Caveat - rclone mounted gdrive is excruciatingly slow when there are a large number of files in the destination folder, even when using your own client id. It's much better to use some other remote mount like a remote local drive or something like that, and then upload from there to google drive.
Anyway, the scripts and sql used in this case are listed at https://github.com/hn-88/bashDLalf
which uses the grep -v method to remove lines containing specific substrings.
(We did not use these bulk scripts because only a sample "site" was configured on our installation. And this Alfresco Bulk Export tool needed the Alfresco war file to be modified etc, which I was hesitant to do.)
Edit: 5 May 2022 - Got an email from Google, "OAuth out-of-band (OOB) flow will be deprecated on October 3, 2022, to protect users from phishing and app impersonation attacks." ... "Apps using OOB in testing mode will not be affected." ... etc.
The client ID I had created for rclone was indicated in the email. So, I deleted that client ID, since I'm currently not using it.
Sunday, September 26, 2021
mysql timeouts with DBeaver
When doing custom queries on a remote MySQL server, DBeaver was timing out and I would need to "Invalidate/Reconnect" the connection every time. Found this old discussion about it, in my case the solution was to change the timeout from 20000 to 2000000 in the menu item
Database -> Driver Manager -> MySQL -> Driver properties tab
Saturday, September 25, 2021
ad hoc moodle database queries
Some queries needed by the team for customized Moodle reports using the ad-hoc database queries plugin - https://github.com/hn-88/ad-hoc-moodle-database-queries
Tuesday, September 07, 2021
website connection issues - most probably client-side DNS misconfiguration
One of our websites was not responding when trying to connect with Chrome incognito tab from offices behind a Sophos network security appliance. Interestingly, the error message shown was "xx.yy.zz.kk refused to connect" with the relevant IP address being an Airtel address and not a github/cloudflare address as it should be, since the website was hosted on github with cloudflare proxying.
Most probably this was due to some sort of misconfigured DNS, I guess, since V reported that it was working after the alt DNS IP 8.8.8.8 was added along with cyberoam's IP address (which was primary DNS) in the wireless router.
But the fact that only incognito tabs had this issue was interesting. Maybe due to this - in incognito mode, Chrome seems to be connecting to dns in a different manner, which seemed to have the issue - https://blog.google/products/chrome/more-intuitive-privacy-and-security-controls-chrome/
Friday, September 03, 2021
fresh moodle installation
Earlier, I had just duplicated moodle installations by backing up and restoring. Now a fresh install, for which:
- Set up the moodle files using git as in my previous post.
- Logged on to the database server, and created the required database and user as mentioned in the documentation - not as a single command, which doesn't seem to work, but as separate commands. Since the user is not on localhost, it is currently set up as 'username'@'%'
mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> CREATE USER moodleuser@'%' IDENTIFIED BY 'yourpassword';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodleuser@'%'; - Caveat - must log in as root with mysql -u root -p before doing the above, since other mysql users don't have all the required permissions. In this case, the root user's password was similar to the other user's password.
- Ran the installation from the CLI. The first time I ran it, www-data user could not write to that directory. So, changed the permissions to allow group write -
chmod g+w the_git_dir
cd the_git_dir
sudo -u www-data php admin/cli/install.php
This took quite a while - around 5 minutes - for all the database table creation etc. So, probably it would have been wiser for me to do this in a screen session. - Then made the site available via apache, with a letsencrypt certificate:
cd /etc/apache2/sites-available
sudo cp anothersite.conf thissite.conf
sudo nano thissite.conf
sudo a2ensite thissite.conf
sudo systemctl reload apache2
sudo certbot --apache
delete a user in mysql
Sunday, August 29, 2021
cloudflare proxied self-signed web server issues
There was a problem with one of our websites set up with a different domain, where another site was being served up instead of the site configured with relevantdomain.conf virtualhost in apache. Turned out the issue was due to the way in which we had set up cloudflare proxying and SSL.
The apache server had been set up with a self-signed certificate, cloudflare was using flexible SSL mode, and a page rule had been applied in cloudflare for http to https redirection. But the web server had been configured with the self-signed cert for another domain. Maybe this was the reason for cloudflare to serve up the default.conf domain instead of the relevantdomain.conf.
Anyway, tidying up by using
certbot-auto --apache
and installing letsencrypt certificates for all the domains on that server fixed up the issue. The usual caution - when doing automatic http validation, turning cloudflare proxying off may be required. But for renewing the domains, this doesn't seem to be necessary, as tested with
certbot-auto renew --dry-run
Later set up automatic renewal with
45 2 * * 6 cd /etc/letsencrypt/ && ./certbot-auto renew && /etc/init.d/apache2 restart
Thursday, August 19, 2021
clear the contents of an iframe
Referencing this issue, "clear error mesg when starting a new search" -
one possible solution might be to clear the contents of the iframe, some good methods are listed at https://stackoverflow.com/questions/1785040/how-to-clear-the-content-of-an-iframe
Tuesday, August 17, 2021
not booting after timeshift restore
An upgrade from Linux Mint 19.3 to 20 did not end well. dpkg got stuck with some circular dependencies, probably because I had not removed all "foreign" packages before the upgrade. Then tried a fresh install of Linux Mint 20.1 and and upgrade to 20.2. Unfortunately, there seems to be a regression for Macbook support - the screen becomes corrupted after suspend and wake up.
So, I tried to restore the timeshift backup I had made before the upgrade. That took a couple of hours, since I had backed up 40+ GB of home directory also. But then the system wouldn't boot into that restored partition.
Error message: Alert: UUID=<whatever> does not exist, dropping to a shell.
After looking at many places like here and here, finally I thought of checking the refind file boot/refind_linux.conf since I was booting with refind. That immediately showed up the issue. The boot/refind_linux.conf on the relevant partition, /dev/sda3 in this case, was pointing to a different UUID compared to the UUID reported by
sudo blkid
So I just had to boot into another working Linux installation, edit this file boot/refind_linux.conf on /dev/sda3 with the correct UUIDs, and save it. The next boot worked fine.
Friday, August 13, 2021
making a book readable on the Kindle from a set of articles
There are some pages with links to a large number of articles, like this one. Looking around for easily converting all those articles into a single book readable on an e-ink reader like the Kindle, my first trial was with Calibre and its News feature. Just adding that html page as the source did not work - the created ebook only had that page and nothing else.
Next, trying creating an RSS feed with fivefilters and giving that feed to Calibre - limited to 5 links, so not sure how it would work with the hundreds of old articles.
Trying HTTrack to download pages - was taking a long time due to downloading CSS, images, etc. And we were not really interested in images.
So, used DownloadThemAll, choosing to download only *.htm and *.html linked from the index page, created a table of contents html page as noted in the FAQ. But Calibre complained of broken image links and stopped the conversion.
cat *.txt > combinedfile.txt
and converted the combinedfile.txt. This created a combined ebook, but with ugly hard line-breaks every other line. Then, chose to enable heuristics processing with all options, and converted again. This time, got good results. With heuristics processing, the conversion takes longer, around 5-6 minutes for a 3 MB text file.
- DownloadThemAll
- HtmlAsText
- cat
- Calibre with heuristics enabled.
Thursday, August 12, 2021
assigning roles to users on Moodle
On one of our Moodle installations, there was a request to change permissions of a couple of users - to assign the "manager of course category" status of one user to another. Though Moodle has an easy way to make a user a manager of the entire site, Site Administration -> Users -> Assign system roles - this particular permission assignment was a bit more tricky to navigate. One solution turned out to be:
- Navigate to a course for which this user has manager status as an Admin or Manager
- Choose Course "Actions Menu" (Gear icon on right corner with the Moove theme)
- Choose "More" -> Users tab -> "Check permissions"
- Filter for the user whose permissions you want to change, click to select and click "Show this user's permissions"
- In this case, it showed, among other things, Manager in Category:TheRelevantCourseCategory
- Clicking on Category:TheRelevantCourseCategory, then again the "Actions Menu" (Gear icon on right corner with the Moove theme), Assign Roles
- That gives us a clickable table to assign roles (like Manager) in that particular category.



