This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging, logging.config | |
TOPIC_NAME = 'TOPIC-NAME' | |
GROUP_NAME = 'GROUP-NAME' | |
BOOTSTRAP_SERVERS = ['BROKER-HOST'] | |
def setup_logging(): | |
logging.config.dictConfig({ | |
'version': 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2016-03-10 14:34:50,186] DEBUG base 14747 139872076707584 Received successful heartbeat | |
[2016-03-10 14:34:50,186] DEBUG fetcher 14747 139872076707584 Adding fetch request for partition TopicPartition(topic='TOPIC-NAME', partition=0) at offset 143454 | |
[2016-03-10 14:34:50,186] DEBUG fetcher 14747 139872076707584 Sending FetchRequest to node 1 | |
[2016-03-10 14:34:50,187] DEBUG conn 14747 139872076707584 <BrokerConnection host=SERVER-HOSTNAME port=9092> Request 975: FetchRequest(replica_id=-1, max_wait_time=500, min_bytes=1, topics=[(topic='TOPIC-NAME', partitions=[(partition=0, offset=143454, max_bytes=1048576)])]) | |
[2016-03-10 14:34:50,683] DEBUG consumer 14747 139872076707584 Sending offset-commit request with {TopicPartition(topic='TOPIC-NAME', partition=0): OffsetAndMetadata(offset=143454, metadata='')} to 1 | |
[2016-03-10 14:34:50,684] DEBUG conn 14747 139872076707584 <BrokerConnection host=SERVER-HOSTNAME port=9092> Request 976: OffsetCommitRequest_v2(consumer_group='GROUP-NAME', consumer_grou |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
import mock as mock_ | |
class Mock(object): | |
def __init__(self): | |
self._patchers = [] | |
def _stop(self): | |
for patcher in self._patchers: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If a directory contains a file named .venv, read its contents and activate | |
# the corresponding virtualenv. | |
venv_cd() { | |
local venv | |
if builtin cd "$@"; then | |
if [ -e .venv ]; then | |
venv=$(cat .venv) | |
if [ -z "$VIRTUAL_ENV" ]; then | |
workon "$venv" || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==14106== Memcheck, a memory error detector | |
==14106== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. | |
==14106== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info | |
==14106== Command: /usr/bin/Xorg :4 -auth /var/run/lightdm/root/:4 -nolisten tcp vt7 -novtswitch -core -verbose 10 | |
==14106== | |
X.Org X Server 1.11.3 | |
Release Date: 2011-12-16 | |
X Protocol Version 11, Revision 0 | |
Build Operating System: Linux 3.2.0-27-generic x86_64 Ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==27246== Memcheck, a memory error detector | |
==27246== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. | |
==27246== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info | |
==27246== Command: /usr/bin/Xorg :3 -auth /var/run/lightdm/root/:3 -nolisten tcp vt7 -novtswitch -verbose 10 | |
==27246== | |
X.Org X Server 1.11.3 | |
Release Date: 2011-12-16 | |
X Protocol Version 11, Revision 0 | |
Build Operating System: Linux 3.2.0-27-generic x86_64 Ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==20591== Memcheck, a memory error detector | |
==20591== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. | |
==20591== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info | |
==20591== Command: /usr/bin/Xorg :1 -auth /var/run/lightdm/root/:1 -nolisten tcp vt7 -novtswitch -verbose 10 | |
==20591== | |
X.Org X Server 1.11.3 | |
Release Date: 2011-12-16 | |
X Protocol Version 11, Revision 0 | |
Build Operating System: Linux 3.2.0-27-generic x86_64 Ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==7657== Memcheck, a memory error detector | |
==7657== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. | |
==7657== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info | |
==7657== Command: /usr/bin/Xorg :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -verbose 10 | |
==7657== | |
X.Org X Server 1.11.3 | |
Release Date: 2011-12-16 | |
X Protocol Version 11, Revision 0 | |
Build Operating System: Linux 2.6.42-26-generic x86_64 Ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This hook is run after this virtualenv is activated. | |
export SALADIR=/path/to/passwords | |
. /path/to/sala/contrib/sala-completion.bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open in browser when viewing interactively | |
text/html; /usr/bin/sensible-browser '%s'; description=HTML Text; nametemplate=%s.html | |
# Dump with w3cm and the correct encoding when viewing non-interactively | |
text/html; /usr/bin/w3m -dump -T text/html -I %{charset} -O utf-8 %s; copiousoutput; description=HTML Text; nametemplate=%s.html | |
# Support non-standard image/jpg, too | |
image/jpg; display 'jpeg:'%s''; test=test -n "$DISPLAY" |