Skip to content

Instantly share code, notes, and snippets.

Avatar

Min RK minrk

View GitHub Profile
View attack.py
# Quick python script to send a single message to the PAIR socket
# this will crash the device
import zmq
ctx = zmq.Context()
s = ctx.socket(zmq.PAIR)
s.connect('tcp://127.0.0.1:5555')
s.send('invalid')
@minrk
minrk / test_i33.py
Created Jan 13, 2011
stress test script for pyzmq issue 33
View test_i33.py
#!/usr/bin/env python
"""Script to connect req/rep pair, close them, then try to send/recv.
This should raise ENOTSUP, but sometimes did not in zeromq < 2.0.10."""
import zmq
ctx = zmq.Context()
def create_bound_pair(ta, tb):
a = ctx.socket(ta)
View zmq_cli.py
#!/usr/bin/python
"""
zmq_cli - 0MQ Server interruptability test case, client module.
"""
import zmq
@minrk
minrk / checkconstants.py
Created Jan 27, 2011
compare constants in zmq.h to czmq.pxd
View checkconstants.py
#!/usr/bin/env python
"""A simply script to scrape zmq.h and zmq/core/czmq.pxd for constants,
and compare the two. This can be used to check for updates to zmq.h
that pyzmq may not yet match.
"""
from __future__ import with_statement
import os
import sys
View allconnections.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@minrk
minrk / ss2sftp.js
Created Feb 3, 2011
Strongspace to SFTP bookmarklet
View ss2sftp.js
javascript:function ss_to_sftp(){
var host=document.location.host;
var path=document.location.hash;
if (host!='www.strongspace.com'){
alert('You do not appear to be at strongspace!');
return;
}
var m=path.match(/^#\w+/i);
if (m==null){
alert('you do not appear to be viewing a file');
View adder.py
class Two(object):
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, b):
return Sum(self, b)
View test_pyzmq.sh
#!/usr/bin/env bash
info(){
echo "****************************************"
echo "INFO: $@"
}
fail(){
echo "****************************************"
echo "FAILED: $@"
exit -1
View ungawker.js
// ==UserScript==
// @name UnGawker
// @namespace net.minrk.ungawker
// @description Automatically view all Gawker articles via Instapaper
// @include http://*deadspin.com/*
// @include http://*gawker.com/*
// @include http://*gizmodo.com/*
// @include http://*io9.com/*
// @include http://*jalopnik.com/*
// @include http://*jezebel.com/*
View hwclient.py
#
# Hello World client in Python
# Connects REQ socket to tcp://localhost:5555
# Sends "Hello" to server, expects "World" back
#
import zmq
context = zmq.Context()
# Socket to talk to server
You can’t perform that action at this time.