Skip to content

Instantly share code, notes, and snippets.

Adam Thurlow thurloat

Block or report user

Report or block thurloat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

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:

View containerkeys.md

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 Mar 3, 2015
demo manual offline snapshot in openstack
View test_off.sh
#!/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 Nov 11, 2017
BulkStorage API Examples
View generate_temp_url.py
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 Apr 25, 2013
hyper key == right cmd
View private.xml
<autogen>
--KeyToKey--
KeyCode::COMMAND_R,
KeyCode::COMMAND_L,
ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L
</autogen>
@thurloat
thurloat / views.py
Last active Dec 16, 2015
Super basic google oauth login /w email using sanction
View views.py
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 Apr 10, 2013
django / jinja style underscore templates
View underscore_mixins.js
/**
* 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 Feb 27, 2013
Migrate your chat history from one gmail account to the next
View chats.py
#!/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 Jan 30, 2013
svn stash, like git?
View svnstash.sh
# 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 Jan 30, 2013
Languages that I have done something in (more than a hack on, or one liner)
View languages.txt
C#
C
Obj-C
batch
tcl
lua
visual basic
VB.NET
vbscript
actionscript
You can’t perform that action at this time.