Skip to content

Instantly share code, notes, and snippets.

From ad7e082902b1a34387f6a0b3dd7eae6c074d5622 Mon Sep 17 00:00:00 2001
From: Ian Smith <ian.smith@mylookout.com>
Date: Thu, 15 Aug 2013 12:08:14 -0700
Subject: [PATCH] Stapfen should allow for a dlq.
---
lib/stapfen/worker.rb | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/stapfen/worker.rb b/lib/stapfen/worker.rb
require 'stomp'
max_re = ARGV[0].to_i unless ARGV.empty?
max_re ||= 0
conf = {:hosts => [:host => 'localhost', :ssl => false]}
queue = '/queue/some_queue'
client = Stomp::Client.new(conf)
thq-m-ismit01:~ ismith$ irb
1.9.3-p545 :001 > class Foo
1.9.3-p545 :002?> attr_accessor :bar
1.9.3-p545 :003?> def get_val(b = @bar) ; b; end
1.9.3-p545 :004?> end
=> nil
1.9.3-p545 :005 > f = Foo.new ; f.bar = 3
=> 3
1.9.3-p545 :006 > f.get_val
=> 3
require 'protobuf'
class SampleEnum < ::Protobuf::Enum
define :NEGATIVE, -1
define :ZERO, 0
define :POSITIVE, 1
end
class SampleMessage < ::Protobuf::Message
required SampleEnum, :my_enum, 1
thq-m-ismit01:redstorm ismith$ redstorm local examples/dsl/hello_world_topology.rb
launching java -server -Djruby.compat.version=RUBY1_9 -cp "/Users/ismith/Desktop/redstorm/target/classes:/Users/ismith/Desktop/redstorm/target/dependency/storm/default/*:/Users/ismith/Desktop/redstorm/target/dependency/topology/default/*:/Users/ismith/Desktop/redstorm/examples/dsl/" redstorm.TopologyLauncher local examples/dsl/hello_world_topology.rb
RedStorm v0.6.6 starting topology HelloWorldTopology/hello_world_topology in local environment
12116 [main] INFO backtype.storm.zookeeper - Starting inprocess zookeeper at port 2000 and dir /var/folders/zd/yytr2ws571ldlc4g89b8tt9nxqvvb0/T//11a74d89-b33c-4ea7-9f65-341d32390a61
12346 [main] INFO backtype.storm.daemon.nimbus - Starting Nimbus with conf {"dev.zookeeper.path" "/tmp/dev-storm-zookeeper", "topology.tick.tuple.freq.secs" nil, "topology.builtin.metrics.bucket.size.secs" 60, "topology.fall.back.on.java.serialization" true, "topology.max.error.report.per.interval" 5, "zmq.
Oct 02 13:40:28: Viscosity Mac 1.5.1 (1232)
Oct 02 13:40:28: Viscosity OpenVPN Engine Started
Oct 02 13:40:28: Running on Mac OS X 10.9.4
Oct 02 13:40:28: ---------
Oct 02 13:40:28: Checking reachability status of connection...
Oct 02 13:40:28: Connection is reachable. Starting connection attempt.
Oct 02 13:40:30: OpenVPN 2.3.4 x86_64-apple-darwin [SSL (OpenSSL)] [LZO] [PKCS11] [MH] [IPv6] built on Aug 26 2014
Oct 02 13:40:32: WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Oct 02 13:40:32: Control Channel Authentication: using '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/connection.GJtlGw/ta.key' as a OpenVPN static key file
Oct 02 13:40:32: Attempting to establish TCP connection with [AF_INET]204.77.168.26:1194 [nonblock]
@ismith
ismith / gist:a432130fb04bc9f3504b
Created November 27, 2015 01:53
Lab notebook description
- My 'lab notebook', a la @nelhage's post [1] is markdown-ish, mostly bullet points. One file per day, stored in git
dropbox; I have bash aliases to cd to the appropriate directory and to create a new day's file. I use vim; other editors
are fine as long as there's minimal 'weight'; you want to make this notebook as low-friction as possible to encourage use.
- Contents tend to be what I worked on that day (bugtracker links when appropriate; a one-liner when not
[like 'investigated foo library for bar project']). 2nd/3rd level bullets expand - thoughts/reactions when doing
research, hypotheses that did/didn't pan out if debugging [2], details of on-call response if I've been paged. Decisions
made, whether by me alone ("I'll use this pattern here"), by others ("product says ...") or by a group ("we met today and
agreed to switch to using [mumble]"). Things I learned today.
- Some of this content ends up getting duplicated for
others' consumption elsewhere - outage retrospective, design decisio

(Context: longer reply to the tweet thread at: https://twitter.com/Lollardfish/status/687807074416234496)

I tend to favor participatory design (your phrasing) and the practical ... in this space, I see product design as fitting into 3-4 levels. (Actually a spectrum; they subdivide further and the boundaries are hard to distinguish. Categorical perception, of a sort.) Gonna talk about this in terms of wheelchair tech, but it applies to other tech, both assistive- and not.

  1. The only barrier is "not on the market". "A wheelchair like my current one, but it should have USB power to charge my phone, the joystick should display the date (in addition to the time it currently has), and its throttle should range from current-minimum to twice current-maximum." This product is not really novel,
@ismith
ismith / 2016-03-31.csv
Last active March 31, 2016 20:48
Elevator outages - BART since October 17, 2015 & Muni since late February 2016
Elevator Number of Outages Total hours out Average outage length
Union City Fremont Platform Elevator 6 622.95 103.83
Civic Center Street Elevator 40 357.53 8.94
Powell Platform Elevator 59 354.89 6.02
16th St Mission Street Elevator 26 337.75 12.99
El Cerrito Plaza Richmond Platform Elevator 3 337.12 112.37
12th St Oakland Ogawa Plaza Elevator 20 239.8 11.99
Muni: Civic Center 16 234.6 14.66
Coliseum Platform Elevator 38 212.45 5.59
Civic Center Platform Elevator 34 197.13 5.8
@ismith
ismith / apt-cacher-ng-docker-os-x.md
Last active November 12, 2016 21:56
Local apt repo cache using docker

This uses two containers - one running apt-cacher-ng, and one running rawdns. In fact, this gist is mostly based on the apt-cacher-ng hack documented the rawdns repo.

This includes a few quirks for OS X, which I'll make note of.

  1. Edit ('create') /etc/rawdns.json to look like the rawdns.json in this gist.
  2. Run a rawdns container: docker run -d --name rawdns -p 53:53/udp -v /var/run/docker.sock:/var/run/docker.sock -v /private/etc/rawdns.json:/etc/rawdns.json:ro tianon/rawdns rawdns /etc/rawdns.json. Note that this references /private/etc/rawdns.json; this is because on OS X, /etc is symlinked to /private/etc, and you can't mount a symlink.
  3. Update your DNS resolver to use 127.0.0.1! Assuming OS X, this is in the Network preference pane, behind Advanced -> DNS.
  4. dig dns.docker should now include SERVER: 127.0.0.1#53(127.0.0.1).
  5. Ru