This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// return largest sum of an edge from given binary tree | |
// out - 2,1, 12,10 = 25 | |
const tree = { | |
value: 2, | |
leftNode: { | |
value: 1, | |
leftNode: { | |
value: 12, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use docker compose for running server and passing env files | |
// create a network before running nginx container | |
docker network create --driver bridge reverse-proxy | |
// then run nginx container | |
docker run -d -p 80:80 -p 443:443 \ | |
--name nginx-proxy \ | |
--net reverse-proxy \ | |
-v $HOME/certs:/etc/nginx/certs:ro \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# make script executable first with chmod +x scriptname | |
# Bash script for generating new subdomain with a new server block(nodejs by default) in Nginx. | |
# syntax - ./{scriptname} subDomainName mainDomainName PORT | |
# note - needs certbot enabled for letsencrypt | |
# Functions | |
ok() { echo -e '\e[32m'$1'\e[m'; } # Green |