Saturday, September 30, 2023

simple efficient code to push multiple rows of data into a google sheet

As mentioned in
https://spreadsheet.dev/write-multiple-rows-to-google-sheets-using-apps-script
it is much more efficient to use Google Apps Script Spreadsheetapp function
Range -> setValues()
rather than
Sheet -> appendRow()

Concise code snippet, similar to what is used in a function in one of my private repos "Search results to sheet":

var data = [];
// add as many times as needed in a loop
data.push([value1, "value2", value3]);
//
var lastRow = SpreadsheetApp.getActiveSheet().getLastRow();
SpreadsheetApp.getActiveSheet().getRange(lastRow + 1,1,data.length, 
data[0].length).setValues(data); 

Thursday, September 28, 2023

correct way to check GPG signature - Stellarium AppImage

I thought the Stellarium AppImage was corrupted or changed, and submitted an issue - https://github.com/Stellarium/stellarium/issues/3432

It turns out the correct way to check files in stellarium releases is mentioned on https://github.com/Stellarium/stellarium/releases/

It's not the AppImage signing method as mentioned at
https://docs.appimage.org/packaging-guide/optional/signatures.html#validating-the-signature

So, not

./Stellarium-0.19.3-x86_64.AppImage --appimage-signature

but

gpgv --keyring ./stellarium.gpg 
Stellarium-0.19.3-x86_64.AppImage.asc
Stellarium-0.19.3-x86_64.AppImage

Wednesday, September 27, 2023

Stellarium scripting discussion

Copy-pasting one of my private replies sparked by the interesting discussion at
https://github.com/Stellarium/stellarium/discussions/3424

The internals of stellarium are such that you can't use Spacebar to control a script - you can use keys like

=, -, ] or [ or L or J

That is, those keys which are mapped to some functions already in

More information about this limitation is at
and

So, if using another key is acceptable to you, we can go ahead with that.

Request for diurnal motion and annual motion specifically for Stellarium v0.19.3 - 

As far as I know, there is not much difference between 0.19.3 and the latest version, as far as this particular script goes.


Diurnal motion - just hitting (lower case L) "speeds up time" , so you can see the stars/planets/sun/moon go around faster.

Annual motion - I suppose you would want the night sky as seen at Bristol at 12 midnight over the course of one year to be shown in 36.5 seconds?
This can be done using something like this script

Stellarium has a remote control plugin, which allows you to run scripts using a different computer / tablet / phone.
If that is useful for you, you can enable it using
(F2) Configuration Window -> Plugins tab -> Remote control -
choose enable at startup
Then close and open stellarium
Then go back to
(F2) Configuration Window -> Plugins tab -> Remote control
choose the configure button, and check the "Server enabled" box.
(Also check the "Enable automatically on startup" if you want it permanently enabled every time.)

 

playing out 4K videos from network share on Firestick 4K - buffering

According to this video, the app to use is Network Browser, for playing out files on a Firestick from a Windows (SMB) share over the network instead of streaming or from a USB drive. 

 But unfortunately, a share from a Raspberry Pi 2, even connected via Ethernet to the Router and the Router connected via Wifi 5g to the firestick, could not send the file fast enough - Network Browser was buffering for the high bandwidth parts. Maybe I'll revisit this with a faster network share, maybe from Windows laptop? Or perhaps connect the Firestick via Ethernet using something like this?

Tuesday, September 26, 2023

EMI or grounding issues

My replies to a query about some sensitive instruments showing noise on-screen at a particular installation:

This tektronix page gives some ideas on how we can search for EMI, and the frequency bands we need to look at.

Here is a link to a low cost device using an arduino for a SDR (software defined radio) which can be tuned from 100 khz to 50 Mhz - 

Ready-made SDRs are also available, for eg. SoftRock,

Even simpler might be, if you have a portable radio which can tune from AM to SW bands, you could take that to test for EMI (which would be heard as a KRRRR noise in some band, if you tune over all bands) and then change volume as you move closer / farther from the EMI source. 

To see if earthing is the culprit and not EMI, one possibility is:

Use some thick short 15 amp electric wire and connect together the working and non-working (noisy) equipments using their grounding lugs if any, or some sort of screw mounts on the metal part of their body.

Excerpts from S's reply:

the article is extremely informative and helpful.
i do not think grounding is a an issue. Engineers from  ...
have come and  checked the ...
installation which is
right below ....
They found that the Gradient Pipe  which is
right below the ceiling is not shielded.
... if the power cable is passing through ...
there is noise Hence i think if we use a EMF shielded  power
cable there might be  noise reduction....
i have asked ...
to come with a Spectrum Analyzer and also EMF
shielded power cables...

printing from Gmail without the header

It looks like the only way is to select part of the message, right-click and choose "Print selection". But then, the From email address, date, To email address etc are still not displayed. So my workaround was to copy-paste into a new Google Doc the from, to etc from the "Show Original" menu item, copy-paste the body, then print from the Google Doc.

sharing a folder on Raspberry pi

 https://subscription.packtpub.com/book/iot-and-hardware/9781849696623/1/ch01lvl1sec19/sharing-the-home-folder-of-the-raspberry-pi-with-smb

describes how to share with a password.

But we want to do it without password.

public to "yes" in

https://pimylifeup.com/raspberry-pi-samba/

But didn't do. Instead, needed smbpasswd step.

all issues were due to a router reset

Multiple things went wrong -

  1. we could not ssh into the Raspberry Pi doing loop playout in the lobby in order to reboot it - for which we generally use the RaspController app.
  2. we could not control our theatre lights - controlled using a python script as per this post.
  3. The playout Amazon Firestick could not connect to the internet, so it was displaying "Home Unavailable" - the workaround was to long-press home, and choose MxPlayer from the installed apps from the shortcut menu.  

It turned out that all the issues were due to the Wifi router getting reset. Why? No idea. Anyway, filled in all the static ip addresses mapped to MAC addresses, as well as the gateway information, restarted the router and the devices, and all was well. 

Monday, September 25, 2023

network inventory or discovery - finding IP addresses of all hosts using nmap

I had written earlier about the arp command to check all the hosts on the network, but sometimes that does not work. It turns out nmap does a good job. Referencing https://www.redhat.com/sysadmin/quick-nmap-inventory

nmap 192.168.0.0/24

does a full scan of all hosts, 

(4 hosts up) scanned in 24.17 seconds

nmap -sn 192.168.0.0/24

does a quick scan, which only shows which hosts are up - in around 4 seconds.

The link above even shows how to do a packet trace using nmap, 

# nmap -vv -n -sn -PE -T4 --packet-trace 192.168.2.3

use NTFS USB drive with Android - possible workaround

 Maybe this will work with Amazon firestick also? This forum thread -
https://xdaforums.com/t/how-to-get-usbs-to-work-on-android.3952656/

mentions the app “Microsoft exFAT/NTFS for usb by Paragon software” - and the comments there point to total commander.

Sunday, September 24, 2023

passing parameters via a php page to Google Apps script

There was a requirement to pass some parameters via a php page to a Google apps script in an iframe. I've url-encoded the parameter to prevent XSS,
prevent xss attack via url( PHP) - Stack Overflow

getting rid of "unverified publisher" warnings in Windows builds

 It looks like it would cost a minimum of $100 a year to get a trusted certificate to get rid of the "unverified publisher" warnings - we could create an openssl certificate with our name, but it would still be "unverified".

Get rid of "Publisher Unverified" warnings in Windows for executables - Stack Overflow

Saturday, September 23, 2023

manually renewing letsencrypt certificates for a migrated server

One of our wordpress web servers running on Ubuntu 22 showed certificate errors - apparently the letsencrypt certificates had not been auto-renewed.

Following

sudo apt install certbot python3-certbot-apache
#(was already installed)
sudo apache2ctl configtest
#(Syntax OK)
sudo certbot --apache
#(chose to Expand and replace current certificates for all domains, done.)

Then, I put in a reminder in my google calendar to check if auto-renewal has any problems, one week before expiry 3 months later.

flask app takes a long time to load on Linux Mint

 In addition to all the issues with a python flask app for controlling smart bulbs as mentioned in this other post, when I tried to run the flask app for troubleshooting on Linux Mint, it would take nearly 3 minutes to start up. Probably due to python installation issues? Python2 vs Python3 issues? Did not go too deep into it at this time.

Thursday, September 21, 2023

hard coding subtitles with avidemux

For our planetarium show subtitles in Hindi and Telugu, the avidemux subtitle settings were as below:



Wednesday, September 20, 2023

blender has built in vr export

 Howto using cycles - 

Blender Tutorial: How to render VR 360 degree, stereoscopic 3D - YouTube

Checkbox for stereoscopy in output properties, if we want stereoscopic. Also need to change Views to Stereo3D in Output properties. And we can choose the Stereo Mode to be Anaglyph, top/bottom, etc.


Then Camera type Panoramic, and Panorama type Equirectangular. (For fisheye for the dome, Equisolid gives me good results with the output circle fitting the output square exactly.) And check spherical stereo if needed.



 


Monday, September 18, 2023

adding a blogger blog sitemap to Google webmaster tools - Google Search Console

Google webmaster tools is now Google Search console. So, the way to add a blogger blog's sitemap, from the blogger console, is to go to Google Search Console using the link as in the screenshot below,
Blogger --> Settings --> Google Search console under Crawlers and Indexing

Then the steps given at
https://xomisse.com/blog/create-and-submit-a-sitemap-on-blogger/
for adding sitemap - On the left click Crawl --> Sitemaps --> Add/Test Sitemap.

Enter sitemap.xml in the sitemap field and test for errors, and if OK, redo the steps and submit.
 

Sunday, September 17, 2023

Friday, September 15, 2023

Stellarium flybys in high resolution

1. vncserver -geometry 7680x4320

Tightvnc viewer, choose 25% zoom in options

Flybys are possible now!

Board a spacecraft and flyby planets, moons and a comet yourself · Stellarium/stellarium · Discussion #2178 (github.com)

2. Xubuntu with high-res screen : r/xubuntu (reddit.com)
Settings -> Appearance -> Fonts and set to roughly 180.

3. Now stellarium can save screenshots in desired resolution directly, so no need of vnc etc.

Thursday, September 14, 2023

delete an EFI partition with Windows Diskpart

Following the advice at
https://www.easeus.com/partition-master/delete-efi-system-partition.html

Run cmd.exe

diskpart
list disk
sel disk 2
list partition
sel partition 1
SET ID=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
delete partition override