Skip to content

Instantly share code, notes, and snippets.


James Rivett-Carnac yarbelk

View GitHub Profile
ageis /
Last active Feb 26, 2021
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate). I've published a Bash function which automates this slightly special key generation process.

ferrouswheel /
Last active Sep 22, 2017
Sphinx add-on to annotate Django models based on fields and their help_text. Based on - but adds ForeignKey resolution, and ensure is an actual model instead of a string.
import sys, os
local_path = lambda path: os.path.join(os.path.dirname(__file__), path)
... # Rest of goes here
yprez /
Last active Jul 22, 2020
Django rest framework - Base64 image field
import base64
from django.core.files.base import ContentFile
from rest_framework import serializers
class Base64ImageField(serializers.ImageField):
def from_native(self, data):
if isinstance(data, basestring) and data.startswith('data:image'):
# base64 encoded image - decode
avoine /
Created Mar 1, 2013
Fabric plugin for juju
# Mostly from django-fab-deploy
import os
import sys
from datetime import datetime
from subprocess import Popen, PIPE
import yaml
from fabric.api import env, run, sudo, task
adharris / postgres_array.go
Created Nov 28, 2012
PostgreSQL demo of Array types using Golang
View postgres_array.go
package main
import (
_ ""
kitsunde / gist:3665628
Created Sep 7, 2012
pytz working for Singapore
View gist:3665628
>>> import pytz
>>> from datetime import datetime
>>> time_zone = pytz.timezone('Asia/Singapore')
>>> my_time = datetime.utcnow()
>>> my_time
datetime.datetime(2012, 9, 7, 12, 6, 15, 56631)
>>> my_time.replace(tzinfo=pytz.utc)
datetime.datetime(2012, 9, 7, 12, 6, 15, 56631, tzinfo=<UTC>)
>>> my_time = my_time.replace(tzinfo=pytz.utc)
>>> my_time.astimezone(time_zone)
mtigas / gist:952344
Last active Feb 27, 2021
Mini tutorial for configuring client-side SSL certificates.
View gist:952344

Client-side SSL

For excessively paranoid client authentication.

Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes: