Skip to content

Instantly share code, notes, and snippets.

View paegun's full-sized avatar

James Gorlick paegun

  • San Francisco, CA, USA
View GitHub Profile
#!/bin/sh
# DC/OS Cassandra (C*) seed node restart script.
#
# This script helps automate the restart (or not) of non-seed nodes following
# a seed node restart. Restarting non-seed nodes is necessary as C* internally
# uses the resolved ip address for the seed node.
#
# Tested for the following DC/OS versions:
# - 1.10
#!/bin/sh
if ! [ -z $DEBUG ]; then
set -x
DEBUG_CURL_OPTS=-s
fi
usage () {
cat <<EOF
dcos_framework_strict

OSS Contribution At a Glance

Whoami

James Gorlick (paegun) https://twitter.com/jgorlick19

Brief

I have limited open source contributions and open presentation experience due to years in the enterprise space. Within the enterprise space, I have lead development of products that were core to customer success, so enjoyed considerable interaction with customers at all levels as well as attending and

@paegun
paegun / cmwyc
Last active December 30, 2016 14:30
#!/usr/bin/env escript
%% cmwyc - catch me whilst you can for CREATE TABLE postcondition possible race
%% setup w/
%% mkdir cmwyc_log
%% ran w/
%% runs=100
%% rm cmwyc_log/*; for i in `seq 1 $runs`; do `./cmwyc >cmwyc_log/$i 2>&1 &`; done; tail -f cmwyc_log/$runs
// creates a table and
// generates queries, storing random numbers
(function () {
'use strict';
var Riak = require('basho-riak-client');
var client = new Riak.Client(['127.0.0.1:10017']);
var rngTable = 'rng';
var quantumSizeInMs = 1000 * 60 * 60;
{{command, "reconnect; "}, {result, "Reconnected to 'dev1@127.0.0.1' on port 10017"}}.
{{command, "show_connection; "}, {result, "riak-shell is connected to: 'dev1@127.0.0.1' on port 10017"}}.
{{command, "show_nodes; "}, {result, "The connected nodes are: ['dev1@127.0.0.1','dev2@127.0.0.1','dev3@127.0.0.1']"}}.
{{command, "show_history; "}, {result, "The history contains:
- 1: reconnect;
- 2: show_connection;
- 3: show_nodes;
"}}.
{{command, "show_nodes; "}, {result, "The connected nodes are: ['dev1@127.0.0.1','dev2@127.0.0.1','dev3@127.0.0.1']"}}.
{{command, "CREATE TABLE GeoCheckin (myfamily varchar not null, myseries varchar not null, time timestamp not null, weather varchar not null, temperature double, PRIMARY KEY ((myfamily, myseries, quantum(time, 15, 'm')), myfamily, myseries, time));\n"}, {result, ""}}.
#!/bin/sh
# using Riak devrels
RIAK_TS_BASE_DIR=${RIAK_TS_BASE_DIR:-~/src/riak_ee}
RIAK_TS_HTTP_BASE_URL=${RIAK_TS_HTTP_BASE_URL:-http://127.0.0.1:10018}
GRAPHITE_RIAKTS_EBIN_BASE_DIR=${GRAPHITE_RIAKTS_EBIN_BASE_DIR:-$PWD/_build/default/lib}
GRAPHITE_RIAKTS_CONF_DIR=${GRAPHITE_RIAKTS_CONF_DIR:-/etc/riak}
RIAK_TS_PB_PORT=10017
LOG_LEVEL=info
log_ts () {
# Usage:
#
# Start collection of count per command in 15 second windows, retaining only
# the last 5 (default) windows:
# ```shell
# REDIS_COMMAND_STATS_COMMAND=start REDIS_STAT_WINDOW_STEP=15s ruby gather_redis_command_stats.rb
# ```
#
# Print collected count per command, for retained windows:
# ```shell
/*
example of thread-sanitizer for C
to cause a violation and view the tsan output, execute the following:
```sh
clang -pthread -fsanitize=thread -DVIOLATE trace.c
./a.out
```
or for gcc 4.8
```sh
gcc -pthread -fsanitize=thread -fPIE -pie -static-libtsan -DVIOLATE=1 trace.c
#!/usr/bin/env sh
VERSION="R16B02-basho8"
VERSION_U=$(echo $VERSION |tr '-' '_')
eval $(ssh-agent -s)
for i in ls ~/.ssh/*; do
case $i in
*id_*.pub)
:
;;