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
pong = net_adm:ping(node()). |
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
for i in `seq 1 5`; do erl -sname n${i} -noshell -eval 'io:format("~p~n", [erlang:md5(term_to_binary(lists:foldl(fun(I, Acc) -> Acc#{{abc, I} => I} end, #{}, lists:seq(1,100))))]), init:stop().' ; done | |
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>> | |
<<208,100,35,243,94,225,254,14,159,222,67,32,242,134,182,171>> | |
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>> | |
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>> | |
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>> | |
What's up? |
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
dropbox stop | |
# | |
# Pretent Dropbox is running | |
# See 'is_dropbox_running' function | |
# Simulate 'dropbox' string in /proc/%d/cmdline | |
# | |
bash -c 'read dropbox' & | |
6103 |
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
%?ERROR("ERROR: load_lrn(nil, Opts)~n", [Action, Opts]), |
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
Re: [erlang-questions] gproc and gen_event | |
Of course, for a distributed pub/sub, you don't really need to turn on | |
the distributed parts of gproc. Running a local gproc instance on each | |
node, you can publish like so: | |
publish(Event, Data) -> | |
rpc:eval_everywhere( | |
gproc, send, | |
[{p, l, {?MODULE, Event}}, {?MODULE, Event, Data}]). |
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
-define(TIME(Call), | |
(fun() -> | |
{Time, Value} = timer:tc(fun() -> Call end), | |
io:format("Call: ~s took: ~p ms~n", [??Call, Time/1000]), | |
Value | |
end)() | |
). | |
In the code: | |
... |
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
LOCAL | |
===== | |
$ scp util.es remote:/home/user/ | |
REMOTE | |
====== | |
$ pwd | |
/home/user | |
$ ./util.es |
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
$ ./main.sh | |
erl: started. | |
erl: working... | |
erl: working... | |
erl: working... | |
^Cerl: working... | |
erl: stopped. |
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
awk '{ print $0 } END { print "." }' |
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
$ fc-match "open sans" | |
DejaVuSans.ttf: "DejaVu Sans" "Book" | |
$ mkdir -p ~/.fonts | |
$ cd ~/.fonts | |
# download google fonts downloader, make it executable | |
$ wget https://raw.githubusercontent.com/neverpanic/google-font-download/master/google-font-download | |
$ chmod +x google-font-download |