Skip to content

Instantly share code, notes, and snippets.

View faisal-foyez's full-sized avatar

Faisal Islam faisal-foyez

View GitHub Profile
@faisal-foyez
faisal-foyez / Cookies.md
Last active February 19, 2023 03:11
Cookies in gist

Cookies with node example

Step 1 - Set a cookie

app.get('/setcookie', (req, res) => {
    res.cookie(`Cookie token name`,`encrypted cookie string Value`);
    res.send('Cookie have been saved successfully');
});

Step 2 - Using the req.cookies method to check the saved cookies

@faisal-foyez
faisal-foyez / README.md
Created February 1, 2023 00:30 — forked from dayitv89/README.md
Host multiple application on same server using nginx reverse proxy

Host multiple application on same server using nginx reverse proxy. This is highly cost saving technique for test servers or low request servers.

Note: Host server OS assume to be Ubuntu 18.04, below all config directory and command will on this linux flavour. You may use the diffent flavour thus config path and cmd may change. However core idea will be the same.

Step 1: As you need a single machine, where you install nginx on port 80.

And run your any language server say we have 4 websites as one in Ruby on Rails, second on nodejs and some are on php and golang. I started all application using their application server on different port as:

Ruby On Rails using Unicon: 3000 as => ror.server.com / rorserver.com

@faisal-foyez
faisal-foyez / ssh.md
Created January 26, 2023 01:27 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@faisal-foyez
faisal-foyez / node_nginx_ssl.md
Created January 26, 2023 01:26 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user