Skip to content

Instantly share code, notes, and snippets.

@jonnystorm
jonnystorm / demo.ex
Created January 5, 2015 21:29
Demonstrate surprising Dialyzer warning for list comprehension
defmodule Demo do
def test1a, do: [1]
def test1b(x) do
# demo.ex:6: The created fun has no local return
for e <- test1a, do: x
end
def test2a, do: 1

Keybase proof

I hereby claim:

  • I am jonnystorm on github.
  • I am jonnystorm (https://keybase.io/jonnystorm) on keybase.
  • I have a public key whose fingerprint is EB6A 4CD3 D263 8F61 42A6 06FA DF31 97A3 CF5B CF50

To claim this, I am signing this object:

We couldn’t find that file to show.
We couldn’t find that file to show.
@jonnystorm
jonnystorm / PKGBUILD.patch
Created August 7, 2016 00:02
AUR lib32-tcl 8.6.5-1 -> 8.6.6 PKGBUILD patch
diff --git a/PKGBUILD b/../aur/lib32-tcl/PKGBUILD
index 787f60c..a954992 100644
--- a/PKGBUILD
+++ b/../aur/lib32-tcl/PKGBUILD
@@ -4,7 +4,7 @@
_pkgbasename=tcl
pkgname=lib32-${_pkgbasename}
-pkgver=8.6.5
+pkgver=8.6.6
We couldn’t find that file to show.
We couldn’t find that file to show.
! Much of ASA syntax is ambiguous, over-determined, or just plain confused.
! Below is one such example.
!
! Name two interfaces using the real/mapped interface delimiter, ','.
! In general, ASA accepts a shocking variety of characters for names.
! Keywords are unreserved.
! Only naming conflicts occur with built-in objects.
!
ASA(config)# int po1.22
ASA(config-subif)# vlan 22
@jonnystorm
jonnystorm / gist:7136bff23cca0f84219d6cd4cdaeabfc
Last active March 28, 2017 15:10
Resolve MIB name to OID in Elixir
# Change MIB extensions from .txt to .mib
copy -r /usr/share/snmp/mibs /home/jstorm/mibs
cd /home/jstorm/mibs
rename '\.txt$' .mib *
# Replace instances of RowStatus with INTEGER in MIBs.
# Otherwise, expect compilation errors.
# Compile dependencies before target MIB (IP-FORWARD-MIB, in this case).
iex> :snmpc.compile('IANAifType-MIB', [i: ['/home/jstorm/mibs']])
@jonnystorm
jonnystorm / gist:aa39a241a375975ce78b2a390fdf991f
Created March 24, 2017 20:24
USM engineId discovery - false starts
iex> SNMP.start
{:ok, #PID<0.175.0>}
iex> cred = SNMP.credential [:v3, :no_auth_no_priv, "admin"]
[version: :v3, sec_model: :usm, sec_level: :noAuthNoPriv, sec_name: 'admin']
iex> SNMP.get([1,3,6,1,2,1,1,5,0], URI.parse("snmp://192.0.2.3"), cred)
14:30:12.544 [debug] Will register agent snmp://192.0.2.3 with target [130, 219, 114, 183, 132, 30, 20, 148, 117, 155, 154, 175, 231, 194, 102, 115, 99, 57, 90, 71] and config [engine_id: [128, 0, 0, 0, 6], address: [192, 0, 2, 3], port: 161, tdomain: :transportDomainUdpIpv4, version: :v3, sec_model: :usm, sec_level: :noAuthNoPriv, sec_name: 'admin'].