Monday, March 31, 2025

set up app password for sending emails from server

One of our wordpress servers was to be used to send some emails to users. So, changed the ssmtp "from" account from our internal server's google account to another one, meant to be used for this 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.

Thursday, March 27, 2025

compiling a wxwidgets project with cmake on Windows

Run into issues building the simple hello world example from wxwidgets using cmake on Windows. On Linux, the default github cmake action did not need much modification. 
Linux cmake build workflow

But for building on Windows, we needed to add some env variables in the workflow

env:
  # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  BUILD_TYPE: Release
  WXWIN: C:/wxWidgets-3.2.6
  wxWidgets_ROOT_DIR: C:/wxWidgets-3.2.6
  wxWidgets_LIBRARIES: C:/wxWidgets-3.2.6/include
  wxWidgets_INCLUDE_DIRS: C:/wxWidgets-3.2.6/lib/vc14x_x64_dll
  ARCH: x64

or else the find_package would complain about not finding wxWidgets_LIBRARIES and wxWidgets_INCLUDE_DIRS

Also, 

cmake -G"Visual Studio 17 2022" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

to specify which version of Visual Studio to use - and for this version, the default toolset is 14.3 which is the one used to build this set of wxwidgets binaries.
https://docs.wxwidgets.org/3.2.1/plat_msw_binaries.html

But we also had to add a dummy main() to get rid of a linker error, but that breaks the Linux build. 

/home/runner/work/wxOCVWarp/wxOCVWarp/hello.cpp:78:5: error: conflicting declaration of C function ‘int main()’
   78 | int main() { return 0;}
      |     ^~~~
In file included from /usr/include/wx-3.0/wx/wx.h:25,
                 from /home/runner/work/wxOCVWarp/wxOCVWarp/hello.cpp:3:
/home/runner/work/wxOCVWarp/wxOCVWarp/hello.cpp:11:1: note: previous declaration ‘int main(int, char**)’
   11 | wxIMPLEMENT_APP(MyApp);
      | ^~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/OCVWarp.dir/build.make:79: CMakeFiles/OCVWarp.dir/hello.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/OCVWarp.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

So, wrapped an ifdef around the dummy main(), and all is well.

#ifdef _WIN64
int main() { return 0;}
#endif

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.

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

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. 

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 like t to toggle all trails won't work - the keystrokes will be captured by the console.

  • The Sun size was increased to 36x and Sun glare was 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. 


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

Copy-pasting from an email thread, responding to a query on how we can move forward with expansion plans - context was that a large number of users (presumably editing on Moodle) brought down the db server:

Various options:

1. Use CMS for content creation, and LMS for content distribution. Use only one or two concurrent users for loading content onto LMS. For training purposes, https://moodle.org/demo can be used instead of our server.

2. If the above does not work for you, consider shifting to Google Classroom - we can probably get an edu account, which would allow 500 concurrent users per class. Even in the free version, 250 concurrent teachers and students can log in. If you're predominantly going to use H5P, there are some workarounds for using H5P on google classroom, like https://h5p.org/node/137178 

Another option is Google Sites, which also allows easy creation of content pages like Wordpress, but free for us, and we don't need to add any servers - https://support.google.com/a/answer/6399191

3. If that also does not work for you, then consider repurposing some of your old developer workstations into servers, and use them instead for training + multi-user content creation purposes; at other times, when only content distribution is taking place, we can switch to the existing Azure servers within 5 minutes or so.

4. If none of the above, and you continue to want to work with Moodle, consider Moodle hosting service providers in India at ~$30 a month (compared to ~$60 a month we would spend on overages if we upgrade our Azure servers beyond the free credits) - https://cloudpap.com/blog/moodle-hosting-in-india/

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.