Skip to content

Instantly share code, notes, and snippets.

#include <sys/mman.h>
#include <sys/stat.h>
#include <erl_nif.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <fcntl.h>
static ErlNifResourceType* shmem_resource;
Description=WFB-CLI on tty1
ExecStart=/usr/bin/wfb-cli gs
ExecStop=/bin/kill -HUP ${MAINPID}
\usepackage{cmap} % для кодировки шрифтов в pdf
#!/usr/bin/env escript
%%! -env ERL_LIBS _build/default/lib
main(Args) ->
inet_db:set_lookup([file, dns]),
inet_db:add_host({127,0,0,1}, ["server.l"]),
Names = case net_adm:names("server.l") of
{error, _} -> [];
% This test is checking modified supervisor code that can do hot reconfiguration of whole tree.
% Idea is following: our processes configuration should be dependent from start args.
% If we want to reconfigure process on fly, we should change his start args (just like we do in React.js)
all() ->
[{group, from_json}].
# How to prepare your linux box to run ARM64 images in docker
tar xf qemu-4.2.0.tar.xz
cd qemu-4.2.0
apt install -y bison flex build-essential libglib2.0-dev libpixman-1-dev qemu binfmt-support
./configure --target-list=aarch64-linux-user,arm-linux-user --static
1> {ok, Socket} = gen_tcp:connect("localhost", 80, [binary, {active,false}, {packet,http},inet]),
1> ok = gen_tcp:send(Socket, "GET /crossdomain.xml HTTP/1.0\r\n\r\n"),
1> LoopHeaders = fun LoopHeaders(Len) ->
1> case gen_tcp:recv(Socket, 0) of
1> {ok, http_eoh} ->
1> inet:setopts(Socket, [{packet,raw}]),
1> Len;
1> {ok, {http_header,_,'Content-Length',_, Len_}} ->
1> LoopHeaders(list_to_integer(Len_));
* Dummy DVB adapter driver
* Copyright (C) 2010 Andy Walls <>
* Partially based on cx18-dvb.c driver code
* Copyright (C) 2008 Steve Toth <>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
-export([init/1, handle_info/2, handle_call/3, terminate/2]).
-define(RECHECK_INTERVAL, 200).
-define(ALLOWED_DELAY, 60000).