For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
| // file: index.js | |
| var _ = require("lodash"); | |
| var express = require("express"); | |
| var bodyParser = require("body-parser"); | |
| var jwt = require('jsonwebtoken'); | |
| var passport = require("passport"); | |
| var passportJWT = require("passport-jwt"); |
| import Sequelize from 'sequelize' | |
| import bcrypt from 'bcrypt-nodejs' | |
| import connection from '../config/db' | |
| require('sequelize-isunique-validator')(Sequelize) | |
| let User = connection.define('user', { | |
| firstName: { | |
| type: Sequelize.STRING(50), | |
| allowNull: false, |
| <?php | |
| /* | |
| * Mysql database class - only one connection alowed | |
| */ | |
| <?php | |
| class DB { | |
| private $connection; | |
| private static $_instance; |
A lot of people run into the problem of running Let's Encrypt's CertBot Tool and an NGINX on the same container host. A big part of this has to do with CertBot needing either port 80 or 443 open for the tool to work as intended. This tends to conflict with NGINX as most people usually use port 80 (HTTP) or 443 (HTTPS) for their reverse proxy. Section 1 outlines how to configure NGINX to get this to work, and Section 2 is the Docker command to run CertBot.
I use Docker Compose (docker-compose) for my NGINX server. My docker-compose.yml file looks something like this:
| import dateMixin from './mixins/date'; | |
| // Globally | |
| Vue.mixin(dateMixin); |
| #for not running docker, use save: | |
| docker save <dockernameortag> | gzip > mycontainer.tgz | |
| #for running or paused docker, use export: | |
| docker export <dockernameortag> | gzip > mycontainer.tgz | |
| #load | |
| gunzip -c mycontainer.tgz | docker load |
| curl -i -H 'Content-type: application/json' -H 'Authorization: key=<your_server_key>' -XPOST https://fcm.googleapis.com/fcm/send -d '{ | |
| "registration_ids":["registration_ids", "of the", "target", "devices as array"], | |
| "notification": { | |
| "title":"Title of your notification", | |
| "body":"content of your notification" | |
| }, | |
| "data": { | |
| "key1" : "value1", | |
| "key2" : "value2", | |
| "key3" : 23.56565, |
| window.resize = (function () { | |
| 'use strict'; | |
| function Resize() {} | |
| Resize.prototype = { | |
| init: function(outputQuality) { | |
| this.outputQuality = (outputQuality === 'undefined' ? 0.8 : outputQuality); | |
| }, |