This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Mix.Tasks.Firmware.Reload do | |
@moduledoc """ | |
Used to reload OTP apps or modules on a | |
remove erlang node. | |
""" | |
use Mix.Task | |
@app :firmware | |
@switches [ | |
app: :keep, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import the opencv library | |
import cv2 | |
import erlang, os, struct | |
# define a video capture object | |
vid = cv2.VideoCapture(0) | |
AtomOk = erlang.OtpErlangAtom(bytes("ok", "utf-8")) | |
AtomErr = erlang.OtpErlangAtom(bytes("error", "utf-8")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule DoubleDNS do | |
@moduledoc "DoubleDNS" | |
use GenServer | |
require Logger | |
@mdns_group {224, 0, 0, 251} | |
@mdns_port 5353 | |
@dns_port 53 | |
defmodule State do | |
defstruct multicast_if: nil, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MDNSClient do | |
defmodule Device do | |
defstruct ip: nil, | |
services: [], | |
domain: nil, | |
payload: %{} | |
end | |
use GenServer | |
@mdns_group {224, 0, 0, 251} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtTSUeHLIUtkYAT9Cw8e+lE8iFsVFa20AtKjXovZesQoRg2F347ivuyFXaI+91O1qi067KPn+j3jw42gdlnqX0R4DhyW0qYH69biZTQjQfq8tLT7c7VPyxOsDxXXceORnx9s0dRsy4ZiHB56/Ffz+eAzsbOEfwlwdJDkn1oiSbHSFv5HW1/agzlzV6M+nfD6As6ZIwAysw5PROfF6ikbG+UwcOAgG+d1RZDR2BTzedQrKEwYM5SiFYyqt7bQFj7BHKtkB9T4CsyU+Y1ORptFNoVyluQkaY9bTptTkj/PpWt2sntd8zKfwRHa7ysRTCWzN4XWIUWfOJsbe577ghN6Lh connor@connor-mini-pc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def worker_spec(%kind{local_id: id, monitor: false} = asset) do | |
%{ | |
id: id, | |
start: {Task, :start_link, [fn() -> IO.puts "Not starting asset worker: #{kind}.#{id}" end]}, | |
restart: :transient | |
} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Meshy.DNS do | |
use GenServer | |
@mdns_group {224, 0, 0, 251} | |
@mdns_port Application.get_env(:mdns, :port, 5353) | |
@dns_port 53 | |
defmodule State do | |
defstruct multicast_if: nil, | |
mdns_socket: nil, | |
mdns_entries: [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Pyport do | |
@pool_size 10 | |
@external_resource "pyport.py" | |
use GenServer | |
def start_link(args, opts \\ [name: __MODULE__]) do | |
GenServer.start_link(__MODULE__, args, opts) | |
end | |
def echo(pid \\ __MODULE__, data) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtTSUeHLIUtkYAT9Cw8e+lE8iFsVFa20AtKjXovZesQoRg2F347ivuyFXaI+91O1qi067KPn+j3jw42gdlnqX0R4DhyW0qYH69biZTQjQfq8tLT7c7VPyxOsDxXXceORnx9s0dRsy4ZiHB56/Ffz+eAzsbOEfwlwdJDkn1oiSbHSFv5HW1/agzlzV6M+nfD6As6ZIwAysw5PROfF6ikbG+UwcOAgG+d1RZDR2BTzedQrKEwYM5SiFYyqt7bQFj7BHKtkB9T4CsyU+Y1ORptFNoVyluQkaY9bTptTkj/PpWt2sntd8zKfwRHa7ysRTCWzN4XWIUWfOJsbe577ghN6Lh connor@connor-mini-pc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require-fwup-version="0.15.0" # For the trim() call | |
# | |
# Firmware metadata | |
# | |
# All of these can be overriden using environment variables of the same name. | |
# | |
# Run 'fwup -m' to query values in a .fw file. | |
# Use 'fw_printenv' to query values on the target. |