Skip to content

Instantly share code, notes, and snippets.

View pancudaniel7's full-sized avatar
🎯
Focusing

Daniel pancudaniel7

🎯
Focusing
View GitHub Profile
@pancudaniel7
pancudaniel7 / 1-setup.md
Created November 19, 2024 11:26 — forked from troyfontaine/1-setup.md
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@pancudaniel7
pancudaniel7 / docker_clean.sh
Last active December 3, 2024 10:02
Docker clean bash function
#!/bin/bash
# define the function
function docker_clean {
echo "Start cleaning..."
process_count=$(docker ps -q | wc -l)
if [ "$process_count" -ne "0" ]; then
docker kill $(docker ps -q) > /dev/null
echo "$process_count process/es had been clean"
@pancudaniel7
pancudaniel7 / decode_jwt.sh
Last active February 25, 2025 15:21
Decode JWT + convert timestamp to date
# You can add this to your .bashrc or .zshrc
function decode_jwt {
echo "$1" | jq -R '
split(".") |
.[1] |
gsub("-"; "+") | gsub("_"; "/") | @base64d |
fromjson |
(if .iat then .iat = (.iat | todate) else . end) |
(if .exp then .exp = (.exp | todate) else . end)