Skip to content

Instantly share code, notes, and snippets.

@gorsuch
gorsuch / gist:1070018
Created July 7, 2011 17:14
simple twisted ssh server w/o keys
from twisted.cred import portal, checkers, credentials
from twisted.conch import error, avatar, recvline, interfaces as conchinterfaces
from twisted.conch.ssh import factory, userauth, connection, keys, session, common
from twisted.conch.insults import insults
from twisted.application import service, internet
from zope.interface import implements
import os
class SSHDemoProtocol(recvline.HistoricRecvLine):
def __init__(self, user):
@gorsuch
gorsuch / sshcmd.rb
Created February 16, 2012 04:10
ruby remote ssh cmd example
require 'net/ssh'
server = 'mem.sysarcana.com'
user = 'root'
pass = 'password'
command = 'uptime'
Net::SSH.start(server, user, :password => pass) do |session|
stdout = ''
stderr = ''
@gorsuch
gorsuch / gist:46eb52f4c9cd43b5e3b9
Created June 6, 2015 15:47
golang streaming into bigquery
package main
import (
"encoding/json"
"log"
"time"
"code.google.com/p/goauth2/oauth/jwt"
bigquery "github.com/google/google-api-go-client/bigquery/v2"
)
@gorsuch
gorsuch / gist:1418850
Created December 1, 2011 18:37
clojure uuid
(defn uuid [] (str (java.util.UUID/randomUUID)))
@gorsuch
gorsuch / test.cs
Created June 16, 2010 14:52
Uploading to S3 via C#
using System;
using System.IO;
using System.Text;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
namespace AWSUploadTest
{
@gorsuch
gorsuch / value_discovery.md
Created March 24, 2018 21:10
a few values

outcomes

  • low cognitive overhead for the team
  • fast delivery for the org
  • reliable service for the org
  • safety for our customers

strategy

  • fewest moving parts possible
  • most boring tools possible
  • one-click, engineer-driven deployments

Keybase proof

I hereby claim:

  • I am gorsuch on github.
  • I am gorsuch (https://keybase.io/gorsuch) on keybase.
  • I have a public key ASDlUJpCMNiRElw6f74CtHmaUne5tOJKzkhwW14-52kIGAo

To claim this, I am signing this object:

@gorsuch
gorsuch / motion.py
Last active November 5, 2017 20:22
import boto3, logging, os
from datetime import datetime
from gpiozero import MotionSensor
from picamera import PiCamera
logging.basicConfig(level=logging.INFO)
camera = PiCamera()
pir = MotionSensor(4)
@gorsuch
gorsuch / gist:5aed15e45c90c9ad7d2d
Last active September 13, 2017 08:40
Example Serf client in go
package main
import (
"fmt"
"strconv"
"time"
"github.com/hashicorp/serf/client"
)
@gorsuch
gorsuch / ssh_fingerprint.rb
Created July 13, 2011 19:21
Generate an SSH fingerprint from an SSH key
require 'base64'
require 'digest/md5'
key = "your public key here"
# first decode the key
key_decoded = Base64.decode64(key)
# create an md5
md5 = Digest::MD5.hexdigest(key_decoded)
# convert that hash into a readable fingerprint