Directories on host machine:
-
/data/certbot/letsencrypt -
/data/certbot/www -
Nginx server in docker container
docker run -d --name nginx \
| const VietQR = require("./vietQR"); | |
| const vietQR = new VietQR(); | |
| vietQR | |
| .setBeneficiaryOrganization("970423", "mynamebvh") | |
| .setTransactionAmount("50000") | |
| .setAdditionalDataFieldTemplate("test"); | |
| console.log(vietQR.build()); |
| version: "3.9" | |
| services: | |
| db: | |
| image: bitnami/postgresql:14.1.0 | |
| ports: | |
| - '5433:5432' | |
| environment: | |
| POSTGRESQL_USERNAME: postgres | |
| POSTGRESQL_PASSWORD: 123123123 | |
| POSTGRESQL_DATABASE: abc |
| const { Pool } = require("pg"); | |
| const connectionString = process.env.db_uri || "postgres://localhost:5432/postgres"; | |
| const pool = new Pool({ connectionString }); | |
| function Locker(key, timeout, retryCount) { | |
| this.key = key; | |
| this.timeout = timeout || 200; | |
| this.retryCount = retryCount || 5; | |
| this.getClient = getClient; | |
| this.aquireLock = aquireLock; |
Directories on host machine:
/data/certbot/letsencrypt
/data/certbot/www
Nginx server in docker container
docker run -d --name nginx \
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
| const nodeRSA = require('node-rsa'); | |
| /** | |
| * return the decrypted Data (RSA OAEP Encryption) | |
| * @param {string} RSAPrivateKey | |
| * @param {string} EncrypteDataBuffer | |
| * @returns {string} Data decrypted data | |
| */ | |
| var RSA_OAEP_Decrypt = function(RSAPrivateKey, EncrypteDataBuffer){ | |
| // Demonstrate https://stackoverflow.com/questions/54781538/node-elasticsearch-bulk-index-fails-silently | |
| const elasticsearch = require('elasticsearch'); | |
| const elastic = new elasticsearch.Client({ | |
| host: `localhost:9200` | |
| }); | |
| const inputArray = [ | |
| { | |
| "index": { | |
| "_index": "test-2019.02.19" |
| package ciphers | |
| import ( | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/sha512" | |
| "crypto/x509" | |
| "encoding/pem" | |
| "log" | |
| ) |