Saturday, October 9, 2021

Automatic renew letsencrypt SSL certificate every 3 months

1. Create a simple script to renew and restart Apache httpd server:

[user@scripts]# cat renew-easy-certificates.sh


certbot certonly --webroot -w /var/www/html/easybiny/price -d price.easybiny.com
certbot certonly --webroot -w /var/www/html/easybiny/prod -d easybiny.com
service httpd restart

 

2. Open crontab scheduler

crontab -e 

 

3. Add the following under crontab scheduler:

0 0 1 */3 * sh /path/scripts/renew-easy-certificates.sh

This runs every 3 months on the first day of each month at 00:00. Certificates are now automatically renewed.

Wednesday, October 6, 2021

Fix npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/abbrev'

 Run the following command and it works just fine (tested on OS X) :

sudo npm install --unsafe-perm -g expo-cli

 

For uninstallting expo-cli, following command can be used:

sudo npm uninstall --unsafe-perm -g expo-cli --save

Verify if node.js is installed

 From a terminal, run the following command. It shall tell node.js installed version:


MacBook-Pro ~ % node -v

v14.18.0

Sunday, May 16, 2021

Loop timeout delay in Browser Console

Below code will iterate from 1 to 10 with a delay of 1 second (1000 ms) between each iteration.

function loopFinish() {
   console.log('All is complete');
}
for(let i = 1; i < 11; i++) {
   setTimeout(()=>{
      console.log("Iteration number: "+i);   
      if(i === 10){
         setTimeout(loopFinish, 1000);
      }
   },i * 1000);
}

 Output would  be in the console browser:


Iteration number: 1
Iteration number: 2
Iteration number: 3
Iteration number: 4
Iteration number: 5
Iteration number: 6
Iteration number: 7
Iteration number: 8
Iteration number: 9
Iteration number: 10
All is complete

 

Monday, May 10, 2021

Royal TSX Items do not show and only "Filtered by: Favorites" show up

 As per:

https://support.royalapps.com/support/solutions/articles/17000065344-where-are-my-documents-stored-

Follow those simple steps to solve it:

You accidentally activated "Show only Favorites" but don't have any favorites
Solution: Disable "Show only Favorites" by clicking the yellow star button in the bottom left corner of the navigation panel (sidebar)

 

 

Saturday, May 1, 2021

Cisco VPN connection slow on Archer C80 TP Link router

 All I needed to do is to update router firmware to latest version available - in my case this is 1.5.7:


Advanced -> System -> Firmware Upgrade



 

Please also note that for VPN to work, following need to be checked:

 




Wednesday, April 28, 2021

Lets encrypt - Add multiple domains to one certificate

 It's very simple, just use the following command to generate the certificate with as many domains as needed (two in the below example):

certbot certonly --webroot -w /var/www/html/easybiny/price -d price.easybiny.com -d www.price.easybiny.com