Skip to content

Instantly share code, notes, and snippets.

View hpherzog's full-sized avatar

Hans-Peter Herzog hpherzog

  • Ludwigshafen, Germany
View GitHub Profile
@hpherzog
hpherzog / self-signed-certificate-with-custom-ca.md
Created August 29, 2018 22:17 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@hpherzog
hpherzog / create-certificate.sh
Created February 16, 2018 18:57
Create self signed ssl certificate including subjectAltName
openssl req -x509 -nodes -days 730 -newkey rsa:2048 -keyout key.pem -out cert.pem -config openssl.conf -extensions 'v3_req'
@hpherzog
hpherzog / 0_reuse_code.js
Created January 4, 2017 14:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hpherzog
hpherzog / clean-docker-images
Created August 3, 2016 13:25
Remove all none tagged docker images
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2 > /dev/null
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2 > /dev/null
@hpherzog
hpherzog / config.js
Created February 24, 2016 18:52
Config loader
var fs = require('fs');
module.exports.load = function(options) {
options = options || {};
var basePath = options.basePath || './config';
var env = options.env || 'development';
@hpherzog
hpherzog / .editorconfig
Last active September 1, 2016 08:29
Editor config defaults
root = true
[*.{js,ts,json,html,css,scss,less,md,gitignore,editorconfig}]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@hpherzog
hpherzog / js-crypto-libraries.md
Created January 7, 2016 15:49 — forked from jo/js-crypto-libraries.md
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

I start with a list and plan to create a comparison table.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@hpherzog
hpherzog / require-ensure.js
Created September 23, 2015 18:46
webpack require.ensure shim to use in node.js
if(typeof(require.ensure) !== "function")
{
require.ensure = function(modules, callback)
{
callback(require);
}
}
@hpherzog
hpherzog / jessie-mongodb-3-0-x.sh
Created September 13, 2015 11:34
Install mongodb version 3.0.x on debian jessie
#!/bin/sh
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
apt-get update
apt-get install -y mongodb-org
@hpherzog
hpherzog / jessie-node-0-10-x.sh
Last active September 13, 2015 12:30
Install node.js version 0.10.x on debian jessie
#!/bin/sh
curl --silent --location https://deb.nodesource.com/setup_0.10 | bash -
apt-get -y install nodejs