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!
Friday, August 19, 2022
scheduled start and stop for VMs on Azure
Thursday, August 18, 2022
dynamic dns options
Tuesday, August 16, 2022
youtube hosted videos on Moodle
There was a query from one of our units, asking how to disable the "Share" link to youtube videos which they embed in their Moodle course. Copy-pasting from my reply:
Some possibilities -
Option 1 - Youtube Custom player embed -
https://www.lifewire.com/embedded-youtube-video-customization-1082489
(I've not tried it, so I don't know if this will help.)
https://www.youtube.com/watch?v=f0iN7jfM7vs
The above video says that you can just add two parameters like controls=0, but now youtube no longer supports the showinfo=0 parameter.
Option 2 - Custom javascript player embed - something like
https://tikku.com/open-source/jquery-plugins/youtube-tubeplayer-plugin/
(I've not tried it, so I don't know if this will help.)
Option 3 - Youtube hosted videos have an option to make them "private".
Then, only those people who have been specifically given permission to view them can see them.
Disadvantage - The user would need to be signed in to their google account in order to view the video.
Option 4 - Putting the videos elsewhere, like Google Drive or some other provider like vimeo,
https://www.colby.edu/acits/2020/01/30/how-to-embed-a-video-from-google-drive/
setting up DMARC for better email delivery, feedback loops and XML DMARC reports
Monday, August 15, 2022
Google Apps Script importxml for xml file stored in Google Drive
This link - https://stackoverflow.com/questions/45988417/how-to-use-importxml-function-with-a-file-from-google-drive - gives a good overview of how to use a file stored in Google Drive in Google Apps script. Either it has to be shared as viewable by all, or it has to be read using DriveApp.
Sunday, August 14, 2022
meaning of the tags in DKIM signature
https://help.returnpath.com/hc/en-us/articles/222438487-DKIM-signature-header-detail
Friday, August 12, 2022
LetsEncrypt certificate renewal issue with Cloudflare proxied Bitnami server
Found one of the Bitnami servers on AWS had an expired LetsEncrypt certificate. Checking, found that its bncert-tool was not able to renew the certificate because it was checking DNS as part of validation, and the server was being proxied by Cloudflare.
- Temporary solution - turning proxying off (DNS only) in cloudflare, ran bncert to renew, OK for now.
- Looking for ways in which the renewal can happen without us having to manually change the cloudflare settings, I found the following:
https://nodehost.ca/docs/containers/make-lets-encrypt-work-when-using-cloudflare-acme-challenge
But this is when the host uses certbot and not bitnami's bncert-tool, which uses a different authentication method. This does not work out of the box for Bitnami servers since the config files' paths are different. On the server itself, there is the rule
RewriteCond %{REQUEST_URI} !^/\.well-known
in the file /opt/bitnami/apache2/conf/bitnami/bitnami.conf - Possibly the final solution:
bncert-tool uses the lego client, documentation at
https://go-acme.github.io/lego/usage/cli/options/
From the documentation, it looks like we can choose Cloudflare as the DNS provider and get the actual dns address. For this, we will need an api key for lms.sssihl.edu.in -
via
Creating API tokens · Cloudflare API docs
(Using api key instead of api token for initial testing,
Cloudflare and restricted API tokens · Issue #984 · go-acme/lego (github.com) )
Then we can try and configure the server to auto update the ssl certificates by authenticating the IP address from cloudflare.
So, I have added two files on the server,
/home/bitnami/cloudflare-user
and
/home/bitnami/cloudflare-api-key
and I have modified the cron command which runs daily to check for renewal,
from
51 23 * * * sudo /opt/bitnami/letsencrypt/lego --path /opt/bitnami/letsencrypt --email="theemail@thedomain.in" --http --http-timeout 30 --http.webroot /opt/bitnami/apps/letsencrypt --domains=thedomain.in --user-agent bitnami-bncert/1.0.0 renew && sudo /opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf -k graceful # bncert-autorenew
to
51 23 * * * sudo CLOUDFLARE_EMAIL_FILE=/home/bitnami/cloudflare-user CLOUDFLARE_API_KEY_FILE=/home/bitnami/cloudflare-api-key /opt/bitnami/letsencrypt/lego --path /opt/bitnami/letsencrypt --dns cloudflare --email="theemail@thedomain.in" --http --http-timeout 30 --http.webroot /opt/bitnami/apps/letsencrypt --domains=thedomain.in --user-agent bitnami-bncert/1.0.0 renew && sudo /opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf -k graceful # bncert-autorenew
Let's see after 30 days if it successfully renews. Seemed to work OK during testing.
Edit: 14 Sep - Yes, it has auto-renewed on 10 Sep.
Some other alternative solutions, which I did not explore:
- There is an alternative method using self-signed certificates, but that would need cloudflare HTTPS setting to be changed to Full instead of Full (Strict), https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes/ )
- Another option is, you could create an Origin Certificate using Cloudflare, and use that instead of the LetsEncrypt certificate.
https://developers.cloudflare.com/ssl/origin-configuration/origin-ca/
This would need a one-time set up on the server, after that would not need renewal (for 15 years.)
Setup on the server would be similar to this, https://visser.io/2018/03/setting-up-a-cloudflare-ssl-certificate-for-bitnami-wordpress-on-google-cloud-compute-engine/
Edit - I have implemented this, and posted about it here. - There is probably another option using manual configuration of certbot, but more difficult than the above, so I'm skipping that.
Thursday, August 11, 2022
accessibility toolbars and PDFs
There was a query about meeting WCAG standards.
Diksha.gov.in also meets WCAG standards.
All websites provide accessibility tool bar consisting of:
1) Font size increase of text
2) Dark mode or contrast.
Moodle version 4 also provides this if enabled.
On Diksha, it is found that both the tools do not work on PDFs and PPTs and only work on other content on website. What could be the reason for this?
Copy-pasting from my reply,
The toolbars usually used on websites generally use javascript to modify the display of HTML content by the web browser (like Chrome, Firefox, etc). PDF, PPT and other content are not displayed on the screen by the web browser directly, but instead depend on other software like PDF plugins, Microsoft Office etc. Therefore, the toolbars will only work with HTML content.
If the Userway widget works with PDF and PPT , it would be because they use some other technique for changing the display.
Windows boot error - A data disk is currently set as active in BIOS
An error encountered when trying A's Windows install - "A data disk is currently set as active in BIOS. Set some other disk as active or use the DiskPart utility to clean the data disk, and then retry the restore operation. (0x80042406)"
Apparently this means that the boot partition is borked and we have to boot with a System Restore disk and then restore the image.
Windows 10 recovery - cannot be done with Win7 startup disk
There was a Windows 10 installation on a laptop which needed boot recovery after Linux had been installed on another partition and then removed or something like that. Tried with a Windows 7 DVD - the bootup disk complained that "this startup disk is not compatible with the Recovery version" etc - so I downloaded Win10 startup disk (install disk) from Microsoft, created a USB boot disk using Rufus, and used that to recover the Win10 installation.
Wednesday, August 10, 2022
Openshot vs Avidemux - ffmpeg - avisynth - Virtualdub
Checked out Openshot for cropping and resizing some videos. https://www.youtube.com/watch?v=uUyqWu8A2OQ
(Advanced view)
--> crop size
--> crop left
(location)
Much faster to do it in Avidemux. For my needs, Openshot does not seem to be a good fit. Avidemux - ffmpeg - avisynth - Virtualdub seem to be more suited for my requirements.
Tuesday, August 09, 2022
Google group subscriptions which don't list the email to group owners
Found that there were some Google group subscriptions which don't list the email to group owners also - when we search by email for members, these don't show up. But if we choose the filter "Not in Org" and in Descending order, such subscribers are listed by name at the top. We could then see if the displayed name is similar to the subscriber we are looking for.
Sunday, August 07, 2022
Windows 10 network time update fails on BSNL FTTH - NetTime works
BSNL's FTTH seems to block UDP port 123, hence Windows 10 network time update fails as noted in this set of posts, which also gives the workaround, installing NetTime.
Windows time sync issue with BSNL FTTH and workaround
Noticed that the Windows 11 machine I was working on had 11:32 showing as the time when it was well into the afternoon. Found this thread,
https://broadbandforum.co/threads/cannot-sync-network-time-ntp-on-win10-on-bsnl-ftth.202104/
So apparently Windows tries to poll port 123 from port 123, and that is blocked by many ISPs.
The easiest workaround was to install NetTime which probably changes the source port and gets around the block.
Saturday, August 06, 2022
sending mail from GMail smtp servers instead of postfix
(which would remove postfix)
and modifying the configuration file as in the link above, /etc/ssmtp/ssmtp.conf with
Friday, August 05, 2022
changes after upgrading to Moodle 4
Copy-pasting edited extracts from an email exchange after upgrading a test server to Moodle 4 -
... the orange band appears with company logo. Need to check how to remove orange band or replace the logo with SSSVV.
Also the footer information is not displayed like in the present case.
b) Phone when clicked goes to a number which has this number added before the number given "662453:"
c) Although I have a Web whatsapp installed on my laptop it says the link is wrong. On mobile it works.
d) When one clicks on Google Play icon for mobile app. the user cannot return to the front page but goes to the site home page. To return to the front page he has to login and logout.
e) Is it possible to remove the App. Store link or the version 4 of moodle supports mobile app. on IOS devices.
7) I have added sample videos in some blocks to check. However if you open a video for viewing one cannot return to the front page but lands on the site home page. (Front page means non logged in page). One has to log in and log out to land again on the front page.
Whenever I log into the site I get a mail saying new sign in. May be a version 4.0 addition. Can it be disabled or it will remain as default.
Thursday, August 04, 2022
Linux ls - listing files sorted by date
Wednesday, August 03, 2022
problems with mysql server on Windows Server 2016 and workaround
- When reinstalling, we must delete both C:\Program Files\Mysql directory as well as C:\ProgramData\Mysql before reinstalling if we want a fresh install with a fresh root password.
- Found
c:\programdata\mysql\mysql server 8.0\my.ini
which had
authentication_policy=0.0
According to https://dev.mysql.com/doc/refman/8.0/en/multifactor-authentication.html the valid default should be
'*,,'
but in our installation, it is set to 0.0 Tried commenting it out, then tried running from command line as mentioned in the ini file, (but correcting the path),
mysqld --defaults-file="c:\programdata\mysql\mysql server 8.0\my.ini"
That seemed to start, then immediately stop the server. So, no improvement. Probably there were other things wrong for Win Server 2016...
Saturday, July 30, 2022
Windows password - never expire
Windows passwords expire by default in 6 months. To prevent this, https://www.itechtics.com/set-windows-local-user-account-passwords-to-never-expire/
lusrmgr.msc --> Right-click relevant user --> Properties --> General tab --> (check) Password never expires

