Skip to content

Instantly share code, notes, and snippets.

View ShivKumarSaini's full-sized avatar
🎯
Focusing

Shiv Kumar ShivKumarSaini

🎯
Focusing
  • IBM
View GitHub Profile
@ShivKumarSaini
ShivKumarSaini / Update_NodeJs_Version.md
Last active April 23, 2022 15:08
Updating node.js version on Linux machine

Update Node.js with NVM and keep packages

Usually when new version of Node.js comes out and you update it by just installing new and removing old one, all of your global NPM packages are gone. Here is how to update to new version of Node and reinstall packages:

Install/update NVM first

For Windows, use nvm setup from "https://github.com/coreybutler/nvm-windows/releases".

Go to URL "https://github.com/creationix/nvm" and follow install/update instructions.

@ShivKumarSaini
ShivKumarSaini / LICENCE SUBLIME TEXT
Created July 25, 2018 07:25
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@ShivKumarSaini
ShivKumarSaini / coturn-installation-steps.md
Last active December 21, 2020 18:22
Coturn installation steps

Third-party libraries

If you are installing the coturn package in Debian, Ubuntu or Mint, or if you installing the "turnserver" port in FreeBSD, or if you are installing one of the supplied binaries in the "downloads" section of the project, then the OS and the third party packages are installed automatically. The instrudctions below are for those who are setting the TURN server from scratch.

Before installing and configuring the TURN server, the latest stable libevent library should be downloaded, built and installed:

$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz

As root, build and install the library with the usual:

$ tar xvfz libevent-2.0.21-stable.tar.gz

@ShivKumarSaini
ShivKumarSaini / multiple-repository-and-identities-git-configuration.md
Last active December 1, 2020 15:10 — forked from bgauduch/multiple-repository-and-identities-git-configuration.md
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@ShivKumarSaini
ShivKumarSaini / nodejs-ubuntu-bind-port-80.md
Created June 29, 2020 13:02 — forked from guifromrio/nodejs-ubuntu-bind-port-80.md
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@ShivKumarSaini
ShivKumarSaini / Installing MySQL.md
Last active May 6, 2020 19:07
All privileges to new user in MySQL

Step 0: Remove/Purge:

In case, this is a re-installation, first remove previous version fully.

$ sudo apt-get remove --purge mysql*  
$ sudo apt-get purge mysql*  
$ sudo apt-get autoremove  
$ sudo apt-get autoclean  
$ sudo apt-get remove dbconfig-mysql
@ShivKumarSaini
ShivKumarSaini / Angular script:
Last active December 6, 2019 11:19
File Download (Excel in this case) with Node Server and Angular 2+ App
this._httpService.get(<server url to download a file>
, {headers: new HttpHeaders({'Content-Type': 'application/octet-stream'}), responseType: 'blob'})
.subscribe(
(fileExcel) => {
fileExcel; // this is a blob.
},
(error) => {
console.log('err');
}
);
@ShivKumarSaini
ShivKumarSaini / PM2 start with configurations
Created March 19, 2019 07:42
PM2 start with env config
pm2 start --env=development_server --only=server-live