Skip to content

Instantly share code, notes, and snippets.

@fxmy
fxmy / vm.args
Created April 23, 2017 15:27
heart config for starting erlang release under authbind
-heart -env HEART_COMMAND "authbind --deep /path/to/release/bin/<APP> start"
@fxmy
fxmy / output
Created April 11, 2017 10:30
get_tcp packet opt
Eshell V8.3.1 (abort with ^G)
1>
1>
1>
1> test:s().
SERVER GOT <<131,107,0,9,83,111,109,101,32,68,97,116,97>>
"Some Data"
2>
==========================================
@fxmy
fxmy / erlang.log.1
Created March 11, 2017 05:10
snmpc: LLDP-MIB.mib fail to compile
This file has been truncated, but you can view the full file.
=====
===== LOGGING STARTED Sat Mar 11 10:19:35 CST 2017
=====
Erlang/OTP 19 [erts-8.2.1] [source-7f52af8] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.2.1 (abort with ^G)
1>  1> snmpc:compile("LLDP-MIB.mib",[{verbosity,trace}]).
[LLDP-MIB.mib][snmpc:442][TRC]: Syntax analysis:
PData: {pdata,v2_mib,'LLDP-MIB',
var xhr = new XMLHttpRequest(); xhr.open("POST", "https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyAAbNcNrZoGgi8YMdZ98Z3UGPXxM8PsbBU", true); xhr.setRequestHeader("Content-type", "application/json"); xhr.onreadystatechange = function () { if (xhr.readyState == 4 && xhr.status == 200) { console.log(xhr.responseText); } else {console.log(xhr.responseText);} };
xhr.send("{}");
@fxmy
fxmy / 82ff66d
Last active September 22, 2015 08:33
Strange behavior in Opera 12.16
=INFO REPORT==== 22-Sep-2015::15:19:25 ===
n2o_nitrogen:Pickle: {pickle,<<"loginButton">>,
<<"g2gCaAVkAAJldmQABWxvZ2luZAAFbG9naW5rAAtsb2dpbkJ1dHRvbmQABWV2ZW50aANiAAAFomIADdR3YgAEU8A=">>,
[{{"loginButton",<<"detail">>},[]},
{user,[]},
{pass,[]}]}
=INFO REPORT==== 22-Sep-2015::15:19:25 ===
login:User: "anonymous"
%% Time={A,B,C}
%% Latitude = -90..90
%% Longtitude = -180..180
{achievement, Time, Latitude, Longtitude, Content}.
{comment, Time, Comment}.
{cookie, Public, Private}.
base64:encode( crpto:strong_rand_bytes(N)).
struct erl_module_instance {
BeamInstr* code;
int code_length;>--->-------/* Length of loaded code in bytes. */
unsigned catches;
struct erl_module_nif* nif;
int num_breakpoints;
int num_traced_exports;
};
typedef struct erl_module {
@fxmy
fxmy / ert_term.h
Last active August 29, 2015 14:20
#define _TAG_PRIMARY_SIZE>------2
#define _TAG_PRIMARY_MASK>------0x3
#define TAG_PRIMARY_HEADER>-----0x0
#define TAG_PRIMARY_LIST>-------0x1
#define TAG_PRIMARY_BOXED>------0x2
#define TAG_PRIMARY_IMMED1>-----0x3
#define primary_tag(x)>-((x) & _TAG_PRIMARY_MASK)
#define _TAG_IMMED1_SIZE>-------4
@fxmy
fxmy / sys.h
Created May 10, 2015 01:43
bits in otp source
** Data types:
226 **
227 ** Eterm: A tagged erlang term (possibly 64 bits)
228 ** BeamInstr: A beam code instruction unit, possibly larger than Eterm, not smaller.
229 ** UInt: An unsigned integer exactly as large as an Eterm.
230 ** SInt: A signed integer exactly as large as an eterm and therefor large
231 ** enough to hold the return value of the signed_val() macro.
232 ** UWord: An unsigned integer at least as large as a void * and also as large
233 ** or larger than an Eterm
234 ** SWord: A signed integer at least as large as a void * and also as large