and we need a different set of parameters in the command line if ollama is already installed on our system. So, got the openwebui to work with two modifications:
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!
Tuesday, April 01, 2025
experiments with LLMs and docker
and we need a different set of parameters in the command line if ollama is already installed on our system. So, got the openwebui to work with two modifications:
creating ai agents - just links
free plan is 1000 executions, 14 days.
via
Create Your FIRST AI Agent Today - youtube video
(uses paid n8n, paid chatgpt etc)
serpapi 100 searches per month in free plan - https://serpapi.com/pricing
n8n.io - can run locally also.
https://n8n.io/itops/ - using n8n - nodemation - to automate user creation etc. https://www.youtube.com/watch?v=ovlxledZfM4
Monday, March 31, 2025
set up app password for sending emails from server
- Created a new google workspace account
- Logged in to it for the first time
- Set up recovery email, recovery phone, authenticator, enabled two-factor authentication
- Created an app password
- edited the /etc/ssmtp/ssmtp.conf with the new userid and app password.
Sunday, March 30, 2025
rclone - GUI and remote server-side copy possibilities
Tried out the GUI at https://rcloneview.com/src/download.html using the Linux AppImage. The remote already configured for my user account was detected, but the directory listing didn't seem to work. Neither did the "Mount".
Then, server-side copy possibilities - when doing remote to remote copies, the local network is used - so that's not really useful. And on the same remote, a server-side copy is done using hard links - https://forum.rclone.org/t/sftp-remote-server-side-copy/41867 - so that's a bit iffy. Server side copy might be useful for copying between two different cloud providers. The fastest option for our SFTP remotes would be to ssh into one of the machines, install rclone there, create an sftp remote for the other machine, and do the copy from the ssh shell - that would be much faster than bringing all the data to our local network and sending it back.
Saturday, March 29, 2025
gravity pdf plugin on wordpress needs php-gd
While installing a plugin Gravity PDF on one of our wordpress sites, the users got an error message, PHP Extension GD Image Library not found.
Installed php-gd with
sudo apt install php-gd
Thursday, March 27, 2025
compiling a wxwidgets project with cmake on Windows
https://docs.wxwidgets.org/3.2.1/plat_msw_binaries.html
Tuesday, March 25, 2025
rclone over ssh / sftp
Tried installing the latest rclone - version v1.69.1 using the deb file and testing an ssh / sftp remote. Finally got it to work. Used the key_file option and passed on the path to our AWS-generated PEM file as the key_file - all other options were left as default with <ENTER>
A point to note is that if we do
rclone ls nameofourremote:/
it will list all the files on the remote recursively! Instead, we can do
rclone lsd nameofourremote:/some/path
to list only the directories inside the specified path.
Edit: We can mount the drive remotely with sshfs also - on Windows,
https://green.cloud/docs/how-to-mount-remote-file-systems-using-sshfs-on-windows/
On Linux,
Apparently sshfs is deprecated, and rclone may be faster also -
setting up a server with a dotnet api
A subset of the previous post. Steps carried out -
- created a fresh user using adduser
- MySQL database was already running.
- created the subdomains for website and API
- created the appropriate virtual servers for the above.
- copied the uat files to prod
- created a service running on a port like 5000 or 5010 etc for the dot net api at /etc/systemd/system/ourapi.service
systemctl start ourapi
systemctl enable ourapi
(Once the team changes the files referred to by the api service , I will need to restart the service.)
- tested api and website url
Sunday, March 23, 2025
Large Language Models with our own documents - RAG for LLM
RAG = Retrieval Augmented Generation - can be done locally as well as on cloud - explanatory video -
Feed Your OWN Documents to a Local Large Language Model!
In the video, openwebui is used to run the local LLM -
https://docs.openwebui.com/features/
If using docker (for ease of setup), and we want to copy our documents to the LLM's docker container, Docker copy command -
Copying Files to and from Docker Containers - GeeksforGeeks
docker container cp source_local container:/path
sudo docker cp ~/Desktop/to-be-copied.txt 135950565ad8:/to-be-copied.txt
(the container id like 135950565ad8 above, is usually seen as a root@containerid prompt in the running container)
And apparently in the latest versions of openwebui, there is integration inside the UI itself for uploading documents - https://docs.openwebui.com/features/rag#local-and-remote-rag-integration
"Local documents must first be uploaded via the Documents section of the Workspace area to access them using the # symbol before a query. Click on the formatted URL in the that appears above the chat box. Once selected, a document icon appears above Send a message, indicating successful retrieval."
See this post for some initial setup, experiments and benchmarks - https://hnsws.blogspot.com/2025/04/experiments-with-llms-and-docker.html
Saturday, March 22, 2025
dramatically different Azure pricing based on region
Wednesday, March 19, 2025
message from Microsoft Azure - Convert to Azure role-based access control (RBAC)
The email sent to us, saying "To avoid service disruptions, convert classic admin roles that still need access to your subscription to Azure RBAC roles immediately." quoted a subscription id, and checking that subscription, found that only one admin had classic admin roles, who was already added as "Owner" in RBAC roles. So, no action taken.
Tuesday, March 18, 2025
some problems running Reaper on Linux
Trying to run Reaper on Linux, first there was an error message that libasound library could not be found,
sudo apt-get install liboss4-salsa-asound2
sudo apt install pulseaudio
But the real problem was, if you install the i686 instead of the x86-64 on an AMD64 64-bit system, you will also get this error message.
https://forum.cockos.com/showthread.php?t=255012
(that was the issue. )
Then, once Reaper opened, error opening audio device.
JACK is default, maybe I should install it?
Other options are pulse audio and alsa.
pulse audio is installed, but when I choose that option, Reaper hangs.
A reboot (after pulse audio was installed) solved the issue.
Saturday, March 15, 2025
upscaling a video (from HD to 4k, for example) using ESRGAN on Google Colab
Tried out the first result in a web search for upscaling using google colab -
https://colab.research.google.com/github/yuvraj108c/4k-video-upscaler-colab/blob/main/4k_Video_Upscaler_Colab_(Real_ESRGAN).ipynb
Copied to my google drive to make the changes persistent - the only changes needed were the paths to the input and output files.
Without modifications, the upscaled video went to the google drive recycle bin instead - it looks like there is a missing 'mv' in the command = f"'{final_video_path}' '{save_directory_drive}'/'{final_video_name}'"
Anyway, input video with compression artifacts gets upscaled to output video with compression artifacts. If there's some clean video, will take a look. The upscaling inference goes at approx 2 seconds per frame on the T4 google colab GPU.
Thursday, March 13, 2025
planets "flyby" renders with OpenSpace
The full versions of these clips - more frames as well as 4096x4096 resolution - are available at https://archive.org/details/sun-2-rotate
Copy-pasting the notes posted on Github, for creating these "flybys" -
for openspace to focus on a planet without making the camera rotate around it - In the settings > Navigation Handler there is a "Follow Anchor Node Rotation" and a "Follow Anchor Node Rotation Distance", smaller distance = the closer you can be to the object before following its rotation - https://openspacesupport.slack.com/archives/C055D75TJ9K/p1718704511126989?thread_ts=1718701308.415139&cid=C055D75TJ9K
For changing the length of the planet trails (orbit paths) - https://docs.openspaceproject.com/releases-v0.20/using-openspace/scripting/console/index.html for getting the trails length property, checking logs/ScriptLog.txt openspace.setPropertyValue("{planetTrail_solarSystem}.Renderable.Enabled", false) works. It is case sensitive. In Trail Appearance, currently the default is LineLength=1 Line Fade Amount is a small amount - something like 0.25. Increasing Line Fade Amount to 0.4 increases the length of the trail shown.
openspace.setPropertyValue("{planetTrail_solarSystem}.Renderable.Appearance.LineFadeAmount", 0.4)in the console scripting window by hitting`(backtick) key We need to again close the console window by hitting ` again, otherwise keyboard shortcuts liketto toggle all trails won't work - the keystrokes will be captured by the console.The Sun size was increased to 36x and
Sun glarewas turned off for the Mercury + Sun clip.
escaping backticks in markdown
While writing markdown in github, wanted to know how to escape the backtick ` character.
https://stackoverflow.com/questions/24313204/how-does-one-escape-backticks-in-markdown
Apparently, we can do ``` ` ``` which will render as ` (note the space between the three initial backticks and the single one. We can also do \` when the backtick is not supposed to be inside a code block.
Sunday, March 09, 2025
Interesting - FastAPI for building APIs with Python
via https://github.com/shinokada/fastapi-web-starter
via https://github.com/shinokada/spt
via Simple Pacakge Tool (SPT) when looking for building DEB packages.
Wednesday, March 05, 2025
google classroom overview video tutorial
Shows both teacher view and student view - How to Use Google Classroom - Tutorial for Beginners from @TeachersTech
https://www.youtube.com/watch?v=pl-tBjAM9g4
Moodle server expansion
Sunday, March 02, 2025
Customized Moodle app bug and solution
Copy-pasting from a request for help in the Moodle forum - "we're facing a strange issue, and any help is welcome. The questions in the feedback module are visible when viewed on a web browser, but the questions are not visible when using a customized Moodle app. Even if we just build the Moodle app for Android without any customizations, the resulting app doesn't show the questions. "
I see now that this is a bug reported in the Bug Tracker for the app, https://tracker.moodle.org/browse/MOBILE-4698
The code in the "beta" branch has the fix, and the bug is fixed there, as I check today.
Friday, February 28, 2025
online panorama stitcher
Via OpenCV directly in the browser (webassembly + webworker) - DEV Community
latsic/imgalign: Webapplication for image stitching and aligning
Needle - took some 30 seconds to a minute to load OpenCV on my machine, the actual stitching took less than two seconds with the sample 3 images.
using hand-held video clips on the planetarium dome
padding with equal amounts of black on all four sides, with
-136 degrees y angle in OCVWarp.
Tuesday, February 25, 2025
appimage build on github actions - potential issue
fake astronomy posts on social media
Thursday, February 20, 2025
adding two wordpress sites to an existing server
- mysql> create database wordpresswebsitestaging;
CREATE USER "stagingwpuser"@"localhost" IDENTIFIED BY "ThePasswordH3r3";
GRANT ALL PRIVILEGES ON wordpresswebsitestaging.* TO "stagingwpuser"@"localhost";
FLUSH PRIVILEGES;
https://developer.wordpress.org/advanced-administration/before-install/creating-database/ - Creating the web root directories and a user who can sftp in to upload files etc if needed
sudo adduser thewpwebsiteadmin
sudo su thewpwebsiteadmin
cd /home/thewpwebsiteadmin
mkdir directory1
mkdir directory2
We need to give read permissions to the entire path for the webserver to be able to read these directories, so
sudo chmod -R +rx /home/thewpwebsiteadmin - Created DNS entries in cloudflare. In this case, CNAME records.
- Copied existing files in /etc/apache2/sites-available as templates for the new sites. Since we were using cloudflare origin certificates, there was no need to create new certificates with certbot etc. After editing the conf files as needed, with the /home/thewpwebsiteadmin/directory1 and directory2 as home directories, enabled the sites with
sudo a2ensite newsite1 newsite1ssl newsite2 newsite2ssl
sudo systemctl reload apache2 - Path to latest wordpress from https://developer.wordpress.org/advanced-administration/before-install/howto-install/ -
wget https://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
cp -R wordpress/* directory1 etc - Visit the new sites with a browser to supply the database configuration etc, the wp-config file gets generated, create a new file and paste the generated file to the wordpress root directories as
nano wp-config.php - Create ssh key and add to authorized_keys -
ssh-keygen -t rsa -m PEM -f theadminuserkey.pem
mkdir .ssh
mv theadminuserkey.pem.pub .ssh/authorized_keys
and set appropriate permissions for the .ssh directory and file -
chmod 700 .ssh
cd .ssh
chmod 600 authorized_keys
Monday, February 17, 2025
cloudflared or ssh tunnel for reverse-proxying on-premise servers
https://developers.cloudflare.com/rules/origin-rules/features/#destination-port
via
https://old.reddit.com/r/CloudFlare/comments/12km27p/using_non_http_https_ports/
dynamic dns with
https://developers.cloudflare.com/dns/manage-dns-records/how-to/managing-dynamic-ip-addresses/#ddclient
https://dnsomatic.com/docs/software
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/
Saturday, February 15, 2025
app api call slowdown, QUIC is suspected
net::ERR_QUIC_PROTOCOL_ERROR
Monday, February 10, 2025
Miscellaneous Blender VSE settings used for the recent project
Shift + K to 'hold-split' at the cursor.
Sunday, February 09, 2025
listing ffmpeg commandline options
-preset lossless
to my commandline, and it worked. I think it was something like
ffmpeg -r 30 -start_number -003875 -f image2 -preset lossless -i "OpenSpace%06d.png" -c:v hevc_nvenc ../filename.mp4
Got the message
The selected preset is deprecated. Use p1 to p7
(but it is doing the encoding.)
There is also -tune lossless option. But I didn't try that.
Thursday, February 06, 2025
simple static multi-lingual titles instead of tracked titles
Instead of going the tracked title route, I settled on a simpler static title overlay using Blender VSE, because
- It's far less time-consuming
- Hindi text does not render well as a Blender text object
So,the workflow was:
- Create the title text in a document editor like Google Docs
- Take a screenshot of the black text on white background
- Invert to white text in black background on Gimp
- Overlay over "warped" video directly with opacity fading in from 0 to 0.5 over a second - OR -
- If overlaying over a fulldome clip, first "warp" the flat text to match the fulldome clip's curvature using the method in this old post.
In particular, after trial and error, the particulars seem to be:
- 36 point font size text to take screenshot
- stretch the text to make it square (halve the width)
- put the stretched screenshot at the bottom of a 4096x4096 transparent image
- make the screenshot even smaller if required, or use a larger transparent image
- merge down the layer if the filter doesn't act on the entire image
- use Gimp's Filter > Distorts > Polar co-ordinates with "Map backwards" checked (otherwise the text would be inverted left to right) and save as png preserving transparency (alpha channel).
Payzapp mini review
I tried using HDFC Bank's Payzapp app for payments - it has features like loading up the Payzapp wallet with credit card, then transfer by UPI to bank accounts, etc. But,
- they doubled the fee for Payzapp wallet loading from credit card
- many merchants, including the most important one which I needed to pay > 10k per month, blocked access to Payzapp payments due to fees they're charging merchants
- a billdesk payment of APSPDCL went through, but did not reflect in the "paid" bills. Billdesk said merchant had rejected payment, I need to pay again. Payzapp says refund has been issued, but there is no way to check except by seeing the balance - which I have now emptied, because the back-and-forth between Payzapp and Billdesk had taken more than a month.
Overall, a very poor experience. So I will use Payzapp only for the convenience of paying HDFC Bank credit cards with it, will block all notifications from it, and not keep any wallet balance. Even when making HDFC bank credit card payment, the app failed to load this morning, and loaded again later in the day. Also, the Payzapp app shows "apply coupons" when making a Rs. 4000 payment, but the coupon says min. transaction Rs. 5000, and the "apply coupon" button is not shown when I was actually making the Rs. 10,000 transaction! Bad HDFC! We can contrast this with Amazon.in's method of showing exactly how much "cashback" or "savings" will accrue for each payment method.
Tuesday, February 04, 2025
monitoring expiring certificates with Red Sift
LetsEncrypt sent out an email that they would no longer be sending certificate expiry warning emails, and recommended we sign up to Red Sift's free plan.
We can recommend Red Sift Certificates Lite, which provides free expiration emails for up to 250 active certificates: https://redsift.com/pulse-platform/certificates-lite
After signing up, there was a certificate warning, but it turned out to be a false alarm - a certificate which had been re-issued onto a new machine.
Monday, February 03, 2025
manual setup of awstats with static report pages
To improve responsiveness, tried to make awstats generate static pages instead of dynamic report generation with the cgi-bin perl script.
Most probably the unresponsive nature was due to the DNS settings in the /etc/awstats/*.conf files for the domains we were reporting on. As the conf file says,
# If you want/need to set DNSLookup to 1, don't forget that this will
# dramatically reduce AWStats's update process speed. Do not use on large web
# sites.
Then, there was also the dynamic DNS lookup option, which also needed to be set to 0 -
# For very large sites, setting DNSLookup to 0 (or 2) might be the only
# reasonable choice. DynamicDNSLookup allows to resolve host names for
# items shown in html tables only, when data is output on reports instead
# of resolving once during log analysis step.
# Possible values:
# 0 - No dynamic DNS lookup
Then two more settings were changed, changed to 0
# Possible values:
# 0 - Report is not shown at all
# 1 - Report is shown in main page with an entry in menu and default columns
# XYZ - Report shows column informations defined by code X,Y,Z...
# X,Y,Z... are code letters among the following:
# U = Unique visitors
# V = Visits
# P = Number of pages
# H = Number of hits (or mails)
# B = Bandwidth (or total mail size for mail logs)
# L = Last access date
# E = Entry pages
# X = Exit pages
# C = Web compression (mod_gzip,mod_deflate)
# M = Average mail size (mail logs)
# Show domains/country chart
# Context: Web, Streaming, Mail, Ftp
# Default: PHB, Possible column codes: UVPHB
ShowDomainsStats=0
# Show hosts chart
# Context: Web, Streaming, Mail, Ftp
# Default: PHBL, Possible column codes: PHBL
ShowHostsStats=0
Then, with much trial and error, the following lines were added to the root crontab for creating the static pages, and an index file was created to easily go to the relevant server/month page.
sudo su -
crontab -e
58 23 * * * /usr/share/awstats/tools/awstats_buildstaticpages.pl -update -dir=/var/www/pathtostatsfromawstats/ -config=server1.org -builddate=$(date '+\%Y\%m') > /dev/null 2>&1
56 23 * * * /usr/share/awstats/tools/awstats_buildstaticpages.pl -update -dir=/var/www/pathtostatsfromawstats/ -config=server2.org -builddate=$(date '+\%Y\%m') > /dev/null 2>&1
and so on.
There were lots of emails to root being generated every 10 minutes from cron, saying awstats.pl could not read the log files in /var/log/apache2/ourlogfile.log - it turned out that these were being generated by another cron which would probably have been created by the awstats installation via apt, which was located in /etc/cron.d directory, the file was /etc/cron.d/awstats which was being run as an unprivileged user, hence unable to read log files etc. So I just commented out those awstat update lines in that file. To note:
Initial setup -
And if we need to password protect it,
Running the perl script without any arguments gave the listing of possible arguments -
perl /usr/share/awstats/tools/awstats_buildstaticpages.pl
Usage:
awstats_buildstaticpages.pl (awstats_options) [awstatsbuildstaticpages_options]
where awstats_options are any option known by AWStats
-config=configvalue is value for -config parameter (REQUIRED)
-update option used to update statistics before to generate pages
-lang=LL to output a HTML report in language LL (en,de,es,fr,...)
-month=MM to output a HTML report for an old month=MM
-year=YYYY to output a HTML report for an old year=YYYY
and awstatsbuildstaticpages_options can be
-awstatsprog=pathtoawstatspl AWStats software (awstats.pl) path
-dir=outputdir Output directory for generated pages
-diricons=icondir Relative path to use as icon dir in <img> links
-builddate=%YY%MM%DD Used to add build date in built pages filenames
-staticlinksext=xxx Build pages with .xxx extension (default .html)
-buildpdf[=pathtohtmldoc] Build a PDF file after building HTML pages.
Output directory must contains icon directory
when this option is used (need 'htmldoc')
At first, I thought I would need to manually create directories and chown them to www-data
# mkdir 202502
# chown www-data:www-data 202502
but then I could use the builddate parameter instead. Note that in the builddate parameter, when the $(date) is called in a cron script, the % characters have to be escaped.
Reports for older year/month combinations could be created like
perl /usr/share/awstats/tools/awstats_buildstaticpages.pl -dir=/var/www/pathtostatsfromawstats/ -config=ourserver.org -year=2024 -month=12 -builddate=202412
And finally, asked Github Copilot to generate a form with dummy servernames and paths, which I manually edited to get the correct paths, as below -
<script>function redirectToUrl() {
var server = document.getElementById("server").value;
var year = document.getElementById("year").value;
var month = document.getElementById("month").value;
var url = "https://ourstatsurlforstatsfromawstats/awstats." + server + year + month + ".html";
window.location.href = url;
}
</script>
</HEAD>
<body>
<form onsubmit="event.preventDefault(); redirectToUrl();">
<label for="server">Select Server:</label>
<select id="server" name="server">
<option value="1.org.">CMS</option>
<option value="2.org.">devel2</option>
</select>
<br /><br />
<label for="year">Select Year:</label>
<select id="year" name="year">
<option value="2024">2024</option>
<option value="2025">2025</option>
<option value="2026">2026</option>
</select>
<br /><br />
<label for="month">Select Month:</label>
<select id="month" name="month">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
<br /><br />
<input type="submit" value="Submit" />
</form>
</body>
Friday, January 31, 2025
resizing a window in xfce
Some windows like the file manager Thunar allow resizing by dragging any corner, but not the Microsoft Edge browser window. Solution - press ALT, right-click inside the window and drag in any direction.
Thursday, January 30, 2025
show date-time instead of date in Thunar
On the Linux Mint XFCE desktop, Thunar is the default file manager, and by default, it just shows "Today" or the created date of the file. Not useful to find the latest in several versions created in a few minutes time, or to see how long it took to generate file sequences etc. But happily, it can easily be fixed, instead of having to open a terminal and do ls -l
https://forums.linuxmint.com/viewtopic.php?t=241840
Menu > Edit > Preferences - very first tab (Display), Date Format - drop down list right along the bottom is a format like yyyy-mm-dd hh:mm:ss
Wednesday, January 29, 2025
boot logs and more with journalctl
tail /var/log/dmesg
Tuesday, January 28, 2025
adjusting pitch and narration speed in Reaper
Monday, January 27, 2025
downloading youtube videos in 4k
Youtube has recently changed some of its video delivery code, so that online tools like ssyoutube.com etc don't provide videos higher than 360p. Even tools promising free 4k downloads like 4kdownload.com could only provide a 1080p version. Checking if open-source tools can do better - searched for yt dl on github, found https://github.com/ytdl-patched/ytdl-patched
Usage - just needed to give
Sunday, January 26, 2025
Fulldome video - simulated view of moving through a gas cloud or Nebula
Trying to create a different version of this video by ESO - https://www.youtube.com/watch?v=lj3t_gjuXWk - led me to various searches, where apparently IFSRenderer was supposed to be easier to create Nebula videos than Blender. There's the disadvantage that it runs only on Windows, and also doesn't seem to be accelerated much using an NVidia graphics card? So, these renders are only 1024x1024 - also, since these are supposed to be clouds, we can probably scale them to 4k - and probably just get a softer look for the nebula. These renders went at around 4 to 5 frames per minute on the computer with the NVidia 1060 card.
Fulldome video suitable for playback in Planetariums -
And one more (which was actually done earlier, on a laptop with integrated Intel graphics) -
The saved settings for these are uploaded to github,
https://github.com/hn-88/IFSRenderer-saves
Zoom out to the edge of the observable universe in a single shot without cuts
Similar to the previous post, but in a "single take" zoom motion all the way from Earth to the edge of the observable Universe. A fulldome video made with OpenSpace - details as in my previous post.
A "reference" video with text overlay is also created, so that we can note the distances from Earth as the "camera" moves outwards -
Earth to the Moon - fulldome video
Zooming out from a view of the Earth to a close view of the Moon, with a shot similar to the iconic "Earthrise" photo, and moving beyond the Moon - fulldome video suitable for planetariums created with OpenSpace.
The "recording" file used to create this image is shared at https://github.com/hn-88/openspace-scripts/tree/main/user/recordings/Moon-Earthrise-beyond
As noted in the readme there, this was created with v2.1 of OSREC-interp and not with v3.0, v3.0 had bugs - jerky motion.
The full resolution 4096x4096 video is shared on archive.org - https://archive.org/details/earthto-moon-earthrise-beyond-hevc-nvenc
More of our fulldome videos on archive.org are at https://archive.org/search?query=creator%3A%22www.saispace.in%22
Saturday, January 25, 2025
delete files found with "find"
Trying to create an AppImage for OpenSpace led to many learnings. Among them - how to delete the files found with the "find" command -
find . -name '*.cpp' -print0 | xargs -0 -P2 rmExplanation -
"If you're on Linux or have the GNU find and xargs commands, then use -print0 with find and -0 with xargs to handle file names containing spaces and other odd-ball characters." - https://stackoverflow.com/questions/864316/how-to-pipe-list-of-files-returned-by-find-command-to-cat-to-view-all-the-files
"xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or new‐lines, and executes the command (default is echo) one or more times with any initial-arguments followed by items read from standard input. Blank lines on the standard input are ignored." ... "Because Unix filenames can contain blanks and newlines, this de‐ fault behaviour is often problematic; filenames containing blanks and/or newlines are incorrectly processed by xargs. In these situations it is better to use the -0 option, which prevents such problems. When using this option you will need to ensure that the program which produces the input for xargs also uses a null character as a separator. If that program is GNU find for example, the -print0 option does this for you." - https://www.man7.org/linux/man-pages/man1/xargs.1.html
and the -P option is "-P max-procs, --max-procs=max-procs
Run up to max-procs processes at a time"
patch files using patch
Thursday, January 23, 2025
logging load average and memory usage on Linux servers
Wednesday, January 22, 2025
reinstating check status php code
During the kerfuffle caused by the server overload mentioned in a previous post, we had disabled javascript code used to periodically ping a php page to check whether the CMS user had logged out from another window. That would have caused some session timeouts which would not be reported to the user, resulting in issues like this:
Earlier today a few users contacted me saying that they are unable to login. I told them to clear cache and login and it worked.
Since this check status code was not the root cause of the issue - which was just too many users trying to log in and using up all the RAM, the javascript and the check status code has been reinstated now.
Windirstat to find large files in filesystem
Revisiting an old tool, still great at what it does - Windirstat - for easily visualizing large files and directories.
Tuesday, January 21, 2025
server overloaded
Lots and lots of server issues over the last 4 days, on some of our Moodle instances. Tried blocking bots on the ssh port, tried adding robots.txt to prevent excessive crawls, still, 30+ alerts from the server from last night ~8.30 pm onwards up to this morning. Finally, upsized the web server to 7 GB RAM (at double the cost) and the alerts stopped. So, it was human traffic that was probably to blame.
Checking logged in users on Moodle, for instance, via Site Administration > Reports > Live logs showed more than 20 users actively editing courses.
(Had tried blocking bots using
https://techexpert.tips/apache/apache-blocking-bad-bots-crawlers/
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} (gumgum-bot|postmanruntime|ag_dm_spider|scrapy|chimebot|SeekportBot|Amazonbot|SemrushBot) [NC]
RewriteRule .* - [F,L]
But since the root cause was human users, this did not have much effect.)
Monday, January 20, 2025
BSNL FTTH ONT port 9090 server - did not work
simple webserver for testing on Windows using Powershell
This needs to be run in a Powershell run as administrator on my machine. Via https://woshub.com/simple-http-webserver-powershell/
$httpListener = New-Object System.Net.HttpListener
$httpListener.Prefixes.Add("http://+:9090/")
$httpListener.Start()
write-host "Press any key to stop the HTTP listener after next request"
while (!([console]::KeyAvailable)) {
$context = $httpListener.GetContext()
$context.Response.StatusCode = 200
$context.Response.ContentType = 'text/HTML'
$WebContent = Get-Content -Path "D:\Downloads\new.html" -Encoding UTF8
$EncodingWebContent = [Text.Encoding]::UTF8.GetBytes($WebContent)
$context.Response.OutputStream.Write($EncodingWebContent , 0, $EncodingWebContent.Length)
$context.Response.Close()
Write-Output "" # Newline
}
$httpListener.Close()
run file-manager as root on Linux Mint
gksu etc doesn't work, what does work, from https://forums.linuxmint.com/viewtopic.php?t=424807
pkexec nemo
Friday, January 17, 2025
flash drive errors
Properties button of a disk (except the system disk or Windows disk) > Status section >
Online/Offline button
Repartition Bad Drive (from Abstradrome),https://www.dposoft.net/rbd.html
robots.txt syntax to exclude specific bots
So for allowing googlebot and bingbot and nothing else, the syntax would be:
User-agent: *
Disallow: /
User-agent: Bingbot
Disallow:
User-agent: Googlebot
Disallow:
Thursday, January 16, 2025
CMS - Unable to open assets
Sunday, January 12, 2025
preventing Moodle time-outs
Copy-pasting from an email I sent out:
... doing bulk actions on the Moodle instances can cause timeout failures if the action takes more than a minute or so to complete. So, actions should be done in small batches. For example,
1. Deleting users - first start with deleting one user, see how long it takes, and then scale to as many as possible to complete in one minute. A detailed post about automating this process is at
https://hnsws.blogspot.com/2024/10/moving-multiple-moodle-instances-from.html#deleting-users
2. Deleting courses - you may need to delete module by module, checking how long each process takes, as above.
3. Running ad-hoc queries - please filter for small result sets and optimize code so that the query completes within a minute or two.
Similarly, when designing the course pages, please use themes / modules / etc in such a way that only a limited number of images and or other content loads on a single page - otherwise, the site will be experienced as slow to load, slow to edit, etc. A rule of thumb would be to limit the scrolling to two screen heights, and not more than that.
In general, if you experience timeout errors (which usually will be displayed as "gateway error" if using cloudflare), you can simply close and re-open your browser after a couple of minutes, login again, and the site should load.
manually editing kodi playlists
Work Stuff: optimizing kodi for planetarium projection
Saturday, January 11, 2025
Zoom out to the edge of the observable universe
openspace-scripts/user/recordings/ToEdgeofU
Zoom out to the edge of the observable Universe
format_onetopic plugin backwards compatibility
Copy-pasting from an email, regarding the onetopic plugin's version for Moodle 4.5 and compatibility with older (3.x?) versions -
I'm updating the format_onetopic plugin on all our Moodle instances. When doing that, it notified me of a new setting, backward compatibility with old styles, which it says will be removed soon.
Currently I have enabled it, but if possible, please check the courses which use format_onetopic to see if they can be migrated to use the format_onetopic new style editor. The setting for format_onetopic is at
/admin/settings.php?section=formatsettingonetopic
- the 2nd option,
"Use legacy style controls. This option is only available for compatibility with older versions of the plugin and will be removed in the future in favor of using only the new style editor."
Most probably, the way to do this would be:
1. check if the course is displayed correctly
2. go to admin/settings.php?section=formatsettingonetopic and uncheck the "Use legacy style controls"
3. check again if the course is displayed correctly
4. make some edit to the course, check again if the course is displayed correctly
5. If displayed OK, then you can revert the edit, and leave the check box unchecked.
6. If not displayed OK, please let me know.
If you find that unchecking this box does not create any problems for some course which uses format_onetopic, please uncheck the box for all the instances.
Site Administration > Plugins > Plugins Overview > Onetopic_format Settings






