Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)
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 24, 2024
Upgrading a dot net + Wordpress server from Ubuntu 22.04 to 24.04
Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)
Tuesday, October 22, 2024
Deleting many GBs of course content from Moodle
checking ssd size
Thursday, October 17, 2024
Moodle - Activity Completion Restriction not visible
maybe you can save changes, log out and log in again and then it becomes visible.
Wednesday, October 16, 2024
H5P on moodle - core activity vs mod_hvp plugin
Moodle - change course backup location
Exploring if we could change the "manual backup" location for courses, to put the backups in another directory rather than along with all the other files in moodledata/filedir, tried changing in Site Admin --> Courses --> Backups --> Automated backup setup -
But it looks like the path set there in backup_auto_destination seems to be valid only for automated backups. The manual backups initiated from the course are still saved in filedir. So, while taking backups of the entire server's moodledata directory, we are forced to take backups of backups.
Moodle plugin upgrade - click to upgrade not available
On one of our newly migrated Moodle instances, the "Click to update" button to update plugins for which updates are available, was not seen - only the button allowing us to download and then manually update the plugin was visible. As mentioned in this discussion,
https://moodle.org/mod/forum/discuss.php?d=434830
it was a permissions issue.
sudo chown -R azureuser:www-data .
sudo chmod -R 775 .
and hey presto - the install button came back when I went back to the plugins overview page.
Tuesday, October 15, 2024
rclone authentication by tunneling port did not work the second time
On one server, we used the method
https://hnsws.blogspot.com/2023/01/backing-up-mysql-databases-to-google.html
to set up an rclone remote with a shared google drive.
sudo dpkg -i rclone-current-linux-amd64.deb
to install latest rclone, tunnel port 53682 with putty so that we can authorize with browser.
When we tried with another server, exactly the same way, error that localhost refused to connect. That is, the port 53682 tunneling and authentication for rclone was not happening.
Tried things like rebooting the local Windows machine, trying another browser and so on. But the only thing which worked was to do the "headless" option in rclone - first downloaded the latest rclone exe file, overwrote the version in C:\Windows which I had used earlier, and followed the online prompts.
https://rclone.org/remote_setup/
Maybe this is due to some sort of caching? But persisting after reboots? No idea. More probable might be some typo in configuring the tunnel in putty, I guess. Or maybe the port was being tunneled elsewhere or something like that.
Monday, October 14, 2024
default behaviour for unattended-upgrades
optimizing mysql for Moodle
Following
https://docs.moodle.org/405/en/Performance_recommendations#MySQL_Performance
That page pointed to
https://dev.mysql.com/doc/refman/5.7/en/innodb-buffer-pool-resize.html
SELECT @@innodb_buffer_pool_size/1024/1024/1024;
+------------------------------------------+
| @@innodb_buffer_pool_size/1024/1024/1024 |
+------------------------------------------+
| 0.125000000000 |
+------------------------------------------+
1 row in set (0.00 sec)
mysql> \q
Can increase at least to 2G.
https://stackoverflow.com/questions/19534144/how-to-set-global-innodb-buffer-pool-size
mysql -u root -p
SET GLOBAL innodb_buffer_pool_size=2G;
ERROR 1232 (42000): Incorrect argument type to variable 'innodb_buffer_pool_size'
https://convertlive.com/u/convert/gigabytes/to/bytes#2
SET GLOBAL innodb_buffer_pool_size=2147483648;
Query OK, 0 rows affected (0.01 sec)
Running mysqltuner
https://www.linode.com/docs/guides/how-to-optimize-mysql-performance-using-mysqltuner/
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
Check warning line(s) in /var/log/mysql/error.log file
Check error line(s) in /var/log/mysql/error.log file
Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=ON
We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
See https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_join_buffer_size
Be careful, increasing innodb_redo_log_capacity means higher crash recovery mean time
Variables to adjust:
skip-name-resolve=ON
join_buffer_size (> 256.0K, or always use indexes with JOINs)
table_definition_cache (2000) > 3098 or -1 (autosizing if supported)
innodb_buffer_pool_size (>= 12.4G) if possible.
innodb_redo_log_capacity should be (=512M) if possible, so InnoDB Redo log Capacity equals 25% of buffer pool size.
innodb_buffer_pool_instances(=2)
innodb_log_buffer_size (> 16M)
So, on our Ubuntu 24.04 server,
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
skip-name-resolve=ON is not found
join_buffer_size (> 256.0K, or always use indexes with JOINs) is not found
Tried editing my.cnf directly and restarted.
But restart failed. Need to enter with spaces between = ?
innodb_buffer_pool_size = 2G
This change worked OK on restarting mysql.
innodb_buffer_pool_size = 2G
#join_buffer_size = 256.0K this crashes.
innodb_redo_log_capacity = 512M
innodb_buffer_pool_instances = 2
innodb_log_buffer_size = 16M
The above worked. Not doing the other recommendations, as a mysql restart crashes.
Some more recommendations, which we have not done:
Consider using postgresql instead.
Optimize your tables weekly and after upgrading Moodle. It is good
practice to also optimize your tables after performing a large data
deletion exercise, e.g. at the end of your semester or academic year.
This will ensure that index files are up to date. Backup your database
first and then use:
mysql>CHECK TABLE mdl_tablename;
mysql>OPTIMIZE TABLE mdl_tablename;
The common tables in Moodle to check are mdl_course_sections,
mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any
errors need to be corrected using REPAIR TABLE (see the MySQL manual and
this forum script).
Maintain the key distribution. Every
month or so it is a good idea to stop the mysql server and run these
myisamchk commands.
#myisamchk -a -S /pathtomysql/data/moodledir/*.MYI
Warning: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.
Saturday, October 12, 2024
understanding 'load average' in Linux
When we run the top command in Linux, we see three numbers depicting "Load average". What are they? and how much should they be?
https://scoutapm.com/blog/understanding-load-averages
1. The three numbers are one-minute, five-minute and fifteen-minute averages.
2. For a server, the load average should be 0.7 or below for a single CPU.
3. We can do cat /proc/cpuinfo to find the number of CPU cores. For a 2-core machine, below 2*0.7=1.4 would be healthy.
Saturday, October 05, 2024
reduce the brightness of an hdri background
Turn down camera exposure / settings, adjust strength of background image
Cycles render engine - Outdoor HDRI too bright - Blender Stack Exchange
Can use two nodes for background also, one to light the scene and one for the camera to see.
Explanation of "factor" at
Make realistic environment lighting in Blender (in 10 mins) (youtube.com)
Tuesday, October 01, 2024
run LLMs locally - howtos
Via slashdot -
'Forget ChatGPT: Why Researchers Now Run Small AIs On Their Laptops'
Nature published an introduction to running an LLM locally,
which links to
5 easy ways to run an LLM locally | InfoWorld
For good (close to real-time) performance, would need 64 GB or RAM etc. But if speed of response is not important, we can use swap to run larger models than RAM allows, https://ryanagibson.com/posts/run-llms-larger-than-ram/
Monday, September 30, 2024
render multiple cameras simultaneously in Blender
I didn't try this out - Render Multiple Cameras Simultaneously in Blender! (youtube.com)
using stereoscopy -> multi view in output properties.
fulldome render with eevee and cycles
This is an old post on blendernation about eevee on Blender v2.8 - Rendering Stereoscopic 360 footage with EEVEE - https://www.blendernation.com/2020/08/25/rendering-stereoscopic-360-footage-with-eevee/
(doesn't work with Blender 4.2 for me)
Rendering fulldome images in Cycles on Blender -
Double-click the camera icon under camera to make its properties show up. Choosing Panoramic - Equisolid gives me good results.
Friday, September 27, 2024
google street view to video of trip
I had an idea of using google street view imagery and converting it to a video using google apps script or something similar. Obviously, many people have thought of this earlier.
https://github.com/TeehanLax/Hyperlapse.js
from
https://www.geographyrealm.com/create-videos-using-google-streetview-hyperlapse/
And the way to make it work seems to be to add an API key,
https://github.com/TeehanLax/Hyperlapse.js/issues/40#issuecomment-642969953
And apparently the API key now needs a billable account.
Mentioned here,
https://github.com/jblsmith/street-view-movie-maker
and forked for python3 here,
https://github.com/vardhman/street-view-movie-maker/tree/python3-support
So, currently no plans to try it out.
Google Sheets charts "add a series to start visualising your data" error and solution
Generally, we just select a range in Google Sheets and choose Insert -> Chart to get a chart automatically created from that range. But while debugging this issue, I had imported data from a text file which I had saved as csv after find/replace of spaces with commas, but google would not create a chart, instead showing "add a series to start visualising your data" and when I would add a range, it would say improper format.
It turned out that Google sheets had treated the numbers as text. So, the solution was to select the relevant ranges, Format -> Number -> Scientific (and then change back to Number or Automatic if required) . Once that was done, the automatic creation of charts worked.
Wednesday, September 25, 2024
video texture UV unwrapping
https://www.youtube.com/watch?v=E1COCnMUIhQ - Import Any Video Into Blender With Animated Image Texture or Video Texture
https://www.youtube.com/watch?v=ZqsDjCVBkiw - Blender 3.4X: How to use a video as a texture
This one gives how to easily get UV right.
Choose front view -- unwrap -- project from view.
Edit - https://docs.blender.org/manual/en/latest/editors/uv/controls/snapping.html
Hold Ctrl to snap UV to edges? - finally did not use, as we wanted cubes and the video was 16x9, so snapping the video to edges would have distorted.
dvddecrypter on wine etc - did not work
For making dvd visible on wine,
https://ubuntuforums.org/showthread.php?t=1946371
check the path which is getting auto added
https://forum.winehq.org/viewtopic.php?t=32891
first run winecfg to make sure correct drive is mapped AFTER putting in the DVD, then run the application. Also may need to check the .wine/dosdevices directory and verify that spurious drives are not linked there.
wine faq - https://gitlab.winehq.org/wine/wine/-/wikis/FAQ
winecfg - was showing ejected drives also. must use wine eject, I guess.
https://gitlab.winehq.org/wine/wine/-/wikis/FAQ#removable-media
also this error
https://forum.winehq.org/viewtopic.php?t=37602
But still,
I/O error D:
Request not supported.
Interpretation: Inquiry
Since this says changed to nt4 and it worked,
https://forum.winehq.org/viewtopic.php?t=8448
tried with winecfg. But only options are Win XP and above. NT4 is not an option.
Did not work with XP or Win7 or Win10.
Tuesday, September 17, 2024
H5P error on Moodle 4.1
An error was reported in an H5P module in one of our Moodle instances. Copy-pasting from my response -
The error says, undefined function str_contains()
From this page:
https://stackoverflow.com/questions/66519169/call-to-undefined-function-str-contains-php
"str_contains() was introduced in PHP 8 and is not supported in lower versions."
Currently we're running Moodle 4.1 LTS (Long Term Support) which runs on PHP 7.4. We have an upgrade plan to upgrade to Moodle 4.5 LTS in October or so, when we would also upgrade the PHP version as well as the MySQL database version, along with the server Linux kernel version. We're waiting for October so that the LTS version of Moodle as well as the Linux kernel will be out - https://moodledev.io/general/releases .
I've explained the rationale for the upgrade here,
https://hnsws.blogspot.com/2024/04/moodle-upgrade-path-41-to-45.html
After the upgrade, this issue should be sorted.