Blog

History shows that I am not consistent on writing here, though I really wish to write often.

Switched to Zola

I switched my blog from WordPress to Zola. I was managing two WordPress instances since last quarter of 2019. One as my personal website home and other for as my blog. Before that I was using Hugo for my blog. Before that Stagen, a static site generator developed myself written in JavaScript (Node.js). Before Jekyll. Before that, WordPress again.

Replace Collation on a MySQL Dump File

Sometimes we may find difficulty with importing a database from dump file which is created from a different machine.

It may issue an error message like this:

ERROR 1273 (HY000) at line 110: Unknown collation: 'utf8mb4_0900_ai_ci'

Install and Run Multiple PHP Versions in Ubuntu 22.04

I wanted to run both Drupal 7 and 9, as part of my work, in my machine now running on Ubuntu 22.04. Drupal 7 best run with PHP 5.6 while Drupal 9 requires either PHP 7.4 or 8.1

I could make it work after some research and try. Here is how I made it work.

Quick Twig Template Rendering Without Much Set Up

Sometimes, I want to prepare more readable output from my PHP scripts. It is good to create a template and render with values from script out put.

Here is a quick way to render a twig template. First lets assume the HTML twig template (test-report.html.twig) is:

Turn ON Android Mobile Having Broken Power Button

Power button of my mobile phone stopped working completely few weeks back. It showed some symptoms few days prior to that. I was being so careful not to drain out the battery as I would be required to press button to turn it back to ON, which I can't because of broken button.

But it happened! Yesterday, my phone battery got drained while I was using my laptop connected to the WiFi hotspot from it.

I tried pressing the power button multiple ways, but to no avail. Even, I thought about dissembling the phone or taking out the power button. But I started searching for ways to make it work without physically abusing the phone. Eventually, I found a geeky way to turn ON the phone. Following are the steps involved.

Fertilizer Recommendations

In this article I just note applications of various fertilizers. It is mainly to help myself to refer quickly as I can look into this article as needed. I may update this article as need to add or update info.

Install MySQL 5.7 on Ubuntu 20.04

First follow installation instructions given at https://docs.docker.com/engine/install/ubuntu/ .

Then make sure docker is running properly:

$ sudo docker run hello-world

Ensure it created the image by:

$ sudo docker images

Use Python Markdown Extension in Jupyter Notebooks

I regularly use Python Markdown when working with Jupyter notebooks. It is actually straightforward to set up in Jupyter, but I always forget the exact steps to be followed whenever I set up Jupyter notebook especially after installing a new OS.

So, there are those steps, I note here to help myself in future. First install notebook extensions package. Documented at https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html

pip install jupyter_contrib_nbextensions

Then install the extension helping to configure extensions with UI.

3.7 to 1.5 V Buck Converter with MC34063AP

My daughter got a toy train which uses AA sized battery cells to operate. It has space to put two AA cells in parallel, so it requires just 1.5 V to work.

To avoid buying AA cells, I tried to make it rechargeable with a 18650 lithium-ion cell with protection board having USB port. But voltage range of lithium-ion cell, 3.0 to 4.2 V, is bit higher for its motor. It jumps off the track as soon as it powered with 18650 cell.

Edit PDF Metadata in Ubuntu 18.04

I see pdftk get first in list as most recommended way when searching for editing PDF metadata in Ubuntu. But pdftk is no longer present in Ubuntu 18.04 repositories.

LED Light with CYT1000B

Lighting LED with AC main supply were not that easy. Mainly it required some sort of SMPS with current controlling circuitry. But it is changing. Now there are integrated circuits available specially designed to help to light LEDs with few extra components. One of such IC is CYT1000B.

I like CYT1000B more compared similar ICs in its category because it requires fewer components.

What I most dislike about CYT1000B is that it can only be used drive up to 60mA, thus cannot be used to light most of power LED chips. However, 3528 LEDs are rated 60mA so can be used.

തെർമോക്കപ്പ്ൾ

ചൂട് അളക്കാനായി ഉപയോഗിക്കുന്ന ഒരു വഴിയാണ് തെർമോക്കപ്പ്ൾ. രണ്ട് വ്യത്യസ്ത ലോഹസങ്കരങ്ങൾ ചേർത്തുണ്ടാക്കുന്ന ലളിതമായ ഒരു ലോഹക്കഷ്ണമോ ദണ്ഡോ ആണിത്. ചൂടിന്റെ അളവനുസരിച്ച് ഇത് വളരെ ചെറിയ അളവിൽ വൈദ്യുതിയുണ്ടാക്കും. അതിന്റെ വോൾട്ടേജ് നില ചൂടിന്‌ ആനുപാതികമായിരിക്കും. ഇങ്ങനെയുണ്ടാകുന്ന വോൾട്ടേജ് നില അളന്ന് അതിൽ നിന്നും ചൂട് എത്രയാണ് എന്ന് കണക്കുകൂട്ടി കണ്ടെത്താൻ കഴിയും.
പക്ഷെ തെർമോക്കപ്പ്ലിന്റെ വോട്ടേജ് നില നേരിട്ട് അളക്കുന്നത് ശരിയായ രീതിയല്ല. കാരണം വളരെ ചെറിയ വോൾട്ടേജായിരിക്കും അത്. ഉദാഹരണം ഒരു K ടൈപ്പ് തെർമോക്കപ്പ്ൾ ഏതാണ് 600 ഡിഗ്രി ചൂടാക്കിയാൽ ഉണ്ടാവുന്നത് ഏതാണ്ട് 20 മില്ലി വോൾട്ട് ആണ്. മിക്ക മൈക്രോകണ്ട്രോളറുകൾക്കും ADC ഐസികൾക്കൂം ഈ കുറഞ്ഞ വോൾട്ടേജ് നില വേർത്തിരിച്ച് അറിയാൻ കഴിയില്ല. എന്നാൽ ഒരു ആമ്പ്ലിഫയർ സർക്യൂട്ട് ഉപയോഗിച്ചാൽ ഈ പ്രശ്നത്തെ മറികടക്കാം. തെർമോക്കപ്പ്ലിന്റെ വോൾട്ടേജ് നില 100 മടങ്ങ് അല്ലെങ്കിൽ അതിൽ കൂടുതലോ ആയി ഉയർത്തി മൈക്രോകണ്ട്രോളറിന് നൽകാം.