- Create 5GB FreeBSD image.
- Install FreeBSD on xhyve.
- Mount host directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn gen-subset | |
"Generates an even-cardinality subset of the given elements" | |
[elements] | |
(gen/for [bools (apply gen/tuple (repeat (count elements) gen/boolean)) | |
:let [true-count (->> bools (filter identity) (count))] | |
:when (even? true-count)] | |
(->> (map list bools elements) | |
(filter first) | |
(map second) | |
(set)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 1. What I'm testing: A rope implementation where the binary tree is | |
;; balanced by splaying. | |
;; 2. To simplify things, it supports one update operation: | |
;; (splice rope start-offset end-offset new-data) | |
;; 3. I'd like to verify that the nodes are in the right order and other | |
;; properties after multiple splicings | |
;; Here's a spec I wrote for testing that the rope has the right | |
;; string representation after a single insertion-type splice: |
Migrating to OS X Mavericks breaks the ngrep utility. Doing:
sudo ngrep -d lo0 -q -W byline port 8080
stopped working where the process exits immediately. I didn't dig into the ngrep code, but was able to find a simple workaround by doing
sudo ngrep -q -W byline -d lo0 '' 'port 8080'
You can call that a lazy hack, but it work!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
simple_test() -> | |
{ok, EC} = erasuerl:new(), | |
{ok, Bin} = file:read_file("/usr/share/dict/words"), | |
{MD, KBins, MBins} = erasuerl:encode(EC, Bin), | |
[K1, K2, K3, K4, K5, K6, K7, K8, K9] = KBins, | |
[M1, M2, M3, M4] = MBins, | |
KBins2 = [undefined, undefined, undefined, K4, K5, K6, K7, K8, K9], | |
MBins2 = [undefined, M2, M3, M4], | |
Bin = iolist_to_binary(erasuerl:decode(EC, MD, KBins2, MBins2)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn- shrink-number | |
[n] | |
(->> (iterate #(quot % 2) n) | |
(drop 1) | |
(take-while (if (integer? n) | |
(partial not= 0) | |
#(not (== 0 (.unscaledValue (bigdec %)))))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2012 Erlware, LLC. All Rights Reserved. | |
# | |
# This file is provided to you under the Apache License, | |
# Version 2.0 (the "License"); you may not use this file | |
# except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user=> (run (apps (comp locking-app riak-lww-sloppy-quorum-app))) | |
.......!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!.!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.........Hit enter when ready to collect results. | |
#_=> | |
Writes completed in 178.326 seconds | |
2000 total | |
1841 acknowledged | |
1246 survivors | |
599 acknowledged writes lost! (╯°□°)╯︵ ┻━┻ | |
505 506 510 511 515 516 ... 1985 1986 1990 1991 1995 1996 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
oIFS=$IFS | |
IFS=" | |
" | |
ROOTDIR=`pwd` | |
if [ "$1" = "-p" ]; then | |
PRINT=1 | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% -*- coding: utf-8 -*- | |
%% | |
%% %CopyrightBegin% | |
%% | |
%% Copyright (C) 2013 Gregory Burd. All Rights Reserved. | |
%% | |
%% The contents of this file are subject to the Mozilla Public License, | |
%% Version 2, (the "License"); you may not use this file except in | |
%% compliance with the License. You should have received a copy of the | |
%% Mozilla Public License along with this software. If not, it can be |
NewerOlder