Skip to content

Instantly share code, notes, and snippets.

@mistotebe
mistotebe / switching.c
Created August 16, 2013 19:04
Changing bufferevent callbacks when data is pending.
#include <signal.h>
#include <stdio.h>
#include <event2/event.h>
#include <event2/bufferevent.h>
struct event_base *base;
void signal_cb(evutil_socket_t signal, short action, void *arg)
{
#include <lber.h>
int main( int argc, char **argv )
{
BerElement *write, *read, *compare;
BerValue xfer, seq, *array;
ber_tag_t tag;
ber_len_t len;
int i;
#!/usr/bin/env python3
# Adapted from code in
# https://github.com/eclipse/paho.mqtt.python/tree/master/examples
# Can't remember which.
# LICENSE:
# This project is dual licensed under the Eclipse Public License 1.0 and the
# Eclipse Distribution License 1.0 as described in the epl-v10 and edl-v10 files.
"Test client from the paho docs"
import asyncio
#!/usr/bin/env python3
import asyncio
import ldap
import ldap_wrapper
async def search(client):
search = client.search("cn=monitor", ldap.SCOPE_SUBTREE, attrlist=['+', '*'])
try: