Saturday, November 30, 2024

ffmpeg commands - image sequence to mp4

Listing some of the ffmpeg commands used in my previous post

ffmpeg -r 30 -start_number 1326 -f image2 -i "OpenSpace_%06d.png" -vcodec libx264 -crf 15  -pix_fmt yuv420p mars-valley-2.mp4

#and for reverse,
ffmpeg -r 60 -start_number -3037 -f image2 -i "OpenSpace%06d.png" -c:v libx265 -x265-params lossless=1 zoom-in-to-psn-lossless.mp4

and today,
ffmpeg -r 30 -i "%04d.png" -c:v libx265 -x265-params lossless=1 bloodcells.mp4
and 
ffmpeg -r 30 -i "%04d.png" -c:v libx264  ../bloodcellsx264.mp4

Wednesday, November 27, 2024

why it is a bad idea to have other people's product name in the name of your product/service

 Copy-pasting from an email exchange, when a well known name was proposed to be used for one of our servers - 

Why it is a bad idea to have other people's product name in the name of your product/service - though legally permissible, it is generally regarded as being due to incompetence or due to malfeasance (trying to scam people to get more traffic.)

https://www.nolo.com/legal-encyclopedia/question-trademark-infringement-use-company-name-28198.html

and so, we should choose another name.

Tuesday, November 26, 2024

upgrade Moodle 4.4 to 4.5

Since the theme for some of our Moodle instances was "Moove" and this theme had some updates which would work on 4.5 only after upgrading the theme, first changed the theme to the built-in theme "Boost" from the UI, completed the upgrade, upgraded the plugins including the Moove theme, changed back to Moove theme, OK.

The upgrade itself was 

screen
cd /var/www/theLMSgit
sudo -u www-data /usr/bin/php admin/cli/maintenance.php --enable
git config core.filemode false
#git branch --track MOODLE_405_STABLE origin/MOODLE_405_STABLE - this was done earlier.
git checkout MOODLE_405_STABLE
git pull
sudo chown -R azureuser:www-data .
sudo chmod -R 775 .
sudo -u www-data /usr/bin/php admin/cli/upgrade.php

Sunday, November 24, 2024

Activity dashboard in google docs

 There was a request from a user that he wanted activity to be turned on - 

he is not able to see who all opened the document through the shared link.

Copy-pasting from my reply - 

There is a misunderstanding about what the 'Activity Dashboard' does do and does not do.


Even though the "Activity Dashboard Settings" is set to ON, the activity will be visible only during the time the viewer is viewing the document, and not later. 







The (relevant) document pdf seems to be shared as "Anyone on the internet with the link". So, even at the time when someone is viewing it, if not logged in, that person will be shown as some anonymous name. For example, "Anonymous Squirrel" in this case - 




Also, the activity dashboard will not show anything until some user edits the document, it will show only the following info:






linux desktop shortcut to open a directory in terminal

Following https://unix.stackexchange.com/questions/62197/how-to-make-a-desktop-shortcut-that-opens-the-terminal-but-under-a-different-d

in our case, xfce4-terminal --working-directory=/the/relevant/directory

Friday, November 22, 2024

blender rendering settings

 By trial and error, for neuronDuplicated scene, fast rendering with acceptable quality - Blender Cycles render:

Noise threshold Off

Max time 1 seconds, 

1024 max samples, 

denoise on - seems to be fastest with good results.


For 3 cubes with video textures

0.5 noise threshold

4096 max samples

Max time 1 sec

denoise off

seems to be fastest with good results.

show the rules for creating username on Moodle - email based signup

There was a request for a method to show the rules for creating usernames (shouldn't have spaces, should be only lowercase) for new users registering on Moodle. 

While a help message is provided for the password, similar information is not provided for username...


My reply was:

https://our.moodle.server/admin/settings.php?section=manageauths
There is an "instructions" field available at the above link, which you can use to provide instructions to the people logging in. Maybe that might help you.

(Another option is to remove the option for users to enter Username, and instead only use Email address as username. But I'm not sure how to do that.)  

With this "instructions" field the problem seems to be mitigated - these instructions are shown on the login screen itself.

animating visibility for neurons scene in Blender

Creating this neurons scene

Shift selected to select multiple neurons, then Alt D to duplicate, move mouse to move, R to rotate etc.

In Blender, for keyframing visibility of objects - https://blender.stackexchange.com/questions/115526/trying-to-hide-object-during-animation

has screenshots. "Show in" > Viewports or Renders



Thursday, November 21, 2024

recaptcha and Moodle

Moodle has a feature of enabling Recaptcha for email-based registration. But when I tried it with the v3 version of the google captcha, it did not work. V2 works. So, go to recaptcha site, click through the options, choose v2 and not v3

(Moodle seems to have issues with v3? or was it that I did not wait a sufficient amount of time for the changes to propagate?)

modifications to activity completion report

We've had multiple requests for modifications to Moodle's activity completion report - 31 Aug 2023, the request was to add a cohort id, for which I replied (copy-pasting from email exchange)

Need help. In the activity completion report, we do not get cohort id /name. Could you please modify this system report to include cohort id?

Within my current limited understanding of moodle, I don't think this is possible. 

We can write some sort of ad-hoc report to have the contents of the activity completion report with cohort being one of the fields, but that would end up being
very complicated, because of the different numbers and names of activities over different courses.

A simpler option might be to filter inside google sheets or Excel based on users in the cohort you desire, after importing the csv of activities as one sheet, 
and the list of users + cohort in another sheet. An example is shown here,

 progress-trainer-coordi... (link to google sheet removed)


In the Method1 sheet, the last field EZ has been filtered to include only Our_Cohort_2_2023

There is one complication. Each user can appear in more than one cohort. I've used the LOOKUP function to map user to cohort,
=LOOKUP(B27,Cohortusers!D27:Cohortusers!D3199,Cohortusers!A27:Cohortusers!A3199)
but I think the LOOKUP function returns only the last cohort to which the user belongs. 
A better option might be, if you know which cohort you want, to use a function like
=IF(COUNTIF(OnlyOurCohortusers!$D$2:OnlyOurCohortusers!$D$87, B2)>0,"Yes","No")

This has been implemented in the Method2 sheet of the same spreadsheet file.

For some reason, both these methods seem to return 137 rows, even though the OnlyOurCohort sheet has only 85 rows of data.
I'm not sure why.

I have obtained the cohort users using a "custom report", Site Administration > Reports > (Report builder) > Custom reports
User id by cohort (link removed)

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

Then, in Nov 2024, the users wanted a volunteer to modify the code to add a column 'group' to the activity completion report. Again copy-pasting from an email exchange,

Some additional info to what [the volunteer] has written -

1. Activity completion report plugin is part of moodle core, hence will be updated every time Moodle has an update - which would be approx 3-4 times a year. So, any modified version in, say,
reportmodified/completion/index.php
may need to be edited / checked / corrected after each Moodle update. If it works, no problems. But if it doesn't work, code modifications would be needed.

2. Also, running queries on very large number of users has the possibility to make the database time out. Hence, filtering by smaller groups is advisable.

3. Due to 1 & 2, I would strongly recommend filtering by group, exporting to csv, and then if necessary, aggregating via Google sheets / Microsoft excel etc. 

4. The next best option would be to use ad hoc reports. Again, (2.) is a consideration, ad hoc reports can easily cause system lockups if not executed with care.

5. If (2.) is not an issue - that is, if the activity completion report of all users does not slow down the system, and if you can live with (1.) - that is, have the modified code work for now, but potentially break after a month or so, following which [the volunteer] would again need to check and re-modify the code, only then would I suggest asking him to modify the code and create a modified version of the activity completion report.

And the response was,
As of now the team is convinced that they can generate individual group wise reports. Presently there are about 10 groups. If the number of groups increases, we may need to think of a solution.

- meaning that as of now, no modified version is being used.

Wednesday, November 20, 2024

brain and neuron modeling in blender

How To Make a Brain in Blender

Brain Material Blender 2.8 Easy Tutorial

Download 3d model

Creating plastic texture - 
defaults, only change colour and roughness.

Final results, using the downloaded model, are at
https://github.com/hn-88/Blender-files/tree/main/brainmodel

referer in apache logs not seen in awstats

Trying to set up awstats for one of our servers which needed referer information to be captured - the referer info was not being displayed initially.

https://simonecarletti.com/blog/2009/01/logging-external-referers-with-apache/

Documentation said

better to have separate logs for each virtual server. So, set that up.

Purge old files (which contain irrelevant data during testing) by deleting from DirData

It is in /var/lib/awstats on our server.

And the main reason for referer not being displayed was the wrong logformat - it needed to be 
LogFormat=1
and not 
LogFormat=4 # default

Sunday, November 17, 2024

customizing email-based self sign-up in Moodle

Copy-pasting from an email conversation - 
  • There is a discussion here for customizing the welcome email for the students - https://moodle.org/mod/forum/discuss.php?d=389805

  • To change whom to send the confirmation email in the case of "self registration with admin confirmation"  - Navigate to `Site Administration --> Plugins --> Plugins overview --> Email-based self-registration with admin confirmation ( Settings ), you should be able to set captcha and admin email id to be whom the email to be sent. 

  • If you would like to change any email content,etc. Navigate to `Site Administration --> General --> Language customisation --> Choose English ‎(en) --> Open language pack for editing --> In filter strings choose auth_emailadmin --> Click Show Strings`, it has detailed descriptions on what each string means. If you would like to update/customise any email content, etc you can update there accordingly.

Friday, November 15, 2024

Moodle notification - Task failed: Send user digests

One of our Moodle instances showed this in the task logs:

SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingSMTP server error: QUIT command failed 
Detail: Too many login attempts, please try again later. For more information,

This could have been due to sending each email with a separate login - I have changed the SMTP session limit to 90 instead of 1 (which would have made the server log in repeatedly for each email).

Another possibility is that one of our development servers is also using the same email id for sending, and that is causing a "too many connections" error which is what the google support page linked above talks about. So, I created a separate email account for that server to send emails from the development server to prevent these errors from happening.

Thursday, November 14, 2024

how to change Google Play store screenshots for an Android app

For the particular app, from the Google Play developer console,

Store presence ->

(default listing)

--> at the right-hand side

scroll down to Graphics.

What I did for getting suitable screenshots was to take screenshots from mobile, and in landscape mode for tablet screenshots, since my Samsung M34 5G's screen resolution was high enough. 

Wednesday, November 13, 2024

onboarding a user on a linux webserver

sudo adduser theuser

https://duckduckgo.com/?t=lm&q=ubuntu+adduser+or+useradd&ia=web

https://tecadmin.net/generate-ssh-keys-in-pem-format/

ssh-keygen -m PEM -t rsa -b 4096 -f filenameOfKey.pem

and for the user to make modifications,

cp -r course coursemod
cp -r report reportmod

chown -R auser:www-data coursemod
chown -R auser:www-data reportmod


Monday, November 11, 2024

'send user digests failed' error on Moodle

 One of our Moodle instances had around 100 of "send user digest failed" messages. It appears that these are due to the following users (listed around 21 users). We can log on to the GMail email id being used to send emails from the server to check if these are due to "mailbox full" or whether it is due to wrongly entered email ids or something else.

Accordingly, one of the admins disabled notifications for these users.

I've confirmed that doing so -

Site administration > Browse list of users > (choose the user) > (Administration) > Preferences > Notification preferences > Disable notifications

does in fact change the "emailstop" column of the prefix_user table in the database. So, this is the correct procedure.

I have enabled forwarding of bounce notifications from two of our Moodle instances which send emails, to my email address, I will do this (Disable Notifications) for each bouncing email user going forward.

Sunday, November 10, 2024

notice to add the xapp status applet in Linux Mint Xfce desktop

 https://forums.linuxmint.com/viewtopic.php?t=319869

As the above forum posts said, the solution was to 

Right-click on the panel (the strip along the bottom of the screen)

Choose the menu item Panel > Add new items > XApp status

(But since such an applet is not visible, just set to ignore? - Status Tray plugin is added.)

Saturday, November 09, 2024

OpenSpace - running version 0.20.1 on Linux Mint 22

The space visualization tool OpenSpace - https://www.openspaceproject.com/ - has a deb file for download, but that leads to dependency issues with libboost - version 1.83-dev is what is installed for Ubuntu 24.04 on which Linux Mint 22 is based, and the .deb file depends on version 1.74-dev. So, advised to compile from source.

Following the instructions at Ubuntu — OpenSpace documentation - except had to replace 
sudo apt install libboost1.74-dev
with
sudo apt install libboost-all-dev following https://askubuntu.com/questions/922625/cannot-install-libboost-all-dev-because-dependencies-are-not-getting-installed

On the first try, with the downloaded source from the github releases page, got errors - 
include could not find requested file:
    /path/OpenSpace-releases-v0.20.1/ext/ghoul/support/cmake/message_macros.cmake

was because I had not done git clone --recursive

After the recursive git clone, the first few times make gave errors. We needed to do a checkout of the last stable release,
git clone --recursive https://github.com/OpenSpace/OpenSpace "$openSpaceHome"
cd "$openSpaceHome"
git checkout "releases/v0.20.1" --recurse-submodules

Otherwise, the current head was being built, with incompatible osrectxt format etc etc.

make -j was going quite fast, 65% in just a couple of minutes, but then the machine would hang. Finally worked out by running System Monitor that (a) swap was not enabled, and (b) certain longer jobs would cause significant RAM usage leading to all 8 GB being used and then a system crash. After enabling swap of 32 GB, continued with
make -j 2
doing 2 concurrent jobs instead of unlimited concurrent jobs - and now the linker complained that some symbols were not found. I suspected that this was due to the interrupted builds due to the crashes - so, 
make clean
make -j 2

That built the executable in around an hour on this ~10 year old Lenovo Thinkcenter desktop. When I tried to run it, after setting mrf cache to true in openspace.cfg and copying over the sync, user and mrf_cache directories from an earlier install on Windows, and setting the OPENSPACE_SYNC environment variable in .bashrc, errors just before the screen becomes usable - 
terminate called after throwing an instance of 'sgct::Error'
what():  [Engine] (3010): GLFW error (65547): X11: Standard cursor shape unavailable

Checked if it was running Wayland instead of X11 - using this method,
echo $XDG_SESSION_TYPE
x11

So it was running x11. And not Wayland. Checking for cursors in Software Manager, installing the base cursors did not solve the issue - 
sudo apt install xcursor-themes

OpenSpace would work so long as we didn't move the cursor inside its window. Controlling it via the HTML interface, through a web browser pointed to localhost:4680 was working.

Then thought of display managers and window managers - tried out Xfce desktop -
 sudo apt install task-xfce-desktop -y

Rebooted, logged in to Xfce desktop using the chooser next to the login name, and now OpenSpace worked fine. So, there's something in Cinnamon desktop which doesn't play well with GLFW.