Tuesday, May 27, 2025

a lot of github workflows

Learnt a lot about many different workflows, how to get various things done, which can be used in future for incorporating into various projects.


automated deb creation with auto dependency detection

Apparently, CMake can do some automation for us - with CMake,
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)

for more info

Example of multi-package build on github actions - 

build opencv with cuda support

Package 'libtbb2' has no installation candidate
Trying
libtbbmalloc2


https://gist.github.com/kanaryayi/115731930a9767d8607374552993bad3 - Install OpenCV 4.9 with CUDA support - this gist has some build flags which are useful, and also dependencies.

CUDA backend requires CUDA Toolkit - we need to download it from the NVIDIA website.
https://developer.nvidia.com/cuda-toolkit

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cudnn cuda-toolkit

get url from
(deb network install)

More options are at

CMake Warning at /home/sssvv/opencv_contrib/modules/cudacodec/CMakeLists.txt:26 (message):
  cudacodec::VideoReader requires Nvidia Video Codec SDK.  Please resolve
  dependency or disable WITH_NVCUVID=OFF


CMake Warning at /home/sssvv/opencv_contrib/modules/cudacodec/CMakeLists.txt:30 (message):
  cudacodec::VideoWriter requires Nvidia Video Codec SDK.  Please resolve
  dependency or disable WITH_NVCUVENC=OFF

But this page says,
"FFMPEG is a cross-platforms solution to record, convert, and stream audio and video. FFMPEG supports video hardware acceleration on NVIDIA GPUs."

So do we really need cuda support? (for using NVidia nvenc codec with opencv)
I've put in a question at the OpenCV forum, no answers so far.

Maybe I can try downloading the Nvidia Video Codec SDK, compile OpenCV with that, and then try again.

Learnt how to build with Windows / Linux, building the latest OpenCV and ffmpeg from source, 
Windows workflow - setting PKG_CONFIG_PATH is important here.
Linux workflow - uses actions/cache to cache OpenCV once it is built.

ffmpeg linking on Windows


choco install ffmpeg has the issue that the pc files are not present - mention of pc files here,

Solution was to download from https://github.com/BtbN/FFmpeg-Builds/



Make CMake display a message on the console

Equivalent of echo "our hello world" would be message("our hello world")https://cmake.org/cmake/help/book/mastering-cmake/chapter/Writing%20CMakeLists%20Files.html

android apps without android studio

Directly building android apps on github actions - for learning, there is gradle init as mentioned at https://medium.com/@sdiony/can-you-really-develop-android-apps-without-android-studio-cdd9b951de65
but copy-pasting from existing projects, samples, is much easier - 
https://github.com/hn-88/OpenCV-android-samples
https://github.com/hn-88/android-ndk-samples/








Saturday, May 17, 2025

Indian income tax filing - a good overview guide

 Valueresearch has a good guide on what to keep ready, at https://www.valueresearchonline.com/stories/224462/income-tax-return-filing-preparation/

  1. Form16
  2. Form 26AS
  3. Capital gains statements
  4. Interest certificates
  5. Investment / donation proofs (for old tax regime)
  6. Loan interest certificates - home loan, EV loan interest may have deductions
  7. Bank account details
  8. Wait till AIS / TIS / 26AS is ready to avoid re-filing
While I knew about the other points, I was not very clear about significance of 26AS, and how to access TIS etc. AIS = Annual Information Statement, TIS = Taxpayer Information Summary according to this FAQ page which has lots of information - https://www.incometax.gov.in/iec/foportal/ais-faq 

Edit: 17th May 2025 - the TIS / AIS for me has info from LIC, SBI and HDFC as well as the mutual fund companies, but not from Canara Bank (savings bank interest.) I guess Canbank's reporting system to the government is not fully functional.

I can check / reconcile the following from TIS - 
  1. Interest - Savings Bank
  2. Interest - Deposits
  3. LIC receipts
  4. MF sale
  5. MF purchase

Friday, May 16, 2025

diskpart instead of fdisk on windows 11

As the title suggests, used diskpart to delete an EFI partition, since fdisk is no longer bundled with Windows 11. An earlier post has the syntax - https://hnsws.blogspot.com/2023/09/delete-efi-partition-with-windows.html

Then also created a partition and formatted it within diskpart, https://adminhowto.com/how-to-reformat-a-usb-drive-using-windows-diskpart/

create partition primary
format fs=fat32 quick

Thursday, May 15, 2025

refreshed github token

 Refreshed a github personal access fine-grained token by logging on to the relevant account and going to https://github.com/settings/personal-access-tokens/

For uploading files to a repository, the permissions needed are:

User permissions: None

Per-repository permissions: (for the relevant repo) 

Read access to metadata
Read and write access to actions, code, and workflows.

The post about google apps script code to auto-upload to github-pages is at https://hnsws.blogspot.com/2024/03/workaround-for-cors-errors-on-api-calls.html 

Friday, May 09, 2025

Sunday, May 04, 2025

script to run multiple commands on a remote server over ssh

 Made Chatgpt write the following script. The EOF syntax is useful. In our case, we need to put in the appropriate -pPORT also.

write a bash shell script to ssh into two servers server1 and server2 with ssh keys key1.pem and key2.pem, run sudo apt upgrade on both, and show the result on the terminal.

#!/bin/bash


# Define servers and keys

SERVER1="user1@server1"

KEY1="key1.pem"


SERVER2="user2@server2"

KEY2="key2.pem"


# Function to upgrade a server

upgrade_server() {

  local SERVER=$1

  local KEY=$2


  echo "Upgrading packages on $SERVER..."

  

  ssh -i "$KEY" -o StrictHostKeyChecking=no "$SERVER" << 'EOF'

    echo "Running apt update..."

    sudo apt update

    echo "Running apt upgrade..."

    sudo DEBIAN_FRONTEND=noninteractive apt upgrade -y

EOF

}


# Upgrade both servers

upgrade_server "$SERVER1" "$KEY1"

echo "---------------------------------------------"

upgrade_server "$SERVER2" "$KEY2"


Saturday, May 03, 2025

x86 Emulation on iPad with UTM

Continuing my earlier post about UTM - finally got JIT to work on iPad. Apparently I had been successful earlier also, but had thought that the QEMU error was due to JIT not being enabled. Going into settings (in the context menu of each VM, accessed by long-press) and trying to increase RAM, UTM gave the warning that the system had only 1700 MB of RAM left, of which 1300 or so was free, hence increasing the VM's RAM beyond this would cause crashes. Ubuntu 14.04 boots up in around 4 minutes. Unfortunately, maybe due to Ubuntu's behaviour when running on a display without acceleration, very slow to respond. Nearly a minute for keystrokes to appear on screen!

What I followed was this:

Installed AltStore via AltServer for Windows - https://faq.altstore.io/altstore-classic/how-to-install-altstore-windows

Installed StikJIT & StosVPN via AltStore - StikJIT user manual

Copied over the pairing file created as per the user manual above, using iCloud Drive (Installed that also on the Windows machine.)

Then, the procedure is - 
  • Swipe up from down and hold, to show all applications - swipe up applications which you want to close and start again with JIT, like UTM.
  • Start StosVPN, click to start the connection
  • Start StikJIT - one-time requirement of passing on the path to the pairing file, then
  • Click Enable JIT - a few moments later, it prompts for which app to enable JIT for, from a list of apps - choose UTM, and then UTM opens up with JIT enabled. Can start up JMs at this point. 
But as mentioned in the first paragraph of this post, we need to choose those VM images (or create such VMs) which can work with 512 MB or 768 MB of RAM on this 9th gen iPad, since it has limited free RAM. Perhaps trying Raspberry Pi might be a good option.

Thursday, May 01, 2025

monitoring websites for changes - followthatpage

 There was a request from one of my colleagues for suggestions - he wanted a tool to automatically let him know when some particular websites had changes. Something similar to an RSS feed for a website which doesn't have an RSS feed, I guess. 

I replied that I use

https://www.followthatpage.com/

to monitor up to 20 pages for free per account per day - so if you don't want daily checks, you can add more pages, too.

There are many other "freemium" and paid options, too.