Skip to content

Instantly share code, notes, and snippets.

View elcritch's full-sized avatar

Jaremy Creechley elcritch

View GitHub Profile
@elcritch
elcritch / RemoteIExNode.exs
Created October 14, 2019 05:53
Establish an IEx shell to another node in a Elixir Node (Erlang Node)
iex(node-a@192.168.1.2)1> Node.list()
[:"node-b@192.168.1.3"]
iex(node-a@192.168.1.2)1> :rpc.call :"node-b@192.168.1.3", IEx, :start, []
defmodule Cluster.Strategy.BroadcastGossip do
@moduledoc """ Here's the module I made for libcluster that uses local network broadcasting. Useful for nerves local devices. """
require Logger
use GenServer
use Cluster.Strategy
alias Cluster.Strategy.State
@default_ifname "eth0"
@default_port 45893
@elcritch
elcritch / step00-howto.md
Last active May 2, 2018 18:14
Download and Compile Updated PulseView
  1. Download and save scripts "step01-" and "step02-".
  2. Change to sudo / root
  3. Execute scripts step01* and then step02*
@elcritch
elcritch / application.ex
Created September 15, 2017 00:05
Example task supervisor using a function handle in Elixir (nerves example)
require Logger
defmodule TestNpn.Application do
use Application
alias Nerves.Networking
@interface :eth0
@elcritch
elcritch / rancher-zerotier.yml
Last active July 24, 2019 13:12
Run ZeroTier on RancherOS
#cloud-config
rancher:
services:
zerotier:
image: zerotier/zerotier-containerized:1.2.4
labels:
io.rancher.os.scope: system
volumes:
- /var/lib/zerotier-one:/var/lib/zerotier-one
restart: always
### Keybase proof
I hereby claim:
* I am elcritch on github.
* I am elcritch (https://keybase.io/elcritch) on keybase.
* I have a public key ASASCJtnU3IMLH8bOK9NLa1eHUQxMm2uzyItyqtAP-80lQo
To claim this, I am signing this object:
[root@johnny-no-5 (hq) ~]# dmesg | grep bnx1
2016-09-25T22:53:03.543456+00:00 johnny-no-5 mac: [ID 469746 kern.info] NOTICE: bnx1 registered
2016-09-25T22:53:03.543467+00:00 johnny-no-5 pcieb: [ID 586369 kern.info] PCIE-device: pci1028,235@0,1, bnx1
2016-09-25T22:53:03.543471+00:00 johnny-no-5 npe: [ID 236367 kern.info] PCI Express-device: pci1028,235@0,1, bnx1
2016-09-25T22:53:03.543476+00:00 johnny-no-5 genunix: [ID 936769 kern.info] bnx1 is /pci@0,0/pci8086,3408@1/pci1028,235@0,1
2016-09-25T22:53:03.543480+00:00 johnny-no-5 bnx: [ID 219732 kern.info] NOTICE: bnx1: (6.0.3) BCM5709 device with F/W Ver5020003 is initialized (1 MSIX)
2016-09-25T22:53:03.543763+00:00 johnny-no-5 bnx: [ID 328528 kern.info] NOTICE: bnx1: Copper link is up (1000Mbps, Full Duplex, Tx & Rx Flow Control ON)
2016-09-25T22:53:03.543766+00:00 johnny-no-5 bnx: [ID 328528 kern.info] NOTICE: bnx1: Copper link is down
2016-09-25T22:53:03.543769+00:00 johnny-no-5 mac: [ID 435574 kern.info] NOTICE: bnx1 link up, 0 Mbps, half duplex
2016-09-2

Creating a Youtube Widget

@elcritch
elcritch / json-hack2.js
Last active April 20, 2016 00:58
Hacked Json Viewer
function codify() {
$('span.out:contains("{"):not(.json-parsed)').each(function() {
var text = $(this).ignore().text();
var nodes = $(this).find("*").clone();
var res = text.replace(/(\{.+\})/, function (x) {
var s = '</span><code class="lang-json">';
s += "" + x + "";
s += '</code><br><span class="non-code">';
return s ;
});
@elcritch
elcritch / json-hack.js
Last active July 25, 2016 01:57
JSON viewer hack
function codify() {
$('span:contains("{")').each(function() {
var text = $(this).ignore().text();
var nodes = $(this).find("*").clone();
var res = text.replace(/(\{.+\})/, function (x) {
var s = '</span><code class="lang-json">';
s += "" + x + "";
s += '</code><br><span class="non-code">';
return '<span class="non-code">' + s + '</span>';