Skip to content

Instantly share code, notes, and snippets.

View WeirdCarrotMonster's full-sized avatar

Eugene Protozanov WeirdCarrotMonster

  • Izhevsk, Russia
View GitHub Profile

Keybase proof

I hereby claim:

  • I am weirdcarrotmonster on github.
  • I am wrdcrrtmnstr (https://keybase.io/wrdcrrtmnstr) on keybase.
  • I have a public key ASAO2UVA2ZBsrLM7oWd7RgHo5xH3URCCtbYWsMLuAlh4_Qo

To claim this, I am signing this object:

#include <uwsgi.h>
#include <client/dbclient.h>
#include <client/gridfs.h>
struct uwsgi_gridfs_mountpoint {
char *mountpoint;
uint16_t mountpoint_len;
char *server;
char *db;
@WeirdCarrotMonster
WeirdCarrotMonster / gist:499f9c195edb5bb48e14
Created March 26, 2015 14:23
Function to call uwsgi rpc from python
import socket
from struct import pack, unpack
def rpc_call(host, port, *args):
c = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
c.connect((host, port))
b = c.send(pack('<BHB', 173, sum(2 + len(arg) for arg in args), 0))
for arg in args: