Skip to content

Instantly share code, notes, and snippets.

View davewongillies's full-sized avatar

Dave Wongillies davewongillies

View GitHub Profile
@davewongillies
davewongillies / tmux.md
Created April 22, 2016 11:09 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

<!-- note that this requires the rabbitmq management plugin -->
<!-- also requires collectd 5.1 with curl_json plugin support -->
<Plugin curl_json>
<URL "http://localhost:55672/api/overview">
Instance "rabbitmq_overview"
User "guest"
Password "guest"
<Key "message_stats/publish">
Type "counter"
</Key>
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
user haproxy
group haproxy
daemon
listen rabbitmq 0.0.0.0:5672
mode tcp

What do Etcd, Consul, and Zookeeper do?

  • Service Registration:
    • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
  • Service Discovery:
    • Ability for client application to query the central registry to learn of service location.
  • Consistent and durable general-purpose K/V store across distributed system.
    • Some solutions support this better than others.
    • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@davewongillies
davewongillies / gist:9f2df7b918b4b56236b5
Created February 5, 2015 06:24
mcollective 2.8.0 error: `require': cannot load such file -- mcollective/runner (LoadError)
→ mco --version
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mcollective/runner (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/a.user/.gem/ruby/2.0.0/gems/mcollective-client-2.8.0/lib/mcollective.rb:52:in `<module:MCollective>'
from /Users/a.user/.gem/ruby/2.0.0/gems/mcollective-client-2.8.0/lib/mcollective.rb:28:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/a.user/.gem/ruby/2.0.0/gems/mcollective-client-2.8.0/bin/mco:7:in `<top (required)>'
from /Users/a.user/.gem/ruby/2.0.0/bin/mco:23:in `load'
from /Users/a.user/.gem/ruby/2.0.0/bin/mco:23:in
@davewongillies
davewongillies / sentry.conf.py
Created February 3, 2015 10:08
sentry.conf.py with redis sentinel
from redis.sentinel import Sentinel
sentinel = Sentinel([
('redis-sentinel1', 26379),
('redis-sentinel2', 26379),
('redis-sentinel3', 26379),
], socket_timeout=0.1)
redis_host = sentinel.discover_master('sentry')
SENTRY_REDIS_OPTIONS = {
'hosts': {
@davewongillies
davewongillies / gist:f857d9ffe7b40c2008a0
Last active August 29, 2015 14:11
sentry c14b7a9b04ae1f2fe67c6f6badcfd10268813f83 fresh install
> sentry:0109_index_filtervalue_times_seen
> sentry:0110_index_filtervalue_last_seen
> sentry:0111_index_filtervalue_first_seen
> sentry:0112_auto__chg_field_option_value__chg_field_useroption_value__chg_field_pr
> sentry:0113_auto__add_field_team_status
> sentry:0114_auto__add_field_projectkey_roles
> sentry:0115_auto__del_projectcountbyminute__del_unique_projectcountbyminute_projec
> sentry:0116_auto__del_field_event_server_name__del_field_event_culprit__del_field_
> sentry:0117_auto__add_rule
> sentry:0118_create_default_rules
@davewongillies
davewongillies / initial_data.json
Created December 18, 2014 04:23
starting up Sentry with initial_data.json
sentry --config=/var/sentry/sentry.conf.py start
Performing upgrade before service startup...
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
AttributeError: Problem installing fixture 'initial_data.json': 'NoneType' object has no attribute 'using'
@davewongillies
davewongillies / gist:892f6782abf1704106a9
Created October 15, 2014 23:04
mcollective 2.6.0 segfault
# mcollectived --no-daemonize --config /etc/mcollective/server.cfg
/usr/lib/ruby/1.9.1/timeout.rb:61: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :sleep
c:0003 p:0014 s:0007 b:0007 l:001d10 d:000006 BLOCK /usr/lib/ruby/1.9.1/timeout.rb:61
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP

Keybase proof

I hereby claim:

  • I am davewongillies on github.
  • I am davewongillies (https://keybase.io/davewongillies) on keybase.
  • I have a public key whose fingerprint is 2149 9650 C301 0361 395A 406E FFE5 0B78 D42F D949

To claim this, I am signing this object: