Skip to content

Instantly share code, notes, and snippets.

View mlebkowski's full-sized avatar
🤷‍♀️

Maciej Łebkowski mlebkowski

🤷‍♀️
View GitHub Profile
@mlebkowski
mlebkowski / 0. readme.md
Created March 31, 2026 08:56
Unix shell password or passphrase generator in pure bash

Unix shell passphrase generator

Usage

$ passphrase
thorn-dawn-scythe-shuttle-diploma-leisure

You can change the number of parts by providing an argument:

@mlebkowski
mlebkowski / 0. public-key-to-json.md
Last active April 17, 2026 13:23
Parse RSA/ECDSA public key PEM into ASN1 JSON representation in pure bash

Parse PEM public keys into JSON

openssl already provides two ways of reading public keys in PEM format:

  • openssl ec -pubin -text -noout -in key.pem
  • openssl asn1parse < key.pem

Unfortunately, both provide text output which is hard to parse and use in an automated manner. This script provides a third way, and the output is structured JSON, using pure bash. See examples below.