Skip to content

Instantly share code, notes, and snippets.

View dvliman's full-sized avatar

David Liman dvliman

View GitHub Profile
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
@dvliman
dvliman / lmdb.tcl
Created April 30, 2017 19:48 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@dvliman
dvliman / initial_calls.erl
Created March 25, 2017 00:54 — forked from rlipscombe/initial_calls.erl
Finding leaked processes in Erlang
lists:sort(fun({_, X}, {_, Y}) -> X > Y end,
dict:to_list(lists:foldl(
fun(Pid, Dict) ->
InitialCall = case erlang:process_info(Pid, initial_call) of
{initial_call,{proc_lib,init_p,A}} ->
case erlang:process_info(Pid, dictionary) of
{dictionary, D} -> proplists:get_value('$initial_call', D, undefined);
_ -> {proc_lib,init_p,A}
end;
{initial_call,{erlang,apply,A}} ->
@dvliman
dvliman / initial_calls.erl
Created March 25, 2017 00:54 — forked from rlipscombe/initial_calls.erl
Finding leaked processes in Erlang
lists:sort(fun({_, X}, {_, Y}) -> X > Y end,
dict:to_list(lists:foldl(
fun(Pid, Dict) ->
InitialCall = case erlang:process_info(Pid, initial_call) of
{initial_call,{proc_lib,init_p,A}} ->
case erlang:process_info(Pid, dictionary) of
{dictionary, D} -> proplists:get_value('$initial_call', D, undefined);
_ -> {proc_lib,init_p,A}
end;
{initial_call,{erlang,apply,A}} ->
@dvliman
dvliman / cassandra-notes
Created March 21, 2017 18:52
cassandra-notes
http://engblog.polyvore.com/2015/03/cassandra-compaction-and-tombstone.html
size tiered (need storage space, mixed read, update, delete workloads) vs.
level tiered compaction strategy (read heavy workloads, more resource intensive)
http://dbwrangler.blogspot.co.id/2012/10/cassandra-working-with-time-to-live-ttl.html
about ttl and compaction in cassandra with 3 nodes
http://www.sestevez.com/range-tombstones/
range tombstone
(tt_devapi@127.0.0.1)6> rp(v(5)).
[{tt_devapi_roles_service_SUITE,create_role_keywords,ok,
8933573},
{tt_devapi_roles_service_SUITE,create_role_no_owners,ok,
1515910},
{tt_devapi_roles_service_SUITE,create_role_with_owners,ok,
831804},
{tt_devapi_roles_service_SUITE,create_role_saml_enabled_org,
ok,1104153},
{tt_devapi_roles_service_SUITE,create_role_non_saml_enabled_org,
readonly LOG_DEFAULT_COLOR=$(tput sgr0) # Clear colors
readonly LOG_ERROR_COLOR=$(tput setaf 1) # Red
readonly LOG_INFO_COLOR=$(tput sgr 0) # White
readonly LOG_SUCCESS_COLOR=$(tput setaf 2) # Green
readonly LOG_WARN_COLOR=$(tput setaf 3) # Yellow
readonly LOG_DEBUG_COLOR=$(tput setaf 4) # Blue
^C
dliman@dev-full-i-06d10a21916387f7f:/opt/developer_api/log$ exit a
logout
-bash: exit: a: numeric argument required
Connection to 10.0.11.114 closed.
dliman@admin-bastion-i-dd0e5846:~$ cat fabfile.py
import os, sys, re, boto, urllib2, itertools, time
from boto.ec2 import connect_to_region
from fabric.api import env, run, cd, settings, sudo, open_shell
from fabric.api import parallel
@dvliman
dvliman / feb23-roles-service-test
Created February 23, 2017 22:31
feb23-roles-service-test
(tt_devapi@127.0.0.1)4> rp(v(2)).
[{tt_devapi_roles_service_SUITE,create_role_keywords,ok,
8696256},
{tt_devapi_roles_service_SUITE,create_role_no_owners,ok,
1467221},
{tt_devapi_roles_service_SUITE,create_role_with_owners,ok,
795725},
{tt_devapi_roles_service_SUITE,create_role_saml_enabled_org,
ok,990792},
{tt_devapi_roles_service_SUITE,create_role_non_saml_enabled_org,
{application, gd,
[{description, "gd"},
{vsn, "0.1.0"},
{registered, [gd_sup]},
{mod, {gd_app, []}},
{applications, [
kernel,
stdlib,
lager,
gproc,