Skip to content

Instantly share code, notes, and snippets.

@c0m1c5an5
c0m1c5an5 / inline.py
Created June 9, 2026 14:13
Python rewrite of carlocorradini/inline
#!/usr/bin/env python3
"""Inline bash `source` / `.` directives into a single script."""
import argparse
import logging
import re
import shutil
import sys
from pathlib import Path
from typing import Optional
@c0m1c5an5
c0m1c5an5 / extract_gpg_key.py
Created May 8, 2026 09:03
Back up trezor agent ssh/gpg keys
#!/usr/bin/env python3
"""
Required packages:
ecdsa
pynacl
trezor
unidecode
Extract plaintext GPG / SSH private keys derived by Trezor, for offline backup.
@c0m1c5an5
c0m1c5an5 / README.md
Last active March 19, 2025 18:28
Git wrapper to allow semantic-release to work when HEAD is behind remote.

I highly recommend using python-semantic-release instead. It provides full control over the release creation and does not have roadblocks in place preventing you from using it on non-latest commits. Still, if using semantic-release is a must, above scripts provide the means to do so.

@c0m1c5an5
c0m1c5an5 / slugify.sh
Last active April 28, 2025 15:12
GitLab CI Slugify Implementation Pure Bash
# Implementation of https://gitlab.com/gitlab-org/gitlab/-/blob/master/gems/gitlab-utils/lib/gitlab/utils.rb#L56
slugify() {
local reply
unset REPLY ERR
reply="${*,,}"
reply="${reply//[^a-z0-9]/-}"
reply="${reply:0:63}"
while [[ ${reply} == -* ]]; do reply="${reply#-}"; done
while [[ ${reply} == *- ]]; do reply="${reply%-}"; done