Skip to content

Instantly share code, notes, and snippets.

View stevvooe's full-sized avatar

Stephen Day stevvooe

View GitHub Profile
@stevvooe
stevvooe / README.md
Last active November 28, 2018 07:22
Reproduce tar incompatibility between Go 1.8 and Go <= 1.7

Go Tar incompatibility

This gist demonstrates a bug in Go's archive/tar handling of tar files. Under certain conditions, tar files generated with Go 1.7 and before cannot be correctly read with Go 1.8+. While first encountered in Docker, which makes heavy use of tar files, this gist attempts to make a minimal reproduction without the Docker code base.

To reproduce this, you'll need respective versions of Go installed in /usr/local/go1.7.6 and /usr/local/go1.8.3. Other methods of version

@stevvooe
stevvooe / config-minimal.yml
Last active January 21, 2016 20:24
Minimal Registry Configuration
version: 0.1
log:
level: debug
fields:
service: registry
storage:
delete:
enabled: true
http:
addr: :5000
@stevvooe
stevvooe / ssh.go
Created December 15, 2015 22:29
Simple SSH Client
// Package main implements a simple ssh client, roughly similar to the
// standard OpenSSH client. It uses golang.org/x/crypto/ssh and integrates
// with the ssh agent.
//
// Mostly, this demonstrates correct resource management and cleanup, as well
// as command dispatch. Obviously, this has never been vetted for security, so
// please don't use for anything serious.
package main
import (
@stevvooe
stevvooe / gist:12e63e5f902b5ba7ec01
Last active August 29, 2015 14:13
Full panic trace - #10228
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x78154a]
goroutine 92 [running]:
bufio.(*Writer).flush(0xc208208900, 0x0, 0x0)
/usr/local/go/src/bufio/bufio.go:530 +0xda
bufio.(*Writer).Flush(0xc208208900, 0x0, 0x0)
/usr/local/go/src/bufio/bufio.go:519 +0x3a
net/http.(*response).Flush(0xc2085bfae0)
/usr/local/go/src/net/http/server.go:1047 +0x4c
@stevvooe
stevvooe / keybase.md
Created November 4, 2014 00:25
keybase.md

Keybase proof

I hereby claim:

  • I am stevvooe on github.
  • I am stevvooe (https://keybase.io/stevvooe) on keybase.
  • I have a public key whose fingerprint is F561 E20B 31B7 CCC0 2A9A 524E FB5F 6B29 05D7 ECF3

To claim this, I am signing this object:

@stevvooe
stevvooe / client.py
Created August 23, 2011 08:15
A minimal python to go json-rpc implemention, sans HTTP
import json
import socket
s = socket.create_connection(("127.0.0.1", 5090))
s.sendall(json.dumps(({"id": 1, "method": "Hello.Hello", "params": ["hello"]})))
print s.recv(4096)