Sunday, January 28, 2024

Google phasing out password-based SMTP / POP3 / IMAP

We got an email with "[Action Required]", with a link to this blog post from google - https://workspaceupdates.googleblog.com/2023/09/winding-down-google-sync-and-less-secure-apps-support.html

We have used two different methods to deal with this - one solution using XOAuth, and one using App Passwords.

1. For some of our Moodle instances which used Google Workspace emails for outbound emails, we could use the in-built XOAuth support as explained here,

Admins can enable Gmail XOauth2 for outgoing and incoming mail

So I created two separate sets of credentials for one of the email ids, since the redirect url for each (one production and one development) server would be different as mentioned in the documentation linked from the tracker link above -

server.url/admin/oauth2callback.php

Setting up OAuth 2.0 - API Console Help (google.com)

2. For our internal server using ssmtp as mentioned in this earlier post, this procedure (or the use of PHPMailer which supports XOAuth) would not be suitable, since it does not have a public-facing website url.

(
ssmtp seems to be orphaned since 2019, 

msmtp doesn't seem to have oauth,

describes a python solution, but needs refresh, and needs a browser.

)

In passing, the email from google mentions that App Passwords are not going away - "Password-based access (with the exception of App Passwords) will no longer be supported" . We had earlier created App Passwords for use with We can create App Passwords if we enable 2FA. So, we enabled 2FA, created an App Password, and just replaced the password in our earlier ssmtp configuration file with the App Password (without spaces). And that works.

 

Saturday, January 27, 2024

Firebase notification and action taken

 Firebase sent us an email with the information given in this link about email enumeration protection,

https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection

So, enabled the protection for the VV app's projects, following the procedure given in the bottom part of the link above.

Friday, January 26, 2024

sendgrid error after changing settings

When a moodle server had its domain changed, the sendgrid account it used to send password reset emails was still using the old domain. When the "From" email id was changed, sendgrid gave an error,

550 The from address does not match a verified Sender Identity

Two different ways to verify:

Domain Authentication, which is their preferred way - by adding three CNAME records and one txt record - and

Single Sender Verification

Thursday, January 25, 2024

Merriam-Webster dictionary api and moodle plugin

This moodle plugin "Dictionary" requires a one-time free registration to the Merriam-Webster api at https://dictionaryapi.com/ - they currently provide 1000 free lookups per day per key, and 2 free keys per registration. The plugin uses one key for dictionary, one for thesaurus.

Tuesday, January 23, 2024

spam via Moodle support form, and ways to prevent it

For the first time, I got some spam apparently sent via one of our Moodle servers. This forum thread describes the issue and the solution - 

Moodle in English: How to remove link to Contact site support to avoid SPAM | Moodle.org

Instead of commenting out, used the method mentioned lower down in the thread for Moodle 4.1 and above, by going to Site administration --> Server --> Support contact and changing the option to make it available only for logged-in users. Did the same thing for two of our production instances, too.

 

Friday, January 19, 2024

tech support options for Moodle

Copy-pasting from an email exchange - 

(Deleting the part about my availability)

Paid tech support by email/telephone - Nettigritty.com 
We have found that they usually respond within 3-4 hours.
But a caveat - they would only extend support for those services for which you have paid them. For example, if you have paid for web hosting, they will support you only in web hosting related issues. They may not be able to help you with open-ended questions or how-do-i-do-this-in-moodle type of questions, though, of course, you could ask them if they will do so.

Moodle tech support (paid) is available,
but I've not tried them.

Moodle documentation is available via 
and the forums,
Moodle in English: Forums | Moodle.org

Thursday, January 18, 2024

SheepIt render farm - benchmarks and mini-howto for rendering fluids/particle systems - Blender 3.0 to 3.6

As mentioned in my previous post, SheepIt render farm is a free render farm for Blender Cycles and Eevee engines, based on mutual co-operation - we connect our machines to the render farm to earn points, and can get our projects rendered in double-quick time in return. 

Their FAQ page lists answers to most questions one may have about the service. I've uploaded an example of a project which includes the baked cache for particle systems, on Github, here. As mentioned in their FAQ, the steps to do this are:
1. Make all paths relative - in Blender, choose 
File --> External Data --> Make All Paths Relative

2. If you need to render a baked fluid/particle system, zip the blender file and the cache directory, ensuring that the cache directory is also set as a relative path. In my case, I had set the cache directory to be inside the project directory to simplify matters. In the project above, this is located in the Physics tab of the Smoke Domain object as seen in the screenshot below. As you can see, the current directory is indicated by a leading double-slash - //.

3. One point to note is that choosing File --> Save As and saving the project to another directory, and then copying the cache directory there, does not work (as in Blender 3.2 on Windows.) This is probably because the file paths get mangled? Anyway, if you want to break up the project into multiple renders due to the bake files being too large, copy-paste the project outside Blender instead, don't use File --> Save As. 

4. There is a script available on the Forums for splitting the project, in case you want to automate the process. Or, like I did, you can just choose to bake all, and then copy only the .vdb files in the data subfolder of the cache for a limited number of frames. For the zoomed out view, for frames after 275, this was something like 30-50 frames per project. And choose to render only those frames. Then create a fresh zip file for the next set of frames. And so on.

Here are some project statistics, for the zoomed in project render, which was taking around 3 minutes per frame on my machine:

Summary

  • Storage used: 971.8 MB
  • Cumulated time of render: 9h01m
  • Points spent: 5,767 points
  • Real duration of render: 1h23m
  • On reference per frame rendertime: 0m51s
On my machine, the 600 frames would have taken 30 hours to render, and even on the Studio Mac it would have taken 5-6 hours, but SheepIt finished it in less than 90 minutes due to the power of distributed processing. 

So, nowadays I leave the sheepit client running whenever I switch on my machine, to accumulate points. A borrowed CPU from VV fitted with the GTX1050 Ti card which I purchased for my research also helps at the office. The 1050 Ti card is only 4% the speed of the standard GPU, but since most of the projects specify GPU, it usually gets some project to render, as against the i5-1235U laptop CPU, which often goes many minutes with "No jobs to render".

Statistics of the three client machines:

CPUIntel(R) Core(TM) i7 CPU M 620 @ 2.67GHz x4
RAM allowed1.3 GB
RAM available3.9 GB
Max render time per frame
Power CPU6 %

Schedulervery_slow_computer

-------------------------------------------------------------------------------------------------------------------------

CPUIntel(R) Core(TM) i5-4430 CPU @ 3.00GHz x4
RAM allowed4.8 GB
RAM available8.3 GB
Max render time per frame
GPUGeForce GTX 1050 Ti
VRAM4.3 GB
Compute deviceCPU, GPU
Power CPU34 %
Power GPU4 %
SchedulerDefault

-------------------------------------------------------------------------------------------------------------------------

CPU12th Gen Intel(R) Core(TM) i5-1235U x12
RAM allowed2.9 GB
RAM available8.1 GB
Max render time per frame1h
Power CPU72 %
SchedulerDefault

Edit: 17 Nov 2024 - interesting to see the bump in capability due to upgrading to SSD and running Linux on it, for the same machine - Power CPU and GPU went from 34% to 46% and 4% to 12% respectively - 
------------------------------------------------------------------------------------------------------------------------

CPUIntel(R) Core(TM) i5-4430 CPU @ 3.00GHz x4
RAM allowed6.7 GB
RAM available8.1 GB
Max render time per frame30 m
GPUGeForce GTX 1050 Ti
VRAM4.3 GB
Compute deviceCPU, GPU
Power CPU46 %
Power GPU12 %
SchedulerDefault

-------------------------------------------------------------------------------------------------------------------------


And finally, here's a youtube video of the rendered output. This is a "Fulldome" video, meant for projection in a planetarium. (Since this is my first effort, the launch needs more work to look more realistic - currently the motion of the rocket looks a bit cartoonish.)




Blender VSE - Video Sequence Editor - and image sequences

A quick note to myself - when importing image sequences into Blender VSE, we must ensure that the files are sorted by name in the file open dialog box (or in whatever order we want them to be) before selecting the relevant images, and then importing. Or else, some jumbled order will result in the imported sequence.

Wednesday, January 17, 2024

Blender render - hard-code metadata like frame number in output

For stamping rocket launch frame number, this page

says - Go to render tab, Enable Stamp, and choose the metadata you need.
 
That appears to be for Blender 2.78, which would have been the current version in May 2017.
 
In current version of blender, 3.2, the option is called Burn into image.
Font size 12 px by default, which would be extremely small for a 4K frame.  
 


Thursday, January 11, 2024

interesting device to "do your app busy-work for you"

Interesting device, heard about it via theverge because it sold out its first 10k run within 24 hours of launch - https://www.rabbit.tech/keynote  

Its USP seems to be that it can save you from having to tap through many clicks on apps using routines which can be launched by the push-to-talk device. If it really delivers on the promises given in the talk in the link above, it might become the "next big thing."

Tuesday, January 09, 2024

blender rendering notes - part 2 - and SheepIt render farm

  1.  As noted in the previous post, time-remapping to make the animation slower does not work well with particle systems, probably because baking is not done for fractional frames. A similar issue is discussed here.

  2. A gotcha for me was that the keyframes for the rocket animation were not visible in the timeline, but some other keyframes, like the camera field of view animation which I had added, were visible.


    So, dragging these keyframes to newer locations further along the timeline was not enough - I had to go to graph editor, and make sure the filters had "Show hidden"

    and then the keyframes (after 1000 frames) were visible.


  3. More notes and links to tutorial video timestamps below, 

Need to tweak both 
Smoke Domain physics tab and 
Emitter (circle) physics tab

Also maybe wind speed
(I did not change these, so now the rocket exhaust is almost twice as violent as in the previous version.)

Emitter
Density 5
Fuel 2

Initial velocity -12

Smoke domain settings - 
resolution divisions to 128 to reset smoke domain

In replay, can see rendered view smoke
Bake all is in Smoke Domain physics tab.

Can go to shading node editor -> World and add a background, default is white

Nishita sky texture, elevation 3 degrees for dusk look

Sun rotation 62 to light up rocket by sun

Adding HDRI and adjusting

(Before the final render, I made the sky darker with 
Shader view -> World -> HSV dialled Value to 0.5 )

Shift click on to-be parent, Ctrl P to make it parent.

Ctrl J to join the 3 cylinders of LVM3 - M4 to make a single object.

To pack blender file to make it portable,

File->External data->Automatically pack into .blend

Getting rid of unwanted assets:


Outliner -> orphan data

Also deleted grass etc.

GPU - make sure both CUDA and the device are selected!

For tile size, see
under Performance, Memory, Tile Size. Only for memory's sake, so we need not bother about tiling for our renders.

On a Mac at Studio, renders a frame in around 26 seconds with CPU and 18 seconds with GPU. So maybe 5 hours to render 1000 frames, as against a couple of days on my i5 machine without GPU.

Sheep-It distributed free rendering - leaving the machine on and connected for around 4 hours earned 1600 points. There are some caveats to using baked particle systems as mentioned in their FAQ (Does SheepIt support fluids?), need to zip the folder and make sure it is less than 750 MB, but non-particle renders should be do-able. With the 1600 points as noted, my project was halfway up the queue, and started rendering after a 5 minute or so wait. Or maybe the wait was shorter, just needed to go to the Projects page to see an update. 100 frames done on 5 minutes, which on my machine would have taken 5 hours or so. But the "shephering" server might have been busy, so the last frame was shown as "in progress" for a long time - 10 minutes or so. But since we get an email when the project is done, actually no need to sweat.

playing custom local video playlist from Kodi

The way to play local videos as a playlist seems to be, as per this forum thread

right-click or C in the Files view to get the context menu for a video file,
choose to queue it,
the file view automatically jumps to the next file in the folder,
right-click or C and choose to queue it and so on,
and when all the required files are added,
left arrow for the hidden menu, choose Go to Playlist,
then choose Save - it will now ask you for a filename for the playlist.

In order to play this playlist, from the home screen,
choose Videos (NOT Movies)
choose Playlists
highlight the desired playlist,
C for context menu, and choose Play.
Or press P to play after highlighting the desired playlist,
after which you have to press TAB for full-screen video without the menu.

List of keyboard shortcuts is at https://kodi.wiki/view/Keyboard_controls

Most of the options like audio device are in the Kodi Settings (gear icon on top of home screen.) LibreElec settings for system name, keyboard layout, etc.

Monday, January 01, 2024

problems with Sony player 4K playback on planetarium dome

We have a Sony HD player for playback of 1080p files - works well for XVID-encoded files. When we had issues with the Firestick for playback, we tried out the Sony UBP-X700 4K Ultra HD Blu-Ray Player even though it was very much more expensive - Rs. 30k compared to the Firestick 4K's Rs. 5k. But unfortunately, it did not work out.

Problems with the Fire TV stick 4K were:

  • Using the Amazon Firestick 4K for playout is extremely flaky - since the firestick keeps checking Amazon for updates and auto-updates, sometimes the show stops playing.  
  • Audio has to be taken from the projector's EP audio out, and has a lot of hiss. 

 Problems with the Sony were:

  • It was starting up in 4K 60 Hz which our projector did not support
  • It was changing modes when playing files with different resolutions and frame rates, causing delays and missed frames between files.

So we returned that, and are leaning towards playback using a Raspberry Pi 4.

The earlier models of R Pi, which we already have, do not support 4K. Raspberry Pi 5 has also come out now, which is slightly more expensive, but which we don't necessarily need.

Estimated prices:
Raspberry Pi 4  - Rs. 6,500
Power supply - Rs. 1,000
HDMI mini to HDMI adapter - Rs. 664

The following items may also be required, which we might buy later if required:
Keyboard - Rs 300
Mouse - Rs. 300
HDMI mini to HDMI adapter - Rs. 664
(we may need 2 of these)
USB sound card, high quality - Rs. 2,000
Case with cooling for R Pi - Rs. 2,000
Mini SD card - Rs. 600

 Edit: Raspberry Pi 4 running Kodi and a pre-owned external USB Lexicon Alpha audio interface is what we're using as of May 2024.

Sunday, December 31, 2023

gpu cpu render time comparison

 https://blenderartists.org/t/blender-stats-cpu-gpu-comparison/1364344


i5 to 1080 GPU seems to be 888 to 325, approx 3x speed-up.
 
Edit: See also, posts which have a comparison with the Studio Mac, and using SheepIt render farm.
 

rendering tips for Blender - noise threshold

To speed up Blender rendering with cycles -

About noise threshold
https://medium.com/@samuelsullins/your-first-real-render-in-blender-a27d3049d659

(also mentions tip about Lock Camera to View for easily manipulating camera by viewing through it).

For 720p, 100 samples should be plenty,
https://blenderartists.org/t/cycles-how-many-sample-should-i-render/1466873

Recommended workflow now is to set a noise threshold, and allow the number of samples to be dynamically set. - You need to set a time limit.
https://blenderartists.org/t/question-about-noise-threshold-in-3-0/1354392

Thursday, December 28, 2023

Wordpress users unable to log in

Troubleshooting request - admin users got logged out of Wordpress, unable to log in, "reset password also not working".

Rebooting the server has not resolved the issue.

The users shared this page,

https://blog.hubspot.com/website/locked-out-of-wordpress

Reset the password by connecting to the database and editing the users table, getting the MD5 hash of the password using

echo -n testpasswrdreplacewithcorrectone | md5sum

which works fine, tested with

 
Still could not log in, so renamed the password security plugin directories as mentioned in the post above, located in public_html/wordpress/wp-content/plugins
password-protect-page
and
password-policy-manager 
in this case, renamed to the directoryname_deactivate or whatever.

Then login works.
 

Friday, December 22, 2023

frame repeat / drop bug

Found frames being repeated (or dropped?) with a ~20 minute video processed with OCVvid2fulldome - found duration had reduced from 24 minutes to 22, and also some jerkiness in motion. The github issue is here.  

Possibly this is due to using ffmpeg in the backend, and this issue?
https://superuser.com/questions/1255380/ffmpeg-duplicating-frames

ffmpeg seems to assume 25fps input as default for frame sequences, and adds duplicate frames if output is 30 fps. https://gist.github.com/hn-88/95dbd59767dcdff23eab2f2be5880c2f

-fps_mode passthrough

seems to be a workaround when using ffmpeg from the commandline, but when ffmpeg is used via OpenCV, how do we manage this? 

generate a video with frame numbers

 Using ffmpeg, can use the following

Generate a video of frame numbers. (github.com)

This can be used to test for bugs like this one, 

frames being repeated or dropped · Issue #10 · hn-88/OCVvid2fulldome

Tuesday, December 12, 2023

update to Moodle minor update post - stop git from complaining about file permissions changes

Found a couple of issues while upgrading using the steps given in my previous post regarding Moodle minor update using git -

  1. If we uninstall the h5pactivity built-in plugin before the upgrade, the upgrade does not proceed - it complains about corrupted plugin. So, basically, we can't uninstall the default plugins without causing issues with upgrades.

  2. If we change the file permissions, we need to add a command
    git config core.filemode false
    to prevent git from complaining about overwriting local files, listing all the files, and aborting the git pull. Via this post.

So, the updated list of commands:

cd /var/www/theLMSgit
sudo -u www-data /usr/bin/php admin/cli/maintenance.php --enable
git config core.filemode false
git pull
sudo chown -R azureuser:www-data .
sudo chmod -R 775 .
sudo -u www-data /usr/bin/php admin/cli/upgrade.php
(type y when prompted)

 

workflow and supported codecs

Workflow for creating files playable at our theatre using only cross-platform tools.

  1. ffmpeg to create mp4 file if input is frame sequence - as in this post,
    ffmpeg -r 30 -f image2 -i "Our-frame_%06d.png" -vcodec libx264 -crf 15  -pix_fmt yuv420p Our-movie-4k-frames.mp4

  2. OCVWarp to create warped file. Fourcc of avc1 results in x264 video, good quality.

  3. Avidemux to edit the warped file, move the credits to the beginning and speed up credits. Also overlay Hindi / Telugu title text as graphics using the logo filter.
     
  4. To note: Firestick 4K needs FAT32 formatted disk, which has a 4 GB file size limitation. So, re-encoding files with x265 (HEVC) using the options in the Configure button to choose file-size based codec quality. This takes around 8 hours to encode a half-hour 4K 30 fps video on an i5 laptop!

  5. Similarly, the older BluRay player needs to have 1080p encoded with XVID fourcc. x263, I guess. 

Upcoming - perhaps try AV1 codec?

https://trac.ffmpeg.org/wiki/Encode/AV1

 

Sunday, December 10, 2023

Moodle server down - restart db server fixed it

Uptimerobot alerted me that one of our Moodle servers was down.

The database server is not responding, that was the reason.

Initiated a restart, hoping this may solve the problem. 10 minutes later, systems were up.

Copy-pasting from an email exchange about the reasons:
 
It could have any of the following causes:
1. automated bot attack
2. some services not restarted properly after an automated system update
3. some other issue triggered by some user action

Right now I'm not digging into the logs for troubleshooting, in case the issue happens again, will do more digging.

We anyway would need a server upgrade some time in the first half of 2024 for operating system upgrades - at that time, I could tighten some of the parameters for better security (like the open ports with default services present currently).

Friday, December 08, 2023

Wordpress permalink issue

One of our servers' site admins reported a problem, with "remove the index.php from the URL" - the standard method of 
WordPress dashboard --> Settings --> Permalinks --> "Post Name" Permalink, Save Changes
did not work for them. "File not found" error.

Checked the .htaccess file, it seemed to be OK.

But looking at how Apache handles .htaccess files, found that AllowOverride would be needed for the .htaccess files to work.

Following

https://ubuntu.com/tutorials/install-and-configure-wordpress#4-configure-apache-for-wordpress

added the lines

<Directory /oursrv/path/to/www/wordpress>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.php
        Require all granted
    </Directory>

to the relevant files in /etc/apache2/sites-available and then did

sudo service apache2 reload

The admins report that this solved the issue.

Saturday, December 02, 2023

Update your trusted root store for Azure Storage services

We got an email from Azure, asking us to update our trusted root store for Azure Storage services - "If you have client applications that still use certificate pinning, they'll be affected by this change and you'll need to take action by 29 February 2024 to avoid potential connection interruptions."

I don't think any of our apps or services use certificate pinning, so did not take any action.

Wednesday, November 29, 2023

converting flat video to fulldome

Leaving aside paid products like Adobe After Effects, for multiple videos on a fulldome frame, a good option would be OCVvid2fulldome

If we want to project a high resolution, say 4K flat-screen video onto the dome, OCVvid2fulldome v1.6 or above, with the following parameters works relatively well, except for some slight distortion at the bottom and top edges - 
#Outputw_pixels__=height
4096
#Output_fps
30
#Output_fourcc
XVID
#Number_of_input_videos_max_is_99
1
#Filename0
D:/Input/Filenm.avi
#vidlongi0
180
#vidlati0
76
#vidw0
270

Example images - 
Flat, 16x9

Using OCVvid2fulldome with 270 degrees coverage as above:


Another option is Natron, which has a G'MIC Distort filter for "Square to Circle" as referenced in this video. But Natron is prone to crashing for video to video conversions, image sequences seem to work OK. Also, Natron renders at something like 2 seconds per frame for 4K output, at least 4x slower than OCVvid2fulldome.

Square input - 


to Circle output - 

Natron troubleshooting notes:

im seq crashes were probably due to wrong way of entering filename?

im_%05d.jpg works well. Also need to check if the pre-multiplied value is correct, Opaque is fine for RGB video. Natron Tutorial | How to Render / Export / Write - YouTube

In the video link above, he has to re-render missing frames! and creating a proxy mov file at around the 13:00 minute mark.

troubleshooting premiere import - source settings, set the R, G, B.

Some frames randomly lo res!

Use precomp for large script if rendering fails!

saving script can overwrite a jpg!

To make a 16x9 video into a square video, padding with 1080 black border on top - does not look good - too small on the dome. Need to crop to square, so the sides are lost. 




Wednesday, November 22, 2023

saga of backing up and restoring a course with H5P content on moodle

My initial understanding was that backing up and restoring a course with H5P content on moodle would not work, based on the discussion at https://moodle.org/mod/forum/discuss.php?d=427198

A test course backup and restore did not work. But then, it turned out that the issue was that the H5P plugin mod_hvp had some missing files (since this moodle instance had its database copied over from another test instance) which were causing H5P content to not display at all. Diagnosed via php errors in /var/log/apache2/error.log.

The relevant course had 90+ H5P activities, it took 2.5 hours to backup via the CLI, and the restore also is likely to have taken a similar amount of time. 
screen
date && sudo -u www-data /usr/bin/php admin/cli/backup.php --courseid=511 && date
Mon Nov 20 14:38:34 UTC 2023
== Performing backup... ==
Backup completed, the new file is listed in the backup area of the given course
Mon Nov 20 17:09:05 UTC 2023

Detailed notes and dead ends listed below.

Looking at the discussion here,
It seems there are two ways in which H5P files can be used in a course - as a "link" and as a "downloadable file".
The "downloadable file" method is such that the course instructors cannot edit the content from the server, they need to download it to their computer and use some other software to edit it - so I guess what you have used is the "link" method.

In that case, there seems to be no easy way to backup and restore, the easiest way may be to re-create the course on the new server, if my understanding of the discussion here is correct - 

(
Another option would be to copy the entire database of the learning server onto the student server - and then you would need to
delete all unnecessary users
delete all unnecessary courses
re-upload files for all necessary courses
re-upload all files for appearance, logo, etc.
but this seems to be more difficult that re-creating the course. 
)

(
According to the last-but-one comment in the bug tracker
course backup and restore would work, but only tested on the same server. 

I tried out the command-line backup option for that course,
but that also did not finish even after an hour - stopping it manually gave the error message
Potential coding error - existing temptables found when disposing database. Must be dropped!
This looks like some sort of bug in the moodle backups code, I guess.

Or maybe just some temp tables which need to be dropped.

Apparently temp tables are automatically dropped when the connection to the database is closed.

)

(
Checking
moodledata/temp/backup/ directory
and
and

Even after clearing the moodledata/temp/backup directory, even a small course is taking a long time to backup.
So, there may be some temp data tables which need to be dropped. Need to check - 
Potential coding error - existing temptables found when disposing database. Must be dropped!

SELECT * FROM information_schema.INNODB_TEMP_TABLE_INFO;
(no results)
)

mentions backup can hang if non-standard course format

delete a file
go to course, choose the file / activity / resource, choose delete

delete a course

h5p backup speedup by disabling backing up libraries

Backup settings page, choose not to include the libraries
But not available in
Site Administration - Courses - General backup defaults

Will enable async backup with
https://devel2.server.of.ours.org/admin/settings.php?section=asyncgeneralsettings
and try.

Tried creating a course on devel2 with
My Courses -> Create new course.

Backup option is inside the course, under More -> Course Reuse -> Backup

Restoring similarly,
can go to any course, More -> Course Reuse -> Restore
and then choose to restore to a new course.
(NOT Import)

Just as in the learning portal, on the student portal also, the H5P hub option is turned on,
https://our.server/admin/search.php?query=hub

I have turned off and turned on this setting as suggested in one of the replies in the thread

In case that does not help, it may be required for you to fill in the H5P Hub account settings,
Register an account on the H5P Hub here

If not,

Another possible cause for confusion may be the two different ways of using H5P, using a plugin and using H5P core.
This discussion above uses Moodle 3.9, but our case with Moodle 4.1 might be different, too, and we might have to investigate further.

mod_h5p and mod_h5pactivity are already installed by default in Moodle 4.
https://server/admin/plugins.php

I tried creating a simple h5p activity in a test course by uploading a file arithmetic-quiz-22-57860.h5p, but the activity is not visible on the student site

To display H5P content in Moodle activities, the Display H5P filter must be enabled, and the URL (e.g., h5p.com) should be listed as an allowed source in Site admin / Plugins / Filters / Display H5P.


https://docs.moodle.org/401/en/Display_H5P_filter

Found a google drive listed there,

https://drive.google.com/file/d/1Mviw-REDACTEDZ3F/view?usp=sharing

After removing, still no. 

I see two possibilities.

1. In the page which talks about setting up h5p on moodle, there is mention of a filters page, where the url of the h5p server should be entered - 
There was a google drive link in that filters section which I have now removed. But then, we may need to add the correct filters. Or perhaps the "show h5p content"  may be sufficient, which is done at this page,
https://server/admin/filters.php 
If you have some url with a working h5p content from the hub, we can put the appropriate url in
https://server/admin/settings.php?section=filtersettingdisplayh5p

2. Another possibility is this thread - 


1. files missing as seen in apache2 errors.log


2. Compatibility issue with PHP 8,

But we're using PHP 7.x, so not this issue.

Trying uninstalling both
mod hvpactivity and mod hvp
installed only mod hvp, working
While installing mod_hvp, it mentioned "automatically registering your site with h5p" - so that is also done.

Even the web-based backup worked, for the test course! Just took an hour. and included 4 MB.

For without user data,
first change backup default setting at
(take backup and then change the default back)

CLI backup completed in around 2.5 hours, it is available to download from the course's restore area
in "User private backup area" of admin user

Tuesday, November 14, 2023

moodle app build for v4.3.0

Some small changes were needed in the github workflow in order to build the latest version, 4.3.0, of the moodle android app. My earlier posts about building the moodle app can be found here

Trying the old workflow led to some errors like

Failed to restore plugin "cordova-plugin-screen-orientation". You might need to try adding it again. Error: Error: Command failed with EACCES

Checking the testing.yml in the 4.3.0 tag found some extra lines like 

npm ci --no-audit --prefix cordova-plugin-moodleapp

Adding that led to a different error,

 cordova-plugin-moodleapp@0.0.0 prod /home/runner/work/LMSapp/LMSapp/cordova-plugin-moodleapp

> NODE_ENV=production scripts/build.js

sh: 1: scripts/build.js: Permission denied

Trying the simplistic solution of giving run permissions for everything,

chmod -R +x ./*

This worked, except for needing resources/android/icon-background.png to be added manually as in earlier releases. 

Tweaked the build script to directly pull the codebase of the release from github instead of manually adding it, with all customizations from our private repo which has the following file structure:



 

 

 

Monday, November 13, 2023

moodle app ui for multiple logins

Once logged in to one site, if someone has a login in another site also, they can log in to the other site by tapping on their profile icon on the top right corner of the screen and choosing the "Switch account" option, even without logging out completely.

using mv to move hidden files from a script or command line on Linux

mv subfolder/{.,}* /path/

But this can cause scripts in github actions to fail, so using cp -r instead.

show hidden files in Linux Mint File Open Dialog

 

 Ctrl+H to toggle show/hide hidden files!

Saturday, November 11, 2023

mirror ipad screen on Windows PC

 https://www.howtogeek.com/247573/how-to-mirror-your-iphone-or-ipads-screen-on-your-windows-pc/

Install AirPlay Screen Mirroring Receiver (free) from the Microsoft Store, open it.

Open the Control Center in ipad/iphone by swiping up from the bottom, or down from the top right edge, depending on which version of iOS you have. Then tap "Screen Mirroring." The PC should appear on a list of available devices.

But some apps like Disney + Hotstar don't work if mirroring is enabled, "Please try again after disabling screen recording".


Friday, November 10, 2023

the beginning of the end of Google

Whatever goes up has to come down. Ever since it went public, Google seems to have slowly but surely gone down the road that leads to its ultimate decline. People were discussing this in 2006, but now even their flagship Google Search seems to have gone downhill with their policies put in place (probably to avoid abuse). 

Case in point - a personal blog, created on blogspot.com (owned by Google!) was not being indexed. Even after submitting the sitemap created by blogspot itself, Google Search console shows that blog as being crawled, but not indexed. Whereas bing.com and duckduckgo.com at least show the pages on the site if the keyword site:actual.url.of.the.site is used. After filling up the "submit feedback" form on Google Search Console, of course, there was no response whatsoever.

Cory Doctorow, of course, has written about it eloquently on medium -
https://doctorow.medium.com/googles-enshittification-memos-2d6d57306072

and the ad-free, login-free version on

https://pluralistic.net/2023/10/03/not-feeling-lucky/#fundamental-laws-of-economics

Edit: Here is a Google insider's take on Google's cultural erosion - via slashdot, 

Hixie's Natural Log: Reflecting on 18 years at Google

Wednesday, November 08, 2023

turning off some notification types in a default Moodle install

It is probably prudent to turn off "forum" and "new login" notifications in a new moodle instance to avoid users' email providers marking the emails from the server as spam, and to avoid exceeding quota limits if using GMail / Google Workspace / other provider with daily quotas.

Tuesday, November 07, 2023

zoom effect in blender without moving camera

 By animating the focal length property of the camera, we can get the equivalent of a zoom lens effect in blender, without moving the camera.

https://blender.stackexchange.com/questions/23783/zoom-with-camera-in-an-animation

getting started with google search console

Google webmaster tools have been moved to google search console. Got an email after signing up, "Now that you've verified your site in Search Console (or created a site in Blogger or Google Sites, which verified your site for you) we have some tips to help you use Search Console more effectively."


Sent a report via google search console. The above page gives detailed about search indexing problems like "crawled, not indexed."
 
Edit - more about "crawled, not indexed" in this post, https://hnsws.blogspot.com/2023/11/the-beginning-of-end-of-google.html

Probable reason for crawling and not indexing could be that most of the posts are back-dated to the 1990s and some in the mid 2000s.

Bing does index it though. And so duckduckgo does too, since it uses Bing for the back-end.

Friday, November 03, 2023

adding a file to an appimage

To test out the script in the interesting discussion
https://github.com/Stellarium/stellarium/discussions/3424

I tried to add the script in the discussion to an appimage of stellarium 19.3. It turns out it's not that easy, but some things can be done.

https://superuser.com/questions/1301583/how-can-i-extract-files-from-an-appimage

suggests the --appimage-extract command-line option, but is not very explicit on whether the option should be run on appimagetool or on the appimage itself.

https://unix.stackexchange.com/questions/517881/how-can-i-change-the-files-of-an-appimage

clarifies that the option is to be run on the appimage itself, and not on appimagetool.

So, that extracted the files into ./squashfs-root, and I could add the new script into the scripts directory. But when I tried to create an appimage from the modified squashfs-root using appimagetool, it failed with an error,

org.stellarium.Stellarium:~: metainfo-filename-cid-mismatch

Googling led me to https://kb.vmware.com/s/article/1007969
which says that we should manually correct the cid for similar errors with VM images. But that advice doesn't seem to be relevant here. 

In any case, the bin directory inside ./squashfs-root had a stellarium executable which could run, and the extra added script also showed up.