Skip to content

Instantly share code, notes, and snippets.

View isarojdahal's full-sized avatar
:electron:
Learning Everyday

Saroj Dahal isarojdahal

:electron:
Learning Everyday
View GitHub Profile
@sjosephrw
sjosephrw / mern_nginx_ssl_digitalocean.md
Last active March 29, 2025 09:15
Deploy Multiple MERN apps to a single digital ocean ubuntu droplet with nginx and SSL

Deploy Multiple MERN apps to digital ocean

This tutorial will guide you through the process of deploying multiple MERN apps to a single digital ocean ubuntu VPS droplet Reference

1. Sign up for Digital Ocean

DigitalOcean

2. Create a droplet and Login via SSH

YouTube

/* Program to find probability for rolling of two dies for getting sums of die faces which are either less than or greater than or equal to given number */
const validateData = (input) => {
const result = input.match(/^[<|>|=][1-6]$/);
return result != null ? true : false;
};
const checkProbability = (sign, number) => {
let resultList = [];
let noOfExhaustiveEvent = 0; // this means our favorable event.
@bradtraversy
bradtraversy / mern-server-setup.md
Last active April 17, 2025 05:39
Setup Ubuntu & Deploy MERN app

Linux Server Setup & MERN App Deployment

These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.

Create an account at Linode

Click on Create Linode

Choose your server options (OS, region, etc)

SSH Keys

@isarojdahal
isarojdahal / gist:0ebf3ce61aa143bce638caf97c216a1a
Last active February 8, 2024 10:59
Basic Postgres commands
(JUST IN case : / => frontslash, \ => backslash)
Check postgres version:
psql --version
Connect to postgres:
psql -U postgres
(the postgres user is default superuser for the postgresSQL)
# or the above error showed any socket / Peer Authentication error; then use this;