Skip to content

Instantly share code, notes, and snippets.

View AeroNotix's full-sized avatar
💭
🇺🇦

Aaron France AeroNotix

💭
🇺🇦
View GitHub Profile
xrandr --output LVDS1 --mode 1600x900 --output VGA1 --mode 1280x1024 --right-of LVDS1 --output HDMI1 --mode 1920x1080 --right-of VGA1
xrandr: Configure crtc 2 failed
~ xrandr -q
Screen 0: minimum 8 x 8, current 3520 x 1080, maximum 32767 x 32767
LVDS1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 382mm x 214mm
1600x900 60.06*+
1024x768 60.00
800x600 60.32 56.25
640x480 59.94
VGA1 connected (normal left inverted right x axis y axis)
1280x1024 75.02 75.02 60.02
1152x864 75.00
~ erl
Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.3 (abort with ^G)
1> 'Łukasz'.
* 1: illegal atom
case OldSock of undefined -> ok ;
_ -> ok = gen_udp:close(OldSock)
end,
%% "should be" (according to OTP rules)
case OldSock of undefined -> ok ;
_ -> ok = gen_udp:close(OldSock)
end,
"Given a set of :add operations followed by a final :read, verifies that
every successfully added element is present in the read, and that the read
contains only elements for which an add was attempted."
(reify Checker
(check [this test model history]
(let [attempts (->> history
(r/filter knossos/invoke?)
(r/filter #(= :add (:f %)))
(r/map :value)
(into #{}))
(gen/phases
(->> (range sample-size)
(map (fn [x] {:type :invoke
:f :add
:value x}))
gen/seq
(gen/stagger 1/10)
(gen/delay 1)
(gen/nemesis
(gen/seq

Notes about creating a Jepsen test

Implement jepsen.db.DB

  • setup! [this test node]
    • The "provisioning" aspect of your test. Implement anything here which is needed to put the system under test into some state. For example, installing databases, bringing applications up
def random_device(reuse_owner=False, **kwds):
def wrapper(f):
def wrapped(self):
if reuse_owner and hasattr(self, 'device'):
print "Reusing owner %s" % self.device
else:
print "no owner"
return f(self)
return wrapped
return wrapper
(defun trim-string (string)
(replace-regexp-in-string
"\\`[ \t\n]*" ""
(replace-regexp-in-string "[ \t\n]*\\'" "" string)))
(defun move-to-export ()
(search-backward "-export"))
(defun go-to-export-end ()
(search-forward "])."))
-spec
gather_child_data(pid(), string(), [binary()]) -> [binary()].
gather_child_data(Conn, Path, ChildPaths) ->
[begin
BinPath = list_to_binary(Path ++ "/"),
NewPath = binary_to_list(<<BinPath/binary, Child/binary>>),
{ok, {NodeData, _}} = ezk:get(Conn, NewPath),
NodeData
end || Child <- ChildPaths].