Docker.app will complain about incompatible processor, so we will use Docker Machine.
Download Docker for Mac (Docker.app). It contains some binaries that are necessary.
brew install virtualbox docker-machineThe default format of keys was changed in OpenSSL 1.0. From OpenSSL 1.0 change log:
Make PKCS#8 the default write format for private keys, replacing the traditional format. This form is standardised, more secure and doesn't include an implicit MD5 dependency. [Steve Henson]
Good explanations of the difference between the two formats: https://tls.mbed.org/kb/cryptography/asn1-key-structures-in-der-and-pem
Converting RSA private key:
| import express from 'express'; | |
| import { ApolloServer } from 'apollo-server-express'; | |
| import { ApolloServerPlugin } from 'apollo-server-plugin-base'; | |
| import * as Sentry from '@sentry/node'; | |
| Sentry.init({ | |
| environment: process.env.APP_ENV, | |
| // see why we use APP_NAME here: https://github.com/getsentry/sentry-cli/issues/482 | |
| release: `${process.env.APP_NAME}-${process.env.APP_REVISION}` || '0.0.1', | |
| dsn: process.env.SENTRY_DSN, |
| <html> | |
| <body> | |
| <form action="/upload" enctype="multipart/form-data" method="post"> | |
| <input type="text" name="title"> | |
| <input type="file" name="file"> | |
| <input type="submit" value="Upload"> | |
| </form> | |
| </body> | |
| </html> |
| Secure sessions are easy, but not very well documented. | |
| Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy: | |
| The desired configuration for using NginX as an SSL proxy is to offload SSL processing | |
| and to put a hardened web server in front of your Node.js application, like: | |
| [NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [PUBLIC INTERNET] <-> [CLIENT] | |
| Edit for express 4.X and >: Express no longer uses Connect as its middleware framework, it implements its own now. |
| #!/bin/sh | |
| # Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
| # CREATE block and create them in separate commands _after_ all the INSERTs. | |
| # Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
| # The mysqldump file is traversed only once. | |
| # Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
| # Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
| require 'net/http' | |
| require 'uri' | |
| def download(url) | |
| Thread.new do | |
| thread = Thread.current | |
| body = thread[:body] = [] | |
| url = URI.parse url | |
| Net::HTTP.new(url.host, url.port).request_get(url.path) do |response| |