Skip to content

Instantly share code, notes, and snippets.

View RickCogley's full-sized avatar
👻
Slowly but surely implementing ISO 27001 ISMS

Rick Cogley RickCogley

👻
Slowly but surely implementing ISO 27001 ISMS
View GitHub Profile
@bmhatfield
bmhatfield / .profile
Last active January 29, 2025 11:11
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@omegahm
omegahm / create_labels.sh
Created April 7, 2015 19:00
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
@wbsch
wbsch / on-exit_git.py
Last active November 16, 2020 15:33
Proof of concept for a Taskwarrior on-exit hook that manages a git repository in ~/.task
#!/usr/bin/env python
#
# PoC: Manage a git repository in ~/.task that gets updated on changes.
# Only pending.data and completed.data are included by default.
# You can use "git add" to add whatever files you want to track in your
# task folder.
#
# Inspired by https://gist.github.com/Unode/9366218
#
# Works with any Taskwarrior version that supports hooks.
@andreas
andreas / envelope_encryption.go
Created February 3, 2015 19:25
Envelope Encryption with Amazon KMS and Go
package main
import (
"bytes"
"crypto/rand"
"encoding/gob"
"fmt"
"io/ioutil"
"os"
"time"
@maczniak
maczniak / gist:f1e36861c69b0654903a
Last active April 2, 2016 04:22
Markdown Syntax

used in Gist, comments, issues, pull requests and .md and .markdown extension files.

standard Markdown (SM)

  • paragraphs are separated by one or more blank lines
  • heading from # to ######
  • blockquote >
  • bold <strong> ** or __
  • italic <em> * or _
  • unordered list * or -
<?php
// credential to access github, you should choose between username/password authentication or token (for two step verification accounts)
$githubUser = 'YOURGITHUBUSER';
$githubPasswd = 'YOURGITHUBPASSWD';
// or
//$githubToken = 'YOURGITHUBTOKEN';
$githubOrganization = 'YOURGITHUBORGANIZATION';
@dupuy
dupuy / keybase.md
Created October 6, 2014 14:17
My keybase.io proof

Keybase proof

I hereby claim:

  • I am dupuy on github.
  • I am dupuy (https://keybase.io/dupuy) on keybase.
  • I have a public key whose fingerprint is BBE8 C56A 9FCB 1F81 9C79 9D7B 208B 8A8B EC87 905D

To claim this, I am signing this object:

@pkoppstein
pkoppstein / combine.jq
Last active August 5, 2021 02:13
a commutative and associative operator for combining two JSON objects
# This gist defines a jq filter for combining two JSON objects by resolving conflicts
# in a way that is appropriate for mapping relational tables to objects.
# "combine" as defined here is both commutative and associative.
# Example:
# { "id": 123, "son": "Son1", "surname": "S"}
# | combine({ "id": 123, "son": "Son2", "surname": "S"})
# produces: { "id": 123, "son": ["Son1",Son2], "surname": "S"}
# Combine two entities in an array-oriented fashion.
@mperham
mperham / gist:5f492a2233ed44d1bb2b
Last active April 16, 2024 12:31
Golang high-level crypto APIs

Go has a number of low-level crypto APIs which check off marketing bullet-points (got FIPS supprt, check!) but is missing an high-level API usable by mere mortal programmers. Imagine you want to create a document, sign it and verify that document later. Now check out Go's crypto APIs and give up in frustration after an hour of Googling.

The API should encapsulate a half-dozen common operations and make them as easy as possible. Avoid choice where possible, just pick something reasonably secure in 2014 for me and use it! I'm speaking specifically of a few basic actions (yes, this API is very naive/non-idiomatic), call it crypto/easy:

  • Create me a public/private key pair and save it to the filesystem.
// create and persist a keypair to the current directory.
// this is just a one-time operation, now we have a keypair to use.
easy.CreateKeyPair()
@romainl
romainl / deprecation.md
Last active February 24, 2022 02:42
Idiomatic vimrc