Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
-> The Band Red

Colten Krauter coltenkrauter

🎧
-> The Band Red
View GitHub Profile
@tomdaley92
tomdaley92 / .bash_profile
Last active Jan 21, 2021
My Bash set-up for MacOS
View .bash_profile
[ -r ~/.bashrc ] && . ~/.bashrc
@mort3za
mort3za / git-auto-sign-commits.sh
Last active Sep 17, 2021
Auto sign your git commits
View git-auto-sign-commits.sh
# 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
cezaraugusto / gpg_fix.txt
Last active Sep 11, 2021
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
kevinadi / mongodb-ssl.sh
Last active Aug 23, 2021
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
View mongodb-ssl.sh
#!/bin/sh
# 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`/emailAddress=kevinadi@mongodb.com"
# 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`/emailAddress=kevinadi@mongodb.com"
# Sign the server cert
@wader
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'
services:
traefik:
restart: unless-stopped
image: traefik
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
@ankurk91
ankurk91 / github_gpg_key.md
Last active Sep 15, 2021
Signing git commits using GPG (Ubuntu/Mac)
View github_gpg_key.md

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 https://brew.sh/
@jorgenschaefer
jorgenschaefer / logtest.py
Created Jul 5, 2016
Log a record with and without exception information
View logtest.py
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
filipechagas / remove-refind.sh
Created May 26, 2016
Removing REFIND from Mac
View remove-refind.sh
# Start on recovery mode
# Go on terminal
$ mount -t msdos /dev/disk0s1 /Volumes/ESP.
$ rm -rf /Volumes/ESP/efi/refind
# from http://www.rodsbooks.com/refind/installing.html#uninstalling
@vasanthk
vasanthk / System Design.md
Last active Sep 21, 2021
System Design Cheatsheet
View System Design.md

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
prograhammer / git-cheat-sheet.md
Last active Mar 28, 2021
Git cheat sheet for some useful Git commands and command scenarios.
View git-cheat-sheet.md

Git Cheat Sheet

Single Git Commands

Initialize a git repo in the current directory

# git init

Add a remote called "origin"

# git remote add origin https://github.com/your-username-here/your-repo-here.git