A collection of openssl commands arround certificates.
verify single certificate
openssl verify server.crt
| #!/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" |
| /** | |
| * 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') |
| 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) => { |
| const http = require('http') | |
| const logger = (req, res, next) => { | |
| const time = Date.now() | |
| res.on('finish', () => { | |
| const {method, url, headers, body} = req | |
| const {statusCode} = res | |
| console.log('%s %s %s %s %j %s', method, url, statusCode, Date.now() - time, headers, JSON.stringify(body)) | |
| }) | |
| next() |
| #!/bin/bash | |
| exe=$(cygpath -u "C:\Program Files (x86)\Geany\bin\geany.exe") | |
| args="" | |
| while (( "$#" )); do | |
| arg=$1 | |
| if [[ $arg == /* ]] ; then | |
| arg=\"$(cygpath -a -w "$arg")\" | |
| fi |
| #!/bin/bash | |
| # rotate scanned pdf pages by 180° | |
| # name all pages | |
| help=$(cat <<EOS | |
| Usage: rotate-pdf.sh IN.pdf OUT.pdf [PAGES] | |
| Read from IN.pdf, rotate PAGES by 180° and write out to OUT.pdf |
| #!/usr/bin/env bash | |
| # | |
| # From https://superuser.com/questions/109213/how-do-i-list-the-ssl-tls-cipher-suites-a-particular-website-offers | |
| # | |
| # Find cipher suites a website offers | |
| # | |
| # Usage | |
| # |
| #!/bin/bash | |
| # find all required packages in a directory | |
| # usage | |
| # findrequire src | |
| # findrequire src | xargs npm i -S | |
| # findrequire test | xargs npm i -D | |
| find $1 -iname "*.js" |\ | |
| xargs egrep -h "require\(['][^.]" |\ | |
| sed "s/.*require('\([^'']*\)').*/\1/g" |\ | |
| egrep -v "^(assert|child|cluster|events|dgram|dns|domain|fs|http|https|inspector|net|os|path|punnycode|querystring|readline|stream|string_decoder|tls|tty|udp4|url|util|v8|vm|zlib)$" |\ |
| const EventEmitter = require('events'); | |
| const random = () => ('' + Math.random()).substr(2) | |
| class Dispatcher extends EventEmitter { | |
| constructor () { | |
| super() | |
| this.token = `dispatch_${random()}` | |
| this.dispatch = this.dispatch.bind(this) | |
| } |