Skip to content

Instantly share code, notes, and snippets.

View joaohf's full-sized avatar

João Henrique Ferreira de Freitas joaohf

  • Campinas, Brazil
View GitHub Profile
@joaohf
joaohf / gist:bb5b3966de545a6f8cf70e3697712c0c
Created November 8, 2023 20:57
rebar3 with private hexpm
In order to create a private hexpm follow the steps from: https://hex.pm/docs/self-hosting
Once you get the file server running, it's time to configure your rebar.config like the following:
```
{erl_opts, [debug_info]}.
{deps, [decimal, relsyncd]}.
{shell, [
% {config, "config/sys.config"},
meta-erlang talk. It's not about metaprogramming. meta-erlang is an opensource project that helps
building embedded products based on Yocto Project and Linux kernel. It might sounds a bit disconnected
but when we consider the full product (hardware + software or only software) lifecycle it makes a lot of sense.
We will discuss Erlang and the BEAM context into Linux embedded world. How is it possible to create
a full stack solution (from a linux distro up an application written in any BEAM language) ?.
Moreover, how could a group of developers create a SDK (Software Development Kits) within all components needed
(compilers, libraries, etc) ?. The talk also covers some additional subjects like Erlang/OTP building steps for embedded;
challenges on testing and patching OTP; some exta patches tailored for embedded tweaks; building for multiplatform;
not only for embedded context but also for building services for cloud environments like Amazon Graviton instances.
Worth mention some other possibilities like runnin
@joaohf
joaohf / mix.exs
Last active November 2, 2020 20:38
ex_docs with mermaid support
def project do
[
...
docs: docs(),
...
]
end
defp docs do
[
@joaohf
joaohf / gist:c77f1046e4e3a1c1b911501333f5de90
Created October 7, 2019 17:41
Running qemu instances
cp /home/joaohf/work/opensource/meta/meta-erlang/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86.ext4 /tmp/core-image-minimal-qemux86.ext4.0
cp /home/joaohf/work/opensource/meta/meta-erlang/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86.ext4 /tmp/core-image-minimal-qemux86.ext4.1
cp /home/joaohf/work/opensource/meta/meta-erlang/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86.ext4 /tmp/core-image-minimal-qemux86.ext4.2
sudo ../poky/scripts/runqemu-gen-tapdevs 1000 1000 6 tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin/
sudo /home/joaohf/work/opensource/meta/meta-erlang/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386 -device virtio-net-pci,netdev=net1,mac=52:54:00:12:34:03 -netdev tap,id=net1,ifname=tap2,script=no,downscript=no -drive file=/tmp/core-image-minimal-qemux86.ext4.0,if=virtio,format=raw -vga vmware -show-cursor -usb -device usb-tablet -device virtio-rng-pci -cpu pentium2 -enable-kvm -m 256 -serial m
environment :prod do
# MIX_TARGET_INCLUDE_ERTS is set by meta-erlang/classes/mix.bbclass
set include_erts: System.get_env("MIX_TARGET_INCLUDE_ERTS")
set include_src: false
set cookie: :"d.K@rG|YpY`|?i&]Fsdljji)JMhk)%j)}f|Y6cquU!He<]u=sHp`.o2p[I3ee]gD"
set vm_args: "rel/vm.args"
end
{relx, ...
{include_erts, true},
{system_libs, true},
...
}.
REBAR3_PROFILE ?= ""
REBAR3_RELEASE_NAME ?= "${BPN}-${@get_erlang_release("${PV}")}"
export REBAR3_TARGET_INCLUDE_ERTS = "${STAGING_LIBDIR}/erlang"
export REBAR3_TARGET_SYSTEM_LIBS = "${STAGING_LIBDIR}/erlang"
export ERLANG_ERTS = "$(erl -version 2>&1 | gawk '{print $NF}' | tr -d '\n\r')"
ReplaceIncludeErts =
fun(Path, Config) ->
ReplaceRelx(include_erts, Path, Config)
end,
ReplaceSystemLibs =
fun(Path, Config) ->
ReplaceRelx(system_libs, Path, Config)
end,