Drop it in ~/bin and use as following
vagrant@karas:~/git$ echo voluptatem%:doloribus | urlencode
voluptatem%25%3Adoloribus| $ curl $db/neato -XPUT | |
| {“ok”:true} | |
| $ curl $db/neato -XPOST -H’Content-Type: application/json’ -d’{“key”: 1}’ | |
| {“ok”:true,”id”:”b24a8da105719f433651feabff001d5d”,”rev”:”1-c77eb5d5af83163c996ea42b61a9f0d8”} | |
| $ curl $db/neato/b24a8da105719f433651feabff001d5d -G -s | jq . | |
| { | |
| “_id”: “b24a8da105719f433651feabff001d5d”, | |
| “_rev”: “1-c77eb5d5af83163c996ea42b61a9f0d8”, |
Drop it in ~/bin and use as following
vagrant@karas:~/git$ echo voluptatem%:doloribus | urlencode
voluptatem%25%3AdoloribusErlang/OTP 17 [erts-6.4.1.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V6.4.1.2 (abort with ^G)
1> c(zombie_timer).
{ok,zombie_timer}
2> zombie_timer:main().
-. start timer {1458135323982793,#Ref<0.0.0.79>} from <0.40.0>
-. loop is <0.40.0>
1. <0.40.0>| [core] | |
| editor = vim | |
| pager = less | |
| whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eolpager | |
| [color] | |
| status = auto | |
| branch = auto | |
| diff = auto | |
| interactive = auto | |
| pager = true |
| # Build and slim Erlang | |
| # Author: Matthias Lang <matthias@corelatus.se> | |
| # Reference: http://erlang.org/pipermail/erlang-questions/2016-February/087935.html | |
| # Change the line below if you want to use a different version of Erlang | |
| # (Keep in mind that patches may not apply cleanly) | |
| erlang_version=otp_src_R14B03 | |
| erlang_source_file:=$(PACKAGE_SOURCES)/$(erlang_version)/$(erlang_version).tar.gz | |
| erlang_root=$(GTH_ERLANG_ROOT)/$(erlang_version) |
| #!/usr/bin/env escript | |
| %% -*- erlang -*- | |
| %% * slurp in terms using inlined version of kernels file:consult/1 | |
| %% * convert to abstract syntax tree | |
| %% * annotate all tuples | |
| %% * pretty print using a hook to prefix the annotated nodes with newline | |
| main([]) -> | |
| io:format("%% -*-erlang-*-~n"), |
| make_random_ref_key() -> | |
| <<X:264/big-unsigned-integer>> = term_to_binary(make_ref()), | |
| [Key] = io_lib:format("~66.16.0b", [X]), | |
| {ok, Key}. | |
| make_random_md5_key() -> | |
| <<X:128/big-unsigned-integer>> = crypto:hash(md5, term_to_binary(make_ref())), | |
| [Key] = io_lib:format("~32.16.0b", [X]), | |
| {ok, Key}. |
| #!/usr/bin/env escript | |
| % -*- mode: erlang -*- | |
| main([BeamFile]) -> | |
| {ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]), | |
| io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]). |
Just make Erlang to do some light-load task in a bunch of relatively short leaving processes. Calculating PI to 80th digit in batches per 10 procs with short, 8 ms, sleep in-between, to give schedulers a breath space, will do.
Run erl with 8 schedulers and no busy waiting on schedulers at all.
Python with virtualenv, curl and jq in $PATH, running CouchDB available on http://localhost:5984
git clone https://gist.github.com/f05328e7e24a1064c3ce.git test-linked