This file contains hidden or 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
-module(measure_processes). | |
-export([limit/1]). | |
limit(N) -> | |
Limit = erlang:system_info(process_limit), | |
io:format("Limit allowed processes:~p~n", [Limit]), | |
statistics(runtime), | |
statistics(wall_clock), | |
L = for(1, N, fun() -> spawn(fun() -> wait() end) end), | |
{_, Time1} = statistics(runtime), |
This file contains hidden or 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
-module(imei). | |
-export([crc/1]). | |
crc(IMEI) when is_list(IMEI), length(IMEI) =:= 14 -> | |
calc(IMEI, 0). | |
calc([], Acc) -> | |
(10 - (Acc rem 10)) rem 10; | |
calc(L = [X|Rest], Acc) when length(L) rem 2 =:= 0 -> |
This file contains hidden or 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
find_free_port() -> | |
{ok, X} = gen_tcp:listen(0, [{active, false}]), | |
{ok, P} = inet:port(X), | |
gen_tcp:close(X), | |
{ok, P} | |
end. |
This file contains hidden or 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
reverse_bin(Bin) -> | |
S = size(Bin)*8, | |
<<X:S/integer-little>> = Bin, | |
<<X:S/integer-big>>. |
This file contains hidden or 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
EI_TRACELEVEL=6 /opt/erlang/17.4/lib/erl_interface-3.7.20/bin/erl_call -v -d -n [email protected] -c cookie -a 'erlang length [[a,b,c]]' | |
erl_call: node = [email protected] | |
Cookie = cookie | |
flags = verbosep debugp | |
module: name = , size = 0 | |
apply = erlang length [[a,b,c]] | |
ei_xconnect: Wed Feb 18 10:42:38 2015: -> CONNECT attempt to connect to node | |
ei_epmd_r4_port: Wed Feb 18 10:42:38 2015: -> PORT2_REQ alive=node ip=127.0.0.1 | |
ei_epmd_r4_port: Wed Feb 18 10:42:38 2015: <- PORT2_RESP result=0 (ok) | |
ei_epmd_r4_port: Wed Feb 18 10:42:38 2015: port=62153 ntype=77 proto=0 dist-high=5 dist-low=5 |
This file contains hidden or 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
Spec = dbg:fun2ms(fun(_) -> message(caller()),return_trace() end). | |
AllModulesPattern = [{{M, '_', '_'},Spec} | |
|| {M, _} <- code:all_loaded()]. | |
ttb:start_trace([node()],AllModulesPattern, | |
{all, [all]}, | |
{handler, ttb:get_et_handler()}). | |
ttb:stop(format). |
This file contains hidden or 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
-module(udp_test). | |
-behaviour(gen_server). | |
-define(SERVER, ?MODULE). | |
-define(PORT, 9876). | |
-define(TIMEOUT, 10). | |
%% ------------------------------------------------------------------ | |
%% API Function Exports | |
%% ------------------------------------------------------------------ |
This file contains hidden or 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
$ ./configure --enable-shared --enable-static --with-erlang --prefix=/opt/freeswitch --exec_prefix=/opt/freeswitch | |
... | |
setting PLATFORM_CORE_LDFLAGS to "--framework CoreFoundation" | |
setting PLATFORM_CORE_LIBS to "-ldl" | |
checking for inflateReset in -lz... no | |
configure: error: no usable zlib; please install zlib devel package or equivalent | |
FIX: |
This file contains hidden or 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
sudo setcap cap_net_bind_service+ep ./erts-5.9.2/bin/beam | |
sudo setcap cap_net_bind_service+ep ./erts-5.9.2/bin/beam.smp |
This file contains hidden or 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
R = #record{}. | |
lists:zip(record_info(fields, record), tl(tuple_to_list(R))). |
NewerOlder