Skip to content

Instantly share code, notes, and snippets.

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

Maciej Łebkowski mlebkowski

🤷‍♀️
View GitHub Profile
@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.

@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:

<?php
final class ChargebeeCustomerEndpointTestDouble {
private array $customers = [];
public function givenCustomerExists(Customer $customer): void {
$this->customers[$customer->id] = $customer;
}
public function updateCustomer(CustomerId $id, CustomerChangePayload $change): void {
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
<meta charset="utf-8">
<div class="container-fluid">
<div class="row mt-5">
<div class="col">
<select class="form-control mb-2">
<option selected>IVXLCDM</option>
<option>🐶🦍🫎🦄🐽🐏🐬</option>
</select>
<input type="number" class=form-control max="3999" min=0>
@mlebkowski
mlebkowski / check-passwords.sh
Last active November 13, 2025 13:56
check your 1password vault against haveibeenpwned database
#!/usr/bin/env bash
OP_ACCOUNT="${OP_ACCOUNT:-my.1password.com}"
op() {
command op --account "$OP_ACCOUNT" "$@" --format=json
}
countids() {
echo $#
#!/usr/bin/env bash
main() {
declare account="$1" uuid="$2" field="${3:-password}"
/opt/homebrew/bin/op read --account "$account" "op://Employee/$uuid/$field"
}
main "$@"
#!/usr/bin/env bash
if [[ -z "$GITHUB_PRIVATE_KEY" || -z "$GITHUB_APP_ID" ]]; then
echo "Error: Required environment variables are not set." >&2
echo "Ensure GITHUB_PRIVATE_KEY and GITHUB_APP_ID are set." >&2
exit 1
fi
if [[ -f "$GITHUB_PRIVATE_KEY" ]; then
GITHUB_PRIVATE_KEY="$(cat "$GITHUB_PRIVATE_KEY")"
$icon-size: 16px;
$icon-sizes: (
sm: $icon-size / 1.5;
md: $icon-size;
lg: $icon-size * 1.5;
)
@mlebkowski
mlebkowski / acme-route53.awscfg
Created April 10, 2024 07:40
Local HTTPS and load balancing for docker compose projects
[default]
aws_access_key_id =
aws_secret_access_key =
From: Puck <[email protected]>
Newsgroups: alt.pl.fan.gopher
Subject: Re: Czy aby Hakiery :)) (fwd)
Date: Thu, 01 Aug 2002 09:13:42 +0200
Message-ID: <[email protected]>
Oto rezultat stukania w klawisze przez osobę, pragnącą być
identyfikowana jako "Adam `Gophi' Wysocki" <[email protected]>:
> > > Adam informuje Cie grzecznie, ze masz kurs do Gdanska.