Skip to content

Instantly share code, notes, and snippets.

View t-h-e-chieftain's full-sized avatar

Andrew Cowan t-h-e-chieftain

View GitHub Profile
@phortuin
phortuin / signing-git-commits.md
Last active February 15, 2026 03:59
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@tuxfight3r
tuxfight3r / kcat.md
Last active July 7, 2025 16:25
KafkaCat configuration for AWS MSK

KafkaCat Configuration for AWS MSK

Set the below environment variable with the following values

NOTE: Kafkacat is renamed to kcat recently and the config variable should be KCAT_CONFIG for version 1.7 onwards.

# you can export the variable or present the config with -F parameter for kafkacat
export KAFKACAT_CONFIG=/home/tools/persistent/kcat/kafkacat_config

Contents of kafkacat configuration

@alexlopes
alexlopes / kafka_python_sasl_scram.py
Last active December 25, 2024 10:37
Kafka Python with SASL/SCRAM Authentication Example
import os
from kafka import KafkaProducer, KafkaConsumer
BOOTSTRAP_SERVERS=os.gentenv("KAFKA_BOOTSTRAP_SERVERS").split(",")
TOPIC_NAME="the-topic"
SASL_USERNAME=os.gentenv("KAFKA_SASL_USERNAME")
SASL_PASSWORD=os.gentenv("KAFKA_SASL_PASSWORD")
def consume():
consumer = KafkaConsumer(TOPIC_NAME, security_protocol="SASL_SSL", sasl_mechanism="SCRAM-SHA-512", sasl_plain_username=SASL_USERNAME, sasl_plain_password=SASL_PASSWORD, bootstrap_servers=BOOTSTRAP_SERVERS)
@lotharschulz
lotharschulz / PublishingArtifactsWithAWSCodeartifactAndGitHubPackages.md
Last active August 15, 2024 16:12
How to publish software artifacts with AWS Codeartifact and GitHub Packages
@DzeryCZ
DzeryCZ / ReadingHelmResources.md
Last active February 24, 2026 00:10
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
@kavimaluskam
kavimaluskam / aws-msk-cli.sh
Last active December 11, 2022 10:04
Cheat sheet for AWS MSK CLI
# Assign 1 public subnetID from above subnet setup
SUBNET_ID=${subnetID}
# List all kafka cluster for corrsponding region
aws kafka list-clusters --region us-east-1
# Expected output
# {
# "ClusterInfoList": [
# {
@isanosian
isanosian / Docker-debug
Created September 27, 2018 13:00 — forked from dainis-boumber/Docker-debug
Setup PyCharm IDE to remote debug code inside a Docker container using ssh
## IMPORTANT:
# Should work for any IDE that supports ssh but only tested on PyCharm
# These instructions are for systemd OS (Ubuntu 16.04 and up, Debian).
# For systems running upstart like 14.04, modify /etc/default/docker by adding DOCKER_OPTS
#
#
#
## First, we need to get Docker to accept ssh connections:
#
## Open /lib/systemd/system/docker.service
@obskyr
obskyr / stream_response.py
Last active January 1, 2025 14:46
How to stream a requests response as a file-like object.
# -*- coding: utf-8 -*-
import requests
from io import BytesIO, SEEK_SET, SEEK_END
class ResponseStream(object):
def __init__(self, request_iterator):
self._bytes = BytesIO()
self._iterator = request_iterator