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;
[Unit]
Description=WFB-CLI on tty1
After=getty.target
Conflicts=getty@tty1.service
[Service]
Type=simple
ExecStart=/usr/bin/wfb-cli gs
ExecStop=/bin/kill -HUP ${MAINPID}
\documentclass[a4paper,11pt]{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{cmap} % для кодировки шрифтов в pdf
$if(listings)$
\usepackage{listings}
\newcommand{\passthrough}[1]{#1}
$endif$
#!/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"]),
ensure_epmd_is_working(),
Names = case net_adm:names("server.l") of
{error, _} -> [];
-module(reconfigurable_supervisor_SUITE).
-compile(nowarn_export_all).
-compile(export_all).
% 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)
%
-module(type_mapper_SUITE).
-compile(nowarn_export_all).
-compile(nowarn_unused_record).
-compile(nowarn_unused_type).
-compile(export_all).
-compile({parse_transform,type_mapper}).
all() ->
[{group, from_json}].
#!/bin/sh
# How to prepare your linux box to run ARM64 images in docker
# https://codepyre.com/2019/12/arming-yourself/
wget https://download.qemu.org/qemu-4.2.0.tar.xz
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>
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 <awa...@radix.net>
*
* Partially based on cx18-dvb.c driver code
* Copyright (C) 2008 Steve Toth <st...@kernellabs.com>
*
* 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
-module(events_sink).
-export([start_link/2]).
-export([init/1, handle_info/2, handle_call/3, terminate/2]).
-export([overloaded/1]).
-include("event_pt.hrl").
-define(RECHECK_INTERVAL, 200).
-define(ALLOWED_DELAY, 60000).