Skip to content

Instantly share code, notes, and snippets.


Shiv Kumar ShivKumarSaini

View GitHub Profile

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:


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

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

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

View gist:affbc6e04d1b05140dbbaf40a3f000d5
to check if the server works -

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 /
Created Jun 29, 2020 — forked from firstdoit/
Allow Node.js to bind to privileged ports without root access on Ubuntu

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


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 / Installing
Last active May 6, 2020
All privileges to new user in MySQL
View Installing

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 / Angular script:
Last active Dec 6, 2019
File Download (Excel in this case) with Node Server and Angular 2+ App
View Angular script:
this._httpService.get(<server url to download a file>
, {headers: new HttpHeaders({'Content-Type': 'application/octet-stream'}), responseType: 'blob'})
(fileExcel) => {
fileExcel; // this is a blob.
(error) => {
View PM2 start with configurations
pm2 start --env=development_server --only=server-live
ShivKumarSaini / distance.sql
Created Oct 23, 2018 — forked from Usse/distance.sql
MySQL calculate distance between two latitude/longitude coordinates
View distance.sql
CREATE FUNCTION `lat_lng_distance` (lat1 FLOAT, lng1 FLOAT, lat2 FLOAT, lng2 FLOAT)
RETURN 6371 * 2 * ASIN(SQRT(
POWER(SIN((lat1 - abs(lat2)) * pi()/180 / 2),
2) + COS(lat1 * pi()/180 ) * COS(abs(lat2) *
pi()/180) * POWER(SIN((lng1 - lng2) *
pi()/180 / 2), 2) ));
Created Jul 25, 2018
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
> * Used the license key
----- BEGIN LICENSE -----