Update Node.js with NVM (Node Version Manager) There are many ways that can be used to update the node version on a linux system. Bu the best and the recomended would be using the Node Version Manager. 1. Update the package repository sudo apt update 2. Install NVM using either curl or wget command . […]
Most Searched Keywords in 2022
Most Searched Key Words on Google in 2022
Setting SSL HTTPS on Nodejs
There are many ways that we can use to setup SSL/TLS to our Nodejs app. In this post we will forcus on tow of the main methods. Setting SSL using Private key and Full Chain pem Certificate files Mostly if you are using Linux based OS on your server , you will be mostly familier […]
MySQL How To Create a New User and Grant Permissions
Creating a New User SSH to your Ubuntu system and login to MYSQL instance using root user mysql -u root -p Once you have gained access to the MYSQL, add your user using CREATE USER command CREATE USER ‘username’@’host’ IDENTIFIED WITH authentication_plugin BY ‘password’; Run the following command to create a user that authenticates with […]
How to List all Forign Keys of a SQL Table
List Forign keys of a table SELECT TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = ‘<database>’ AND REFERENCED_TABLE_NAME = ‘<table>’; List Forign keys of a table column SELECT TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = ‘<database>’ AND REFERENCED_TABLE_NAME = ‘<table>’ AND REFERENCED_COLUMN_NAME = ‘<column>’; Drop a Forign Key from a Table MySQL: ALTER TABLE Orders DROP […]
How to Completely Uninstall Nodejs, npm and node in Ubuntu
sudo apt-get remove nodejs sudo apt-get remove npm Then go to /etc/apt/sources.list.d and remove any node list if you have. Then do a sudo apt-get update Check for any .npm or .node folder in your home folder and delete those.
How to Convert Camel Case to Snake Case JavaScript
let message = ‘helloWorld’ let convertedMessage=message.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`); console.log(convertedMessage); output -> hello_world
Most Used Cron Expressions
Cron Job Every Minute * * * * * Cron Job Every Hour 0 * * * * Cron Job Every Day Midnight 0 0 * * * Cron Job Every 5 Minute */5 * * * * Cron Job Every 2 Hours 0 */2 * * * Cron Job Every Week 0 0 * […]
Create a New User in PostgreSQL
Note: This post only provides the key commands of the postgreSQL as a easy way for developers. If you need to learn in depth, please refer to the official documentation Create a new user in PostgreSQL CREATE USER <name> WITH PASSWORD ‘<password>’; If the user already exists, add the password by using ALTER USER: ALTER USER […]
How To Install Docker on Ubuntu
Update the apt package index and install packages to allow apt to use a repository over HTTPS: sudo apt-get update sudo apt-get install ca-certificates curl gnupg lsb-release Add Docker’s official GPG key: sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg –dearmor -o /etc/apt/keyrings/docker.gpg Use the following command to set up the repository: echo “deb [arch=$(dpkg –print-architecture) […]