I wanted to write it when I realized Pieter is dying. Thanks God he have been waiting on my article all the time! It is not well thought or structured, just a simple dump of my memory.
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 | |
# | |
# Show nth line with context 5 of each file | |
# | |
show_lines () | |
{ | |
local file n ctx min max lineno star | |
file=${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
#!/bin/bash | |
# build ZeroMQ stack and install to /usr/local/ | |
die () { | |
echo "FATAL: $@" >&2 | |
exit 1 | |
} | |
touch /usr/local/_test || die "Make /usr/local accessible again (chmod a+rwx)" |
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/sh | |
set -x | |
gcc -std=c99 -Werror -ggdb demo.c -lczmq -lmlm -o test \ | |
&& ./test |
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
# Malamute configuration | |
# Apply to the whole broker | |
server | |
timeout = 10000 # Client connection timeout, msec | |
background = 0 # Run as background process | |
workdir = . # Working directory for daemon | |
verbose = 1 # Do verbose logging of activity? | |
# auth | |
# verbose = 1 # Debug authentication steps? |
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
/* | |
* Test the fact it's not a good idea to call mlm_client API when zsys_interrupted == 1; | |
*/ | |
#define MLM_BUILD_DRAFT_API | |
#include <malamute.h> | |
int main () | |
{ |
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
#include <mysql/mysql.h> | |
#include <tntdb.h> | |
// g++ -ggdb -std=c++11 test.cc -ltntdb -lcxxtools -lmysqld | |
static char *server_args[] = { | |
"this_program", /* this string is not used */ | |
"--datadir=./__db__", | |
"--key_buffer_size=32M" | |
}; |
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
#include <czmq.h> | |
static int | |
xzloop_add_fd (zloop_t *self, int fd, zloop_fn handler, void *arg) | |
{ | |
assert (self); | |
zmq_pollitem_t *fditem = (zmq_pollitem_t*) zmalloc (sizeof (zmq_pollitem_t)); | |
assert (fditem); | |
fditem->fd = fd; | |
fditem->events = ZMQ_POLLIN; |
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
#include <memory> | |
#include <iostream> | |
#include <cstdio> | |
#include <cxxtools/pool.h> | |
#include <malamute.h> | |
using namespace cxxtools; | |
class MlmClient |
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
# Malamute configuration | |
# Apply to the whole broker | |
server | |
timeout = 10000 # Client connection timeout, msec | |
background = 0 # Run as background process | |
workdir = . # Working directory for daemon | |
verbose = 0 # Do verbose logging of activity? | |
auth | |
verbose = 1 # Debug authentication steps? |