mini code and tools

on startup:

./.erlang
$HOME/.erlang

From http://mryufeng.iteye.com/blog/pdf
引用
io:format("~s~n", [binary_to_list(erlang:system_info(info))]).
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
ethtool -S eth0
inet:i().
ets:i().
erts_debug:set_internal_state(available_internal_state, true).

slave
pool
erl_boot_server
shell


timer:tc(MFA)

Alg+g
> h

random
timer

%% -define(debug, true).

-ifdef(debug).
-define(INFOMSG(X), error_logger:info_msg("{~p,~p}: ~p~n", [?MODULE, ?LINE, X])).
-else.
-define(INFOMSG(X), true).
-endif.

-ifdef(debug).
-define(LOG(X), io:format("{~p,~p}: ~p~n", [?MODULE,?LINE,X])).
-else.
-define(LOG(X), true).
-endif.

-record(verid,  {id = 0, version = 0}).
-record(diskid, {id = 0, version = 0}).
-record(chkid,  {id = 0, version = 0}).
-record(fileid, {id = 0, version = 0}).

-record(mdp_chkget_req, {
        chkid  = #chkid{} :: #chkid{},
        chkno  = 0        :: integer(),
        chkrep = 0        :: integer(),
        chklen = 0        :: integer()
    }).
-record(mdp_chkget_rep, {
        chkid  = #chkid{} :: #chkid{}, 
        chkrep = 0        :: integer(), 
        disks  = []       :: list()
    }).

-record(mdp_chkload_req, {
        chkid  = #chkid{} :: #chkid{},
        chkno  = 0        :: integer(),
        chkrep = 0        :: integer(),
        chklen = 0        :: integer()
    }).
-record(mdp_chkload_rep, {
        chkid  = #chkid{} :: #chkid{}, 
        chkrep = 0        :: integer(), 
        disks  = []       :: list()
    }).

你可能感兴趣的:(erlang,Blog)