Skip to content

Instantly share code, notes, and snippets.

@deehzee
deehzee / psycopg2_sshtunnel.py
Last active January 16, 2025 15:22
How to Connect To PostgreSQL Using SSHTunnelForwarder and Psycopg2
import psycopg2
from sshtunnel import SSHTunnelForwarder
# For interactive work (on ipython) it's easier to work with explicit objects
# instead of contexts.
# Create an SSH tunnel
tunnel = SSHTunnelForwarder(
('128.199.169.188', 22),
ssh_username='<username>',
@nicolasdao
nicolasdao / open_source_licenses.md
Last active November 27, 2025 22:24
What you need to know to choose an open source license.
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active December 8, 2025 10:50
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@anapsix
anapsix / rmq_passwd_hash.py
Created May 22, 2018 19:33
generate RabbitMQ compatible SHA256 password hash
#!/usr/bin/env python
# details on rabbitMQ password hashing
# https://www.rabbitmq.com/passwords.html#computing-password-hash
from __future__ import print_function
import base64
import os
import hashlib
import struct
import getpass
@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active December 5, 2025 16:21
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active December 5, 2025 10:58
set -e, -u, -o, -x pipefail explanation
@MIvanchev
MIvanchev / article.md
Last active November 6, 2025 01:00
Ever wondered what it takes to run Windows software on ARM? Then this article might be for you!
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active December 8, 2025 17:07
Conventional Commits Cheatsheet
@JoaoCarabetta
JoaoCarabetta / README.md
Last active August 24, 2024 11:16
Add Time Based Glue Partitions with Lambda AWS

Creates time based Glue partitions given time range.

Keep in mind that you don't need data to add partitions. So, you can create partitions for a whole year and add the data to S3 later.

@skyzyx
skyzyx / homebrew-gnubin.md
Last active December 5, 2025 17:36
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.