Thursday, July 30, 2020

appropriate technology - right-sizing tech solutions

Yesterday, I heard about a clever implementation of distance learning by some school here. The teachers would daily send assignments via Whatsapp with links to some online knowledge resource, along with some questions. The children are encouraged to go through the resource, answer the questions and get back to the teacher in case of questions. This is quite useful in a bandwidth-starved nation like India, where asking pupils to participate in video calls would tax their parents' resources.

Today, I had to answer some queries regarding cost calculations for hosting of a medical data collection application. I'll copy-paste it below with some modifications.

As you may know, pricing of Azure services and AWS services are given at
https://azure.microsoft.com/en-in/pricing/
and
https://aws.amazon.com/pricing/

In general, such cloud services are very much more expensive than other hosting services, if the loads are small and predictable. By small load, I would classify even radiosai.org, with 1.5 lakh visitors a month, thousands of concurrent listeners, as "small".

But in the case of wildly fluctuating loads, when you have a load balancing system and multiple servers which need to be brought online and taken offline dynamically, cloud servers then become cost effective. They are also useful for outsourcing many of the management headaches of servers, to have the peace of mind of managed hosting without the possible security issues of shared hosting.

In the case of the medical data collection tool, they recommend Azure/AWS/your own server for security and licensing reasons. As mentioned at their website, only a very basic set of specs is needed for it, which can easily be supplied by even a shared hosting provider offering Rs. 40 per month hosting. The only caveat is that the organisation who has the license should take sole responsibility for the hosting and support of the application as given in the requirements page.

If the organisation hosting the site is a non-profit, it would be possible to get non-profit credits from Microsoft for Azure, and from Amazon for AWS.
https://www.microsoft.com/en-us/nonprofits/azure
https://aws.amazon.com/government-education/nonprofits/

Azure seems to be offering a larger number of credits - $5000 vs $2000. Also, on the Azure pricing page, they mention that they will price match AWS for cloud infrastructure. So, it might seem that hosting on Azure may be the better option, if you do get non-profit credits.

Since the loads expected on this server would be small - by my definition of small as given above - I would recommend using a VM with a couple of cores and low end specs
https://azure.microsoft.com/en-in/pricing/details/virtual-machines/linux/

If you don't get non-profit credits, the lowest cost option would be to hire two shared servers from two different reputed providers, ensuring that their services are located in different physical locations (since your services are in India, you could look for Bangalore and Mumbai, for example) and have one of them as hot-spare. If you use cloudflare.com to host your dns, operating a hot spare becomes very easy. Such a hot-spare setup allows you to have the peace of mind that Azure/AWS offers, at 10x lower cost. But your provider(s) need to be reputable in the sense that they should not steal your data, and they need to ensure good security practices.

Even if for security reasons you do not want to go for shared hosting, you could get reputed dedicated servers for half the price of Azure/AWS VMs of similar specs, or host it on your premises if you have redundant internet links to your facility. Only drawback, of course, would be that you would need to manually set up as against the automated Azure setup option offered by your software. And you need to know how to do some server management and maintenance.

In the case of VMs or shared servers or dedicated servers, you can directly calculate the costs by just multiplying the per hour or per month cost by the number of hours/months in a year.

In case you wish to estimate traffic, you will need to know what sort of data is going to be uploaded/ downloaded - whether it would be predominantly just numbers, or whether images/video/audio would be included, and what are the estimated numbers of users. Again, a simple multiplication.

When looking to host something for non-profits, where there is no charge for the services being offered, we can get the best RoI by minimising cost while ensuring that performance doesn't suffer. So, for small operations such as ours, I wouldn't recommend cloud solutions except when free credits are available.

Wednesday, July 29, 2020

Getting USB tethering to work with Linux Mint

Our home BSNL broadband has been on the fritz since yesterday. The land-line phone is dead. Airtel 4G on my LG Q6 can do wifi hotspot also, but I preferred to get USB tethering working, since the wifi card on this Lenovo laptop sometimes has issues.

Just connecting the USB cable to the phone and computer, enabling USB tethering on the phone, I get a "Connected" notification on the computer. But "could not find server" errors. Checked and saw that the default setting assigning my phone's IP address as the DNS server. Changed that to Google DNS 8.8.8.8, and the connection works fine. Network connections - Edit the relevant connection - IPv4 tab.

Friday, July 24, 2020

adding Next and Previous post links in new blogger

Tried http://copypastesave.blogspot.com/2017/06/add-pervious-page-home-and-next-page-in.html

using revert to legacy blogger.

Step 3 occurs in 9 places!

Unfortunately, this made the entire post not display! So, reverted to adding the Previous and Next links manually. 

Wednesday, July 22, 2020

Google Meet issues with Firefox

When I try to join a Google Meet meeting on Firefox 78, running on Linux Mint, I get a video network error and get disconnected. On the same machine, when I connect with Chrome 84, it works fine.

So, we have to use Chrome for Google Meet.

Friday, July 03, 2020

find and replace http with https with sed

htm pages under the SI folder used to give a POST request to http://www.radiosai.org/program/PlayNow.php
which we needed to change to https, since otherwise the POST requests do not get redirected

PB did this with
SI# ls
2011  2012  2013  2014  2015  2016  (etc)

SI# find ./ -type f -exec sed -i 's/action=\"http/action=\"https/g' {} \;

More examples of sed with find are given at https://linuxize.com/post/how-to-use-sed-to-find-and-replace-string-in-files/