Skip to content

Instantly share code, notes, and snippets.

View dotnwat's full-sized avatar

Noah Watkins dotnwat

View GitHub Profile
@dotnwat
dotnwat / Makefile
Created April 6, 2012 18:34
Basic kernel AIO workload generator
CC=gcc
CFLAGS=-Wall
kaio-workload:%: %.c
$(CC) $(CFLAGS) -o $@ $< -laio
clean:
rm -f *.o kaio-workload
@dotnwat
dotnwat / lua_weak_table_example.diff
Created February 26, 2013 19:59
Demonstrates how a weak table in Lua can be used to prevent GC on a C++ object that has other C++ object references to it.
diff --git a/lua_rados.cc b/lua_rados.cc
index 33a7ab7..d48d525 100644
--- a/lua_rados.cc
+++ b/lua_rados.cc
@@ -19,6 +19,8 @@
#define LRAD_TIOCTX_T "Rados.IoctxT"
#define LRAD_BL_T "Rados.Bufferlist"
+static char reg_key_rados_refs;
+
@dotnwat
dotnwat / ceph_pg_dump_parse.py
Last active December 16, 2015 04:09
wip parser for 'ceph pg dump' output
import re
import argparse
class PGDumpParser(object):
_OSDS = r'\[(?P<up>.+)\].*\[(?P<acting>.+)\]'
_PGSTAT = r'(?P<pool>\d+)\.(?P<pg>\d+)'
_PGINFO = r'^%s.*%s.*$' % (_PGSTAT, _OSDS)
_PGINFO_RE = re.compile(_PGINFO)
@staticmethod
@dotnwat
dotnwat / config
Last active December 16, 2015 19:11
Minimal kernel configuration for VMWare Fusion 5 with Ubuntu Server 13.04
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 3.9.0 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
@dotnwat
dotnwat / ssdb_nc3_loader.c
Created May 27, 2013 16:16
SS-DB NetCDF Loader
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <netcdf.h>
commit 873b53923069d5dc50b0a54348987a48e1b7a7ba
Author: Noah Watkins <noahwatkins@gmail.com>
Date: Fri May 30 14:13:12 2014 -0700
tracing: bootstrap lttng-ust with mutex events
See src/tracing/README.md
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
def deepest_array(array, index):
sub_array = array[index[0]]
for component in index[1:-1]:
sub_array = sub_array[component]
return sub_array
def get_val(array, index):
return deepest_array(array, index)[index[-1]]
def set_val(array, index, value):
@dotnwat
dotnwat / sum0.cc
Last active August 29, 2015 14:22
Summation in Legion
/*
* Single task, one mapping.
*/
#include "legion.h"
using namespace LegionRuntime::HighLevel;
using namespace LegionRuntime::Accessor;
enum TaskIDs {
TOP_LEVEL_TASK_ID,
@dotnwat
dotnwat / ceph-deploy-single-node.sh
Last active February 4, 2016 00:16
Setup Ceph and Run RADOS Hello World
#!/bin/bash
set -x
set -e
set -u
CEPHDIR=$1
DATA=${2:-}
JRNL=${3:-}
NODE=`hostname`
//
// gcc -Wall -DGASNET_PAR -I/usr/include/ibv-conduit -pthread -o gasnet_test gasnet_test.c -lgasnet-ibv-par -libverbs
//
#include <gasnet.h>
#include <stdio.h>
#define GASNET_SAFE(fncall) do { \
int _retval; \
if ((_retval = fncall) != GASNET_OK) { \
fprintf(stderr, "ERROR calling: %s\n" \