Skip to content

Instantly share code, notes, and snippets.

View aurynn's full-sized avatar

Aurynn Shaw aurynn

View GitHub Profile
@aurynn
aurynn / write_only_swift.tf
Created March 26, 2020 03:16
write-only-swift
# This will provide write access, but not list or read access
resource "openstack_objectstorage_container_v1" "test" {
name = "test-container"
container_read = ".r:-${var.service_username}"
container_write = "${var.project_id}:${var.service_username}"
}
@aurynn
aurynn / gist:10081067
Created April 8, 2014 01:33
stdio protocol
class StdioProtocol(LineReceiver):
from os import linesep as delimiter
def connectionMade(self):
self.connected = True
def __init__(self, wire):
self.chat = wire
wire.output = self
from pyparsing import Word, Literal, alphas, alphanums, stringStart, ParserElement, ZeroOrMore,OneOrMore, Forward, Dict, Group, pythonStyleComment, lineStart, lineEnd, FollowedBy, dictOf, oneOf, NotAny, Regex
import re
DEBUG=True
ce = """custom_tooltip = {
fail_text = INVALID_RIVAL_DESC
is_country_type = default
}
"""
@aurynn
aurynn / gist:10023139
Last active November 2, 2017 17:51
Simple JSON client 2
from twisted.internet.protocol import Factory
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet import reactor
from twisted.protocols.basic import LineReceiver
import json
your_name = "aurynn"
class JsonProtocol(LineReceiver):
@aurynn
aurynn / gist:10023104
Created April 7, 2014 15:59
Simple JSON client 1
from twisted.internet.protocol import Factory
from twisted.protocols.basic import LineReceiver
import json
your_name = "aurynn"
class JsonProtocol(LineReceiver):
def lineReceived(self, msg):
try:
@aurynn
aurynn / gist:10309576
Created April 9, 2014 20:11
echo rpc client
# Shamelessly stolen from the Twisted site
from twisted.internet import protocol, reactor, defer, stdio
from twisted.protocols.basic import LineReceiver
from twisted.internet.endpoints import TCP4ClientEndpoint, connectProtocol
import json
class JsonEchoClient(LineReceiver):
from twisted.internet import stdio, protocol, reactor
from twisted.protocols.basic import LineReceiver
import json
class myProtocol(LineReceiver):
def connectionMade(self):
# self.sendLine(json.dumps({"name": "aurynn", "message":"hello"}))
self.io.getNetwork(self)
def lineReceived(self, data):
# Do some stuff w/ the data
from twisted.internet import protocol, reactor
from twisted.protocols.basic import LineReceiver
import json
class myProtocol(LineReceiver):
def lineReceived(self, data):
# Do some stuff w/ the data
# p = json.loads(data)
self.transport.write("Hi!")
from twisted.internet import protocol, reactor
from twisted.protocols.basic import LineReceiver
class myProtocol(LineReceiver):
def lineReceived(self, data):
# Do some stuff w/ the data
p = json.parse(data)
self.doStuff(p)
def saySomething(self, message):
self.sendLine(
znc::user{"aurynn":
admin => 'true',
ssl => 'true',
quitmsg => 'Taste the Rainbow.',
ident => 'skittles',
realname => "Very real.",
timezone => "Pacific/Auckland",
}