Used this medium post which links to this codepen as a starting point for implementing share over email (a mailto link), copy to clipboard, and sharing via facebook, twitter and linkedin. Our code is on my (private) github repo.
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!
Wednesday, November 25, 2020
Monday, November 23, 2020
firebase authentication tutorial without the need to set up billing - but ...
The official firebase auth tutorial from Google needs you to set up billing. This tutorial made by the community doesn't need you to set up billing.
But since it's based on old versions of libs, with the current (newer) version of falcon, gives error at
from falcon.version import __version__ # NOQA
Saturday, November 21, 2020
exporting users from a large google group
Thursday, November 19, 2020
low cost video capture and streaming
How times have changed since the days of the $1000 Matrox RT2000 which we purchased in 1999-2001. This HDMI frame-grabber costs only $35. But it's just a simple HDMI to USB conversion, raw frames with no encoding. So the PC needs to be capable enough to handle the high-bitrate stream and do encoding on the fly. Since these are generally used by gamers for streaming, beefy machines are not an issue. And OBS Studio is the software of choice. Then, OBS Studio has "BrowserSource" which can be used to capture - no hardware required, except OBS Studio's own hardware requirements.
All these could be possibilities if Google goes ahead with its plan to remove access to Google Meet recording ability for Education customers.
Sunday, November 15, 2020
creating and distributing private keys as pem files
setting up letsencrypt certificates for multiple virtual hosts with apache
The preferred method is to just run certbot multiple times with each required domain, as mentioned at https://www.digitalocean.com/community/tutorials/how-to-set-up-let-s-encrypt-certificates-for-multiple-apache-virtual-hosts-on-ubuntu-14-04
So, sudo certbot --apache -d example.com -d www.example.com
and later
sudo certbot --apache -d example2.com -d www.example2.com
or whatever. And then add to root's cron,
15 3 * * * /usr/bin/certbot renew --quiet
which checks every morning at 3:15 AM and renews any certs with validity less than 30 days more.
Saturday, November 14, 2020
troubleshooting a ruby on rails web server
To troubleshoot a web server running ruby on rails, checked the history of the ssh login I had been supplied (up arrow, up arrow, etc) and found that the admin had started rails using
rails s -p 5001 -b <ipaddress> -d
rails s -p 3001 -b <ipaddress> -d
for the two sites, and that they were running apache to proxy these ports to the two websites. The sites-available had virtual hosts configured like
DocumentRoot /full/path/to/rubyonrails/project/production
...
ProxyPass / http://xx.yy.zz.ww:5001/
ProxyPassReverse / http://xx.yy.zz.ww:5001/
and so on.
Found that the apache sites-enabled directory had some wrong entries + duplicate entries, which were causing apache to go back to the default configuration with no virtual servers, hence the various errors. There may be some issues with apache, serveralias and rails as mentioned here,
https://serverfault.com/questions/300226/serving-rails-through-apache-using-proxypass
that it was serving up the test page when the main domain was a server alias. So, I created a separate virtual server conf file in sites-available, with main-domain-name.conf which solved that issue. Then ran certbot for both domains for getting letsencrypt certificates.
Tuesday, November 10, 2020
debugging the radiosai google assistant action's audio search issue
Going step by step, found that dialogflow was returning the value "search" instead of the words the user was using. After going through the codelabs example at https://codelabs.developers.
After submitting this version as a release, the corrected version is live now.
Monday, November 09, 2020
test of creating a free tier instance, using it for multiple users like students
Though GCP's "recommended way" of adding SSH keys is quite convoluted, found that I could use my usual method to add my key, and use PasswordAuthentication yes in /etc/sshd-config to allow password-based logins for users.
As can be seen in this techrepublic post, the way to prevent newly created users from seeing each others' directories is to edit the /etc/adduser.conf file, changing the default home directory permissions from 755 to 750. We can of course do this manually with sudo chmod 750 /home/user1 and so on.
Then, using a "Free Tier" f1 micro instance, someone can do text-based teaching like conducting a C lab after installing the required build tools like apt install gcc or apt-get install build-essential. Currently the specs of a free tier compute instance are -
1 F1-micro instance per month
Scalable, high-performance virtual machines.
1 non-preemptible f1-micro VM instance per month in one of the following US regions:
Oregon: us-west1
Iowa: us-central1
South Carolina: us-east1
30 GB-months HDD
5 GB-month snapshot storage in the following regions:
Oregon: us-west1
Iowa: us-central1
South Carolina: us-east1
Taiwan: asia-east1
Belgium: europe-west1
1 GB network egress from North America to all region destinations (excluding China and Australia) per month.
Saturday, November 07, 2020
Azure AD guest account and how to close an azure account
There are conflicting posts all around, saying that one can only remove subscriptions and not close an Azure account once it is opened. Since I had used this from a test domain, it was an "unmanaged organization"
https://docs.microsoft.com/en-us/azure/active-directory/enterprise-users/users-close-account
Sign in to close your account, using the account that you want to close.
On My data requests, select Close account.
I used this to remove the test account I had created to delegate permissions for an app being developed by a third-party. The delegation of permissions via Azure Active Directory implies that the guest user has to switch directory to the directory of the current resource in the Azure portal, and then the guest user would have view access to the current directory name (and probably more).
Monday, November 02, 2020
diffuse not opening - needs python2
The graphical diff tool Diffuse was not opening - running it from the terminal gave the error message
diffuse
File "/usr/bin/diffuse", line 74
print codecs.encode(unicode(s, 'utf_8'), sys.getfilesystemencoding())
^
SyntaxError: invalid syntax
Apparently this is because diffuse is written for python2.
So, edited the hashbang for /usr/bin/diffuse to use /usr/bin/env python2 instead of /usr/bin/env/ python, works now.
#!/usr/bin/env python2