Skip to content

Instantly share code, notes, and snippets.

View seriyps's full-sized avatar

Sergey Prokhorov seriyps

View GitHub Profile
-module(gen_tcp2).
-export([listen/2, accept/1, accept/2,
connect/3, connect/4,
send/2, recv/1, recv/2, recv/3,
close/1]).
-export([run/0, run/2]).
%% Naive gen_tcp shim over the socket API
@mkorthof
mkorthof / ipset-country.md
Last active May 5, 2023 00:28
Block countries using iptables + ipset + ipdeny.com -> moved to https://github.com/mkorthof/ipset-country
-module(string_eqc).
-compile([export_all,nowarn_export_all]).
-include_lib("eqc/include/eqc.hrl").
%%%
%%% Test most new functions in the new string module (PR #1330).
%%%
flat_chardata() ->
@tsloughter
tsloughter / e.md
Last active November 4, 2016 01:59
Erlang/OTP libraries/modules replaced by third party projects

I'm looking to collect information on why certain functionality found in Erlang/OTP is usually handled instead by a third party library in people's projects.

This could be bugs, missing functionality, poor interface, performance, etc.

Examples off the top of my head that need expanding on are:

  • httpc
  • httpd
  • http_uri
@essen
essen / http_specs.md
Last active January 10, 2022 02:01
HTTP and related specifications
@KonradIT
KonradIT / Hero4BlackWifi.md
Last active March 15, 2023 15:15
Wifi hacking for HERO4 Black
@tsloughter
tsloughter / erl_nif.rs
Created September 28, 2014 02:18
Erlang Nif Rust Bindings
/* automatically generated by rust-bindgen */
pub type ErlNifUInt64 = ::libc::c_ulong;
pub type ErlNifSInt64 = ::libc::c_long;
pub type ERL_NIF_TERM = ::libc::c_ulong;
pub type ERL_NIF_UINT = ERL_NIF_TERM;
pub enum Struct_enif_environment_t { }
pub type ErlNifEnv = Struct_enif_environment_t;
#[repr(C)]
pub struct ErlNifFunc {
@LeebDeveloper
LeebDeveloper / niftest.erl
Created June 30, 2014 15:25
Erlang NIF in pure Rust
-module(niftest).
-export([add/2]).
-on_load(init/0).
init() ->
ok = erlang:load_nif("./nif", 0).
add(_, _) ->
exit(nif_library_not_loaded).
@slfritchie
slfritchie / presentation.md
Created March 18, 2014 09:22
Erlang tracing, for the Riak source code reading series, 2014-03-18, Tokyo, Japan

Erlang Tracing: more than you wanted to know

Rough Outline

  • What can be traced?
  • How can trace events be specified?
  • "match specifications": twisty passages, all alike
  • WTF, can I just use DTrace and drink my coffee/beer/whisky in peace?
  • Trace delivery mechanisms: pick one of two
@proger
proger / netstat.erl
Created November 22, 2012 16:39
netstat for erlang gen_tcp
-module(netstat).
-compile([export_all]).
-record(sock, {port, local, peer, stat, proc}).
retinfo({State, Term}) when is_atom(State) ->
Term.
sockinfo(Port, PortInfo) ->
Proc = proplists:get_value(connected, PortInfo),