Skip to content

Instantly share code, notes, and snippets.


Colten Krauter coltenkrauter

View GitHub Profile
mort3za /
Last active Aug 4, 2022
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
cezaraugusto / gpg_fix.txt
Last active Aug 11, 2022
fixing `gpg failed to sign data` error on macOS
View gpg_fix.txt
For troubleshooting, two things to first try:
run `git config --global gpg.program gpg2`, to make sure git uses gpg2 and not gpg
run `echo "test" | gpg2 --clearsign`, to make sure gpg2 itself is working
If that all looks all right, one next thing to try:
run `brew install pinentry` to ensure you have a good tool installed for passphrase entry
If after that install and you re-try git commit and still get the "failed to sign the data" error:
run `gpgconf --kill gpg-agent` to kill any running agent that might be hung
kevinadi /
Last active Aug 7, 2022
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/"
# Sign the server cert
wader / docker-compose-traefik.yml
Last active Jan 15, 2019
traefik, docker, let's encrypt, http to https redirect
View docker-compose-traefik.yml
version: '2'
restart: unless-stopped
image: traefik
- "80:80"
- "443:443"
- /var/run/docker.sock:/var/run/docker.sock:ro
ankurk91 /
Last active Aug 13, 2022
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with
jorgenschaefer /
Created Jul 5, 2016
Log a record with and without exception information
import logging
class NoExceptionsFormatter(logging.Formatter):
def format(self, record):
record.message = record.getMessage()
if self.usesTime():
record.asctime = self.formatTime(record, self.datefmt)
return self._fmt % record.__dict__
filipechagas /
Created May 26, 2016
Removing REFIND from Mac
# Start on recovery mode
# Go on terminal
$ mount -t msdos /dev/disk0s1 /Volumes/ESP.
$ rm -rf /Volumes/ESP/efi/refind
# from
vasanthk / System
Last active Aug 18, 2022
System Design Cheatsheet
View System

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
prograhammer /
Last active Aug 13, 2022
Git cheat sheet for some useful Git commands and command scenarios.
j8 / git_empty_branch
Created Feb 14, 2014
Create new branch with empty folder structure
View git_empty_branch
You can create a new empty branch like this:
$ git checkout --orphan NEWBRANCH
--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch.
Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory: