Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
function configure_init()
{
set -x
export PATH=/sbin:/bin
}
function configure_fs()
{
mount -o remount,rw /
#1/usr/bin/env bash
declare -A opts
function print_usage()
{
cat <<EOL
NAME:
$0 -- restore files for existing process using procfs.
function grow()
{
local md=$1
shift
mdadm --grow --bitmap=none $md
mdadm --grow --bitmap=internal $md
}
function recreate()
{
/*
* Modified version of https://github.com/libevent/libevent/blob/master/sample/le-proxy.c
* with proxying in bufferevent's writecb
*
* Refs: https://github.com/libevent/libevent/issues/694
*/
/*
This example code shows how to write an (optionally encrypting) SSL proxy
with Libevent's bufferevent layer.
#!/usr/bin/env bash
mkdir -p bld
root="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
le_root=/src/le/libevent
cmds=(
"set -x"
// https://github.com/libevent/libevent/issues/690
// https://gist.github.com/nacl/cfcc35714c33b31e5a129f5e6500c577
// openssl s_client -connect 127.1:9999 < /dev/zero | pv
// ncat 127.1 9999 < /dev/zero | pv
// gcc -g3 ssl-echoserver.c -lssl -lcrypto -L/src/le/libevent/.cmake-debug/lib -levent_core -levent_openssl -o ssl-echoserver
/*
Copyright (C) 2018 Akamai Technologies
Copyright 2009-2012 Nick Mathewson
#!/usr/bin/env python
"""
Monitor systemd journal activity, and execute --cmd if --pattern matched
"""
import argparse
import os, sys
import re
import logging
/** Copied form one of old servers (Oct 4 2013) */
#include <stdio.h>
#include <errno.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <netdb.h>
commit 65b5c8ad803118573bd7777a067be197470f336f
Merge: 3e6553a1 ebe89149
Author: Azat Khuzhin <[email protected]>
Date: Mon Oct 22 00:32:57 2018 +0300
On master: bufferevent/bufferevent_timeout: ignores write cb timeout
Notes:
1|azat:.../.cmake-debug (master) [1]$ ninja && regress --no-fork --verbose bufferevent/bufferevent_timeout
[34/34] Linking C executable bin/bench_http
// https://github.com/libevent/libevent/pull/208
#define _GNU_SOURCE
#include <pthread.h>
#include <assert.h>
#include <event2/bufferevent.h>
#include <event2/buffer.h>
#include <event2/thread.h>
#include <event2/event.h>