Skip to content

Instantly share code, notes, and snippets.

@lemmi
lemmi / gist:c484ab5ec60d227393d5ac9d6ed645b5
Created October 13, 2020 17:12
ER-12 Vitesse VSC8514
root@ubnt:/sys/bus/mdio_bus/drivers/Vitesse VSC8514# ls -l
total 0
lrwxrwxrwx 1 root root 0 Oct 13 17:09 8001180000001800:08 -> ../../../../devices/soc.0/1180000001800.mdio/8001180000001800:08
lrwxrwxrwx 1 root root 0 Oct 13 17:09 8001180000001800:09 -> ../../../../devices/soc.0/1180000001800.mdio/8001180000001800:09
lrwxrwxrwx 1 root root 0 Oct 13 17:09 8001180000001800:0a -> ../../../../devices/soc.0/1180000001800.mdio/8001180000001800:0a
lrwxrwxrwx 1 root root 0 Oct 13 17:09 8001180000001800:0b -> ../../../../devices/soc.0/1180000001800.mdio/8001180000001800:0b
--w------- 1 root root 4096 Oct 13 17:09 bind
lrwxrwxrwx 1 root root 0 Oct 13 17:09 module -> ../../../../module/ubnt_platform
--w------- 1 root root 4096 Oct 13 17:09 uevent
--w------- 1 root root 4096 Oct 13 17:09 unbind
@lemmi
lemmi / edgeOS
Last active October 13, 2020 12:40
ER-12 dts
root@ubnt:/home/ubnt# dtc -I fs -O dts /proc/device-tree/
Warning (unit_address_vs_reg): Node /soc@0 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but no unit name
/dts-v1/;
/ {
interrupt-parent = <0x1>;
#size-cells = <0x2>;
#address-cells = <0x2>;
compatible = "cavium,ubnt_e300";
@lemmi
lemmi / ER-12
Last active October 11, 2020 21:45
ER-12
system type : UBNT_E300
machine : Unknown
processor : 0
cpu model : Cavium Octeon III V0.2 FPU V0.0
BogoMIPS : 2000.00
wait instruction : yes
microsecond timers : yes
tlb_entries : 256
extra interrupt vector : yes
hardware watchpoint : yes, count: 2, address/irw mask: [0x0ffc, 0x0ffb]
@lemmi
lemmi / hoodconnect.sh
Created July 29, 2020 11:25
connect to any freifunk franken hood
#!/bin/bash
KEYSRV_URL="https://keyserver.freifunk-franken.de/v2"
KEYSRV_URL_HOODS="${KEYSRV_URL}/hoods.php"
KEYSRV_URL_HOODFILE="${KEYSRV_URL}/index.php?hoodid="
TMP_DIR=$(mktemp -d)
cleanup() {
rm -R "${TMP_DIR}"
@lemmi
lemmi / main.zig
Created July 6, 2020 12:00
zig 0.6.0 hashmap + smap benchmark, no preallocation
const std = @import("std");
const smap = @import("smap.zig");
const AutoHashMap = std.AutoHashMap;
const time = std.time;
const Allocator = std.mem.Allocator;
const io = std.io;
fn step(x: u64) u64 {
if (x & 1 > 0) {
return 3 * x + 1;
@lemmi
lemmi / main.zig
Created July 6, 2020 08:49
zig 6.0 hashmap + smap benchmark
const std = @import("std");
const smap = @import("smap.zig");
const AutoHashMap = std.AutoHashMap;
const time = std.time;
fn step(x: u64) u64 {
if (x & 1 > 0) {
return 3 * x + 1;
} else {
return x / 2;
@lemmi
lemmi / main.zig
Created July 4, 2020 15:56
swiss hash map in zig
const std = @import("std");
const math = std.math;
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const testing = std.testing;
const Wyhash = std.hash.Wyhash;
const autoHash = std.hash.autoHash;
const meta = std.meta;
pub fn Map(comptime K: type, comptime V: type, comptime hash: fn (key: K) u32, comptime eql: fn (a: K, b: K) bool, comptime groupsize: u32) type {
@lemmi
lemmi / dhcp.txt
Created May 31, 2020 20:08
ps -aux | grep dhcpcd
ps -aux | grep dhcpcd
_dhcpcd 660 0.0 0.0 2860 332 ? S Mai24 0:00 dhcpcd: [network proxy] wwww:xxxx:yyyy:zzzz:54a1:533f:bea8:dbd0
_dhcpcd 913 0.0 0.0 2860 416 ? S Mai30 0:00 dhcpcd: [network proxy] wwww:xxxx:yyyy:zzzz:c812:8870:709c:13c7
root 957 0.0 0.0 2860 2412 ? S Mai24 0:00 dhcpcd: [launcher]
root 992 0.0 0.0 2172 752 ? Ss Mai24 0:00 runsv dhcpcd-eth0
_dhcpcd 1030 0.0 0.0 2860 1840 ? S 10:36 0:00 dhcpcd: [network proxy] wwww:xxxx:yyyy:zzzz:a0a5:507e:ba4e:69a0
_dhcpcd 1040 0.0 0.0 2860 384 ? S Mai28 0:00 dhcpcd: [network proxy] wwww:xxxx:yyyy:zzzz:e5ba:3b01:ca93:9d9f
_dhcpcd 1047 0.0 0.0 2948 2192 ? S Mai24 0:08 dhcpcd: f3 [ip4] [ip6]
root 1048 0.0 0.0 2860 1728 ? S Mai24 0:02 dhcpcd: [privileged actioneer]
_dhcpcd 1049 0.0 0.0 2864 1540 ? S Mai24 0:02 dhcpcd: [network proxy]
@lemmi
lemmi / babel.svg
Created May 31, 2020 19:28
babeld-1.9.2 flamegraph
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/sh
DEV=${1:-vxlan0}
handle_add() {
mac="${1:?}"
dev="${2:?}"
dst="${3:?}"
echo "bridge fdb append 00:00:00:00:00:00 dst $dst dev $dev"