Skip to content

Instantly share code, notes, and snippets.

Avatar

Sean McCullough mcculloughsean

  • Groupon
  • San Francisco, CA
View GitHub Profile
View gist:7d14fcebf35ef366e892
-- Unit dcos-setup.service has begun starting up.
Oct 29 22:10:17 pst-dcos-gru1.snc1 pkgpanda[6024]: Calculated active packages from bootstrap tarball
Oct 29 22:10:17 pst-dcos-gru1.snc1 pkgpanda[6024]: Checking for cluster packages in: /etc/mesosphere/setup-flags/cluster-packages.json
Oct 29 22:10:17 pst-dcos-gru1.snc1 pkgpanda[6024]: Loading cluster-packages: ['dcos-config--setup_6478fc9924de5520275200cd49cb7aec3633c26d', 'dcos-detect-ip--
Oct 29 22:10:17 pst-dcos-gru1.snc1 pkgpanda[6024]: DEBUG: https://downloads.mesosphere.com/dcos/testing/pull/185 dcos-config--setup_6478fc9924de5520275200cd4
Oct 29 22:10:17 pst-dcos-gru1.snc1 pkgpanda[6024]: Traceback (most recent call last):
Oct 29 22:10:17 pst-dcos-gru1.snc1 pkgpanda[6024]: File "/opt/mesosphere/bin/pkgpanda", line 9, in <module>
Oct 29 22:10:17 pst-dcos-gru1.snc1 pkgpanda[6024]: load_entry_point('pkgpanda==0.8', 'console_scripts', 'pkgpanda')()
Oct 29 22:10:17 pst-dcos-gru1.snc1 pkgpanda[6024]: File "/opt/mesosphere/lib/python3.4/site-packages/pkgpand
View gist:3d7336222f5ebc16da90
☁ ~ etcdctl -v
etcdctl version 0.4.6
☁ ~ ETCDCTL_PEERS="http://192.168.59.103:4001" etcdctl --debug ls
Cluster-Peers: http://127.0.0.1:4001
Curl-Example: curl -X GET http://127.0.0.1:4001/v2/keys/?consistent=true&recursive=false&sorted=false
Curl-Example: curl -X GET http://127.0.0.1:4001/v2/keys/?consistent=true&recursive=false&sorted=false
Error: 501: All the given peers are not reachable (Tried to connect to each peer twice and failed) [0]
☁ ~ etcdctl --debug --peers http://192.168.59.103:4001 ls
Cluster-Peers: http://127.0.0.1:4001
Curl-Example: curl -X GET http://127.0.0.1:4001/v2/keys/?consistent=true&recursive=false&sorted=false
View keybase.md

Keybase proof

I hereby claim:

  • I am mcculloughsean on github.
  • I am mcculloughsean (https://keybase.io/mcculloughsean) on keybase.
  • I have a public key whose fingerprint is D7B6 5D65 A2DA DE4C DA4E 1B2D 90C2 AABC 36D9 027A

To claim this, I am signing this object:

View docker_remote_api_proposal.md

Refactoring Docker Remote API Client

What's wrong

The docker remote api isn't easy to use because:

  • There's no official client to the API
  • Much of the validation the CLI provides is in the CLI code, not the API layer
  • The documentation doesn't always show a proper mapping of CLI commands to API calls (e.g. docker run involves multiple steps)
  • The CLI code is cluttered with many concerns and makes understanding how to use the API properly by example difficult
@mcculloughsean
mcculloughsean / a.md
Last active Aug 29, 2015
Implementing an event bus proxy in node and go
View a.md

Event Bus Proxy

Create a server that handles periodic POST requests from another service.

Clients can connect to this server and poll for events using Transfer-Encoding: chunked. Events that are POSTed to the server are returned to the polling clients as individual chunks.

The Node implementation works as expected.

I can't figure out how to get the Go implementation to work correctly. The response is closed after the goroutine declaration finishes. I think this will work if I can figure out how to defer closing the connection, but there's no direct writable interface on the ResponseWriter.

@mcculloughsean
mcculloughsean / node-spawn.js
Last active Aug 29, 2015
Bug with cp.spawn and
View node-spawn.js
var cp = require('child_process'),
util = require('util');
var env = {}; //util._extend({}, process.env);
env.MY_AWESOME_ENV_VAR = 'hello world!';
var inheritCp = cp.spawn('./test.sh', undefined, {env: env});
inheritCp.stdout.pipe(process.stdout);
View gist:6679580
.......................................................................................... .........
.......................................................................................... .........
.................................mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm............. .........
.........................mmmmmmmmmmmmmmmm..................................mmmmm.......... .........
...................mmmmmmmmmmm..........mmmmm...............mm................mmm......... .........
.................mmmm............................................mm.............mmm....... .........
..............mmmm....m..mmmmmm............mmm..............mm......m............mmm...... .........
............mmmm.................................................mm....m..........mmm..... .........
...........mmm............mmmmm....................m..........mmm...m....m.........mmm.... .........
..........mm...........m.........................m................mm...m....m.......mmm... .........
View replacing_super_in_csr.coffee
class Foo
constructor: (attrs) ->
@myAttrs = attrs
class Bar extends Foo
constructor: ->
# short-term workaround for lack of implicit constructor
Foo.apply this, arguments
dumpAttrs: ->
console.log @myAttres
View objects.coffee
o =
a: 'foo'
b: 'bar'
p = []
for key, value of o
p.push { "#{key}": value }
View index.js
var bh = require('bulk-hogan');
bh.baseDirectory = 'foo';
var bh2 = { prototype: bh };
console.log(bh.baseDirectory, bh2.baseDirectory);
bh2.baseDirectory = 'bar';