Skip to content

Instantly share code, notes, and snippets.

@itkach
itkach / test_data_scheme.py
Created November 7, 2010 20:58
Tiny Qt app demonstrating loading images with data URI scheme in QWebView
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
html1 = """
<html>
<body>
@itkach
itkach / rabbit.log
Created October 18, 2010 17:18
RabbitMQ reconnect log
=INFO REPORT==== 18-Oct-2010::12:52:27 ===
Rolling persister log to "/var/lib/rabbitmq/mnesia/rabbit/rabbit_persister.LOG.previous"
=INFO REPORT==== 18-Oct-2010::12:52:27 ===
started TCP Listener on 0.0.0.0:5672
=INFO REPORT==== 18-Oct-2010::12:52:58 ===
accepted TCP connection on 0.0.0.0:5672 from 192.168.122.1:49487
=INFO REPORT==== 18-Oct-2010::12:52:58 ===
@itkach
itkach / reconnect.py.log
Created October 18, 2010 17:12
Log of reconnection attempts
RESET
ATTEMPT ConnectionParameters(host = '192.168.122.19')
CONNECTED ConnectionParameters(host = '192.168.122.19')
RESET
RETRYING ConnectionParameters(host = '192.168.122.19') IN 1.043623993042309 SECONDS (0 attempts)
TXDISCONNECTED ConnectionParameters(host = '192.168.122.19') 0
ATTEMPT ConnectionParameters(host = '192.168.122.19')
RETRYING ConnectionParameters(host = '192.168.122.19') IN 2.7387564120438985 SECONDS (1 attempts)
TXDISCONNECTED ConnectionParameters(host = '192.168.122.19') 1
ATTEMPT ConnectionParameters(host = '192.168.122.19')
@itkach
itkach / reconnect.py
Created October 18, 2010 16:58
Create asyncore connection with SimpleReconnectionStrategy
import sys
from pika import ConnectionParameters, AsyncoreConnection, asyncore_loop
from pika.connection import SimpleReconnectionStrategy
if __name__ == '__main__':
args = sys.argv[1:]
host = args[0]
params = ConnectionParameters(host, heartbeat=0)
reconnect = SimpleReconnectionStrategy()