Skip to content

Instantly share code, notes, and snippets.

@commenthol
commenthol / httpError.js
Created July 15, 2018 18:28
http error
const {STATUS_CODES} = require('http')
/**
* HTTP Error
* @param {Number} status - http status code
* @param {String|Error} msg - message or error
* @param {String} [code] - optional code
* @return {Error} error
*/
const httpError = (status = 500, msg, code) => {
@commenthol
commenthol / loopback-models.js
Created September 21, 2018 18:51
convert loopback yaml models to json
/**
* convert models-yaml/*.yaml file to models/*.json
*/
/* eslint no-console: off */
const yaml = require('js-yaml')
const {resolve, basename} = require('path')
const fs = require('fs')
#!/bin/bash
while read -r f
do
path=${f%/*}
file=${f##*/}
base=${file%%.*} # note needs $file
ext=${file#*.} # note needs $file
echo "$f ; $path ; $file ; $base ; $ext"

openssl & certificates

A collection of openssl commands arround certificates.

Verify certificates

verify single certificate

openssl verify server.crt