Skip to content

Instantly share code, notes, and snippets.

@elzibubble
elzibubble / log
Last active August 29, 2015 14:14
Index shard locked in TRANSLOG after system crash
root@blah:/var/log/elasticsearch# curl 'localhost:9200/_cat/indices?v'
health index pri rep docs.count docs.deleted store.size pri.store.size
yellow logstash-2015.01.31 5 1 122912077 0 61.1gb 61.1gb
yellow logstash-2015.01.30 5 1 36646591 0 15.5gb 15.5gb
yellow logstash-2015.02.01 5 1 120025621 0 60.2gb 60.2gb
yellow logstash-2015.02.02 5 1 117779182 0 59.6gb 59.6gb
red logstash-2015.02.03 5 1 15493572 0 7.9gb 7.9gb
root@blah:/var/log/elasticsearch# tail -12 /var/log/elasticsearch/elasticsearch.log
[2015-02-03 12:57:32,832][WARN ][indices.cluster ] [Rainbow] [logstash-2015.02.03][4] failed to start shard
### Keybase proof
I hereby claim:
* I am lxsli on github.
* I am lxsli (https://keybase.io/lxsli) on keybase.
* I have a public key whose fingerprint is 3146 053D CE79 D1FC F4CA DAAF 2396 BE9A 6DF9 8417
To claim this, I am signing this object:
$ git clone --recursive http://github.com/ardagnir/athame
Cloning into 'athame'...
remote: Counting objects: 414, done.
remote: Compressing objects: 100% (229/229), done.
remote: Total 414 (delta 189), reused 404 (delta 179), pack-reused 0
Receiving objects: 100% (414/414), 2.41 MiB | 685.00 KiB/s, done.
Resolving deltas: 100% (189/189), done.
Checking connectivity... done.
Submodule 'vimbed' (http://github.com/ardagnir/vimbed) registered for path 'vimbed'
Cloning into 'vimbed'...
@elzibubble
elzibubble / gist:3c138fbd2ff051a6ab70
Created April 10, 2015 09:49
Recompiling bash for athame
xim [] % ./configure --prefix=/opt/bash-athame ~/w/bash-4.3.30 10:46:52
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
Beginning configuration for bash-4.3-release for x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...

Keybase proof

I hereby claim:

  • I am lxsli on github.
  • I am lxsli (https://keybase.io/lxsli) on keybase.
  • I have a public key whose fingerprint is F633 2E0D 9BFC B620 B604 E289 D90B 17B5 B418 8B42

To claim this, I am signing this object:

@elzibubble
elzibubble / tracing
Last active March 8, 2016 11:35
Utils for manual Python instrumentation
def foo(msg):
with open('foo.%d' % os.getpid(), 'a') as fp:
fp.write('%s\n' % msg)
FOO=0
def fin(msg):
global FOO
FOO += 1
foo('%s %s' % ('>'*FOO, msg))
def fox(msg):
global FOO
@elzibubble
elzibubble / Output
Created March 16, 2016 11:50
Test repeated calls to logging.fileConfig
2016-03-16 11:49:47.578 25533 ERROR root [-] error
2016-03-16 11:49:47.578 25533 WARNING root [-] warning
2016-03-16 11:49:47.579 25533 INFO root [-] info
2016-03-16 11:49:47.579 25533 ERROR aaa [-] error
2016-03-16 11:49:47.579 25533 WARNING aaa [-] warning
2016-03-16 11:49:47.579 25533 INFO aaa [-] info
2016-03-16 11:49:47.579 25533 ERROR bbb [-] error
2016-03-16 11:49:47.580 25533 ERROR ddd [-] error
2016-03-16 11:49:47.580 25533 WARNING ddd [-] warning
2016-03-16 11:49:47.580 25533 INFO ddd [-] info
@elzibubble
elzibubble / output
Last active March 18, 2016 15:26
testing for eventlet issues while reconfiguring logging
--- Init logging
--- Spawn
*** [0, 0] [0, 0]
--- Reloading - set EV
*** [0, 0] [0, 0]
*** [0, 0] [0, 0]
fail :(
*** [0, 0] [0, 0]
import os
FOO = None
class Foo(object):
this = None
def __init__(self):
Foo.this = self
@elzibubble
elzibubble / locks.py
Last active April 1, 2016 13:37
Show that an unpatched RLock blocks the native thread not just the greenlet
from __future__ import print_function
import os
import threading
import time
import eventlet
def block(lock):