Skip to content

Instantly share code, notes, and snippets.

@barrowkwan
barrowkwan / custom_keys_git_ssh
Created Jul 12, 2020 — forked from vhermecz/custom_keys_git_ssh
Allow configuring multiple ssh deploy keys with git
View custom_keys_git_ssh
#!/bin/bash
# Script to use custom ssh keys for various git repositories
# Run without arguments to get usage info.
#
# How it works:
# When used with SSH, git sends the path to the repository in the SSH command.
# @see: https://github.com/git/git/blob/e870325/connect.c#L1268
# We extract this info and search for a key with the name.
# Based on the source, this seems to be used format since v2.0 at least.
# @see: https://github.com/git/git/commit/a2036d7
@barrowkwan
barrowkwan / gencert.go
Created Jan 6, 2019 — forked from samuel/gencert.go
Generate a self-signed certificate in Go
View gencert.go
package main
import (
"bytes"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"