Skip to content

Instantly share code, notes, and snippets.

View paurkedal's full-sized avatar

Petter A. Urkedal paurkedal

View GitHub Profile
(* Draft for cherry-picking into pgx.
*
* Copyright (C) 2020 Petter A. Urkedal
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version,
* with the OCaml static compilation exception.
*
# Based on
# https://launchpad.net/ubuntu/+source/ganeti/2.16.0-1ubuntu1
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y debhelper build-essential fakeroot devscripts
RUN apt-get install -y m4 pandoc python-all python3-all ghc ghc-ghci cabal-install libghc-case-insensitive-dev libghc-curl-dev libghc-json-dev libghc-snap-server-dev libghc-network-dev libghc-parallel-dev libghc-utf8-string-dev libghc-deepseq-dev libghc-hslogger-dev libghc-crypto-dev libghc-text-dev libghc-hinotify-dev libghc-base64-bytestring-dev libghc-zlib-dev libghc-regex-pcre-dev libghc-attoparsec-dev libghc-vector-dev libghc-lifted-base-dev libghc-lens-dev libghc-psqueue-dev libghc-test-framework-quickcheck2-dev libghc-test-framework-hunit-dev libghc-temporary-dev libghc-old-time-dev libpcre3-dev libcurl4-openssl-dev python-simplejson python-pyparsing python-openssl python-bitarray python-pyinotify python-pycurl python-paramiko python-ipaddr python-sphinx graphviz qemu-utils socat bash
@paurkedal
paurkedal / bench_httpaf_pr53.ml
Last active July 1, 2018 20:21
Code used to benchmark httpaf GPR-53 and GPR-54.
open Lwt.Infix
open Unprime_list
open Printf
let rates = [
1000.0;
2000.0;
5000.0;
10_000.0;
20_000.0;
@paurkedal
paurkedal / mariadb_nonblocking_connect_stress_test.c
Created December 20, 2017 08:23
MariaDB nonblocking connect stress test
#include <mariadb/mysql.h>
#include <stdlib.h>
#include <stdio.h>
#include <poll.h>
static int wait_for_mysql(MYSQL *mysql, int status) {
struct pollfd pfd;
int timeout, res;
pfd.fd = mysql_get_socket(mysql);
(* guestfs-inspection
* Copyright (C) 2009-2017 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@paurkedal
paurkedal / base-with-tupled-9.svg
Last active October 3, 2017 22:24
faster-map with new base implementation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
type 'a io = 'a Lwt.t
type ic = Lwt_io.input_channel
type oc = Lwt_io.output_channel
type tls_lib = [`OpenSSL | `Native]
module X509_key : sig
type t = private {
key: string;
@paurkedal
paurkedal / crosspad.ml
Last active January 11, 2017 21:04
Crosspad with full update (origin: https://github.com/martindemello/crosspad.jsoo)
open Xword.Types
open Lwt.Infix
type coords = { x : int; y : int }
module Model = struct
open Cursor
type t = {
xw : xword;
#! /bin/bash
set -e
if [ -r /etc/opam-deploy.conf ]; then
. /etc/opam-deploy.conf
fi
rsync_options="-rlptD --delete"
backlog=3
#! /bin/bash
OPAMSWITCH="$1"
shift
export PATH="/opt/opam/$OPAMSWITCH/bin:$PATH"
export CAML_LD_LIBRARY_PATH=/opt/opam/$OPAMSWITCH/lib/stublibs
exec "$@"