Skip to content

Instantly share code, notes, and snippets.

//gcc -O3 -fpic -shared -I/usr/lib/erlang/usr/include/ nif_tcp.c -o nif_tcp.so
#include "erl_nif.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
@vans163
vans163 / lsyncd_example
Created June 29, 2019 13:56
using lsyncd instead of sshfs
git clone https://github.com/axkibe/lsyncd
apt-get install cmake liblua5.3-dev lua5.3
git apply << EOF
diff --git a/default-rsync.lua b/default-rsync.lua
index 106c58d..8157c26 100644
--- a/default-rsync.lua
+++ b/default-rsync.lua
@@ -669,7 +669,7 @@ end
apt-get install build-essential autoconf libncurses-dev m4 libssl-dev xsltproc libxml2-utils unixodbc-dev
mkdir -p /root/source
git clone https://github.com/erlang/otp /root/source/otp
cd /root/source/otp && ./otp_build autoconf && ./configure --enable-lock-counter && make -j$(nproc) && make install
git clone https://github.com/elixir-lang/elixir.git /root/source/elixir
cd /root/source/elixir && make clean && make install
mix local.hex --force && mix local.rebar --force
FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL
-----
IO... yuv420p 3 12
IO... yuyv422 3 16
IO... rgb24 3 24
IO... bgr24 3 24
IO... yuv422p 3 16
IO... yuv444p 3 24
IO... yuv410p 3 9
IO... yuv411p 3 12