Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View thurloat's full-sized avatar

Adam Thurlow thurloat

View GitHub Profile
@thurloat
thurloat / keybase.md
Created April 10, 2017 12:38
Keybase Proof

Keybase proof

I hereby claim:

  • I am thurloat on github.
  • I am thurloat (https://keybase.io/thurloat) on keybase.
  • I have a public key ASBVMGI-W6JvS5r18B-Sw3CVYO2gC5ym44VixMFPS8urNwo

To claim this, I am signing this object:

containerkeys v1 auth with Duplicity, tested with a local swift AIO install /w middleware installed.

$ export SWIFT_USERNAME="test:testcontainer:Full-Key"
$ export SWIFT_PASSWORD="mykeyiscool"
$ export SWIFT_AUTHURL="http://192.168.122.95:8080/keys_auth/"
$ export SWIFT_AUTHVERSION="1"

$ duplicity --no-encryption containerkeys swift://testcontainer
Local and Remote metadata are synchronized, no sync needed.
@thurloat
thurloat / test_off.sh
Created March 3, 2015 14:36
demo manual offline snapshot in openstack
#!/bin/bash
# ./test_off.sh <uuid> <snap_name>
uuid=$1
snapname=$2
nova stop $uuid
while true; do
status=$(nova show $uuid | grep vm_state | awk '{ print $4 }')
@thurloat
thurloat / generate_temp_url.py
Last active November 11, 2017 02:24
BulkStorage API Examples
import hmac
from hashlib import sha1
from time import time
method = 'GET'
duration_in_seconds = 60*60*24
expires = int(time() + duration_in_seconds)
path = '/v1/AUTH_{{ tenant_id }}/my_container/my_object'
key = 'qwertyuiopoiuytrewq'
s = 'https://{host}:8443/{path}?temp_url_sig={sig}&temp_url_expires={expires}'
@thurloat
thurloat / private.xml
Created April 25, 2013 15:16
hyper key == right cmd
<autogen>
--KeyToKey--
KeyCode::COMMAND_R,
KeyCode::COMMAND_L,
ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L
</autogen>
@thurloat
thurloat / views.py
Last active December 16, 2015 02:58
Super basic google oauth login /w email using sanction
from django import http
from django.core.urlresolvers import reverse
from django.views.generic.base import TemplateView
from sanction.client import Client
class MainView(TemplateView):
def dispatch(self, request, *args, **kwargs):
if not request.session.get('email'):
@thurloat
thurloat / underscore_mixins.js
Created April 10, 2013 15:38
django / jinja style underscore templates
/**
* Custom Underscore.js _.template settings to make it behave more like the
* django & jinja style templates that we're used to writing.
*
* {{ variable }} - prints into the template
* {% evaluation %} - inserts some JS to evaulate into the template.
*
* example:
*
* {% _.each(paragraphs, function(paragraph) { %}
@thurloat
thurloat / chats.py
Created February 27, 2013 19:33
Migrate your chat history from one gmail account to the next
#!/usr/bin/env python
# Don't forget to enable the Chat label in the source account as visible to IMAP.
import getpass
from imapclient import IMAPClient
def main():
s_username = raw_input("Source Email: ")
s_password = getpass.getpass(prompt="Source Password: ")
@thurloat
thurloat / svnstash.sh
Created January 30, 2013 20:07
svn stash, like git?
# named svn stashes.
# ex: svn_stash foo -- stashes all changes in a patch named .stash-foo
# ex2: svn_stash pop foo -- patches the foo stash back onto svn.
function svn_stash() {
if [ -z "$1" ]
then
echo "Missing stash name argument"
else
if [ "$1" == "pop" ]
then
@thurloat
thurloat / languages.txt
Created January 30, 2013 13:38
Languages that I have done something in (more than a hack on, or one liner)
C#
C
Obj-C
batch
tcl
lua
visual basic
VB.NET
vbscript
actionscript