Change the datacenter set in cassandra-rackdc on Ubuntu

Problem: Changing just the datacenter name in cassandra-rackdc.properties gives the error:

Cannot start node if snitch's data center [newName] differs from previous data center [oldName]. Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true.

Solution:
If you are just beginning to setup you cassandra cluster, and is ok to reset the data to bootstrapped state, do this

sudo service cassandra stop
sudo rm -R /var/lib/cassandra
sudo mkdir /var/lib/cassandra
sudo chown cassandra /var/lib/cassandra
sudo service cassandra start

If you need to persist the existing data, do this

sudo vi /etc/cassandra/cassandra-env.sh
# edit the JVM_OPTS line to make it look like below
JVM_OPTS=\"$JVM_OPTS -Dcassandra.ignore_rack=true -Dcassandra.ignore_dc=true\"

sudo service cassandra restart

This should normally resolve the dc name correction in rack-dc properties file.

RabbitMQ installation fails in in the last leg of setting up in ubuntu 20.04

Error:

Setting up rabbitmq-server (3.8.16-1) …
Job for rabbitmq-server.service failed because the control process exited with 
error code.
See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.
invoke-rc.d: initscript rabbitmq-server, action "start" failed.

Reason: libtinfo.so library missing.

Solution:

sudo apt install libncurses5

Note: No need to reattempt the installation.

An “eat dosa!” reminder for busy kids :)

Here is a one hour HTML app that you can use to repeat recorded audio to remind your busy kids they have to finish that food on the table, while watching their favorite videos on YouTube.

Launch Dosa Reminder HTML App

To use the app is this simple –

  • Click on record button. Give permission to access microphone if it asks for it.
  • The recording automatically stops in 4 seconds and replays what it recorded. You can re-record till you are satisfied with the playback.
  • Now you can set the number of seconds of interval, between which the above audio has to be repeated.
  • Click on “Start Reminder” button to start the reminders.
  • When your kid is done eating, you can stop the reminders by clicking “Stop Reminder” button

Happy parenting !

Enable dark mode for Chrome on desktop

Dark mode is great to protect your eyes, more so if you are a coder.

Here is how you can apply dark more on chrome on your desktop –

  • In the address bar paste this address : chrome://flags/#enable-force-dark
  • Change the setting “Force Dark Mode for Web Contents” from default to “enabled”

That’s it. Now you can have easy on eyes theme on Chrome, just like your IDE !

NPM install gives error : Cannot find module ‘semver’

Problem:
We get this error when we do npm install –

Error: Cannot find module ‘semver’
Require stack:

  • /usr/share/npm/lib/utils/unsupported.js
  • /usr/share/npm/bin/npm-cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object. (/usr/share/npm/lib/utils/unsupported.js:2:14)


Reason:
Version issues

Fix:
Run these commands

sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/bin/node*
sudo rm -rf /usr/local/include/node*

sudo apt-get purge nodejs npm
sudo apt autoremove
sudo apt-get install nodejs npm

Try now. Should be fixed !

Fix : The repository ‘http://archive.ubuntu.com/ubuntu disco-backports Release’ no longer has a Release file.

Issue : When doing an apt update, we get the this error.
The repository ‘http://archive.ubuntu.com/ubuntu disco-backports Release’ no longer has a Release file. N: Updating from such a repository can’t be done securely, and is therefore disabled by default.

fix :

[bash] vi /etc/apt/sources.list replace all occurrences of archive.ubuntu.com to old-releases.ubuntu.com [/bash]