Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / wol.sh
Last active October 19, 2020 23:52
WOL with openwrt basic tools
#!/bin/sh
# see https://en.wikipedia.org/wiki/Wake-on-LAN#Magic_packet
MAGIC="\xFF\xFF\xFF\xFF\xFF\xFF"
MAC=${1:?"No mac address"}
MACHEX="\x$(echo $MAC | sed -e 's/:/\\x/g')"
netmsg 255.255.255.255 $(printf "$MAGIC$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX$MACHEX")
@lemmi
lemmi / edgeOS.dts
Created October 20, 2020 06:26
ERPro-8 DTS
/dts-v1/;
/ {
compatible = "ubnt,e200";
model = "ubnt,e200";
interrupt-parent = <0x1>;
#address-cells = <0x2>;
#size-cells = <0x2>;
soc@0 {
@lemmi
lemmi / er-4.dts
Created October 20, 2020 18:39
er-4 dts
/dts-v1/;
/ {
compatible = "cavium,ubnt_e300";
model = "cavium,ubnt_e300";
interrupt-parent = <0x1>;
#address-cells = <0x2>;
#size-cells = <0x2>;
soc@0 {
@lemmi
lemmi / bootlog
Last active October 21, 2020 06:08
er-pro
Jumping to start of image at address 0xbfca0000
U-Boot 2012.04.01 (UBNT Build Version: e200_002_80eda) (May 27 2019 - 06:34:56)
Skipping PCIe port 0 BIST, in EP mode, can't tell if clocked.
Skipping PCIe port 1 BIST, reset not done. (port not configured)
BIST check passed.
UBNT_E200 r1:0, r2:19, serial #: FCECDA05EB31
MPR 13-00317-19
@lemmi
lemmi / adhocwg
Created October 24, 2020 08:04
small script to generate a pair of wireguard configurations that can be directly pasted to shell
#!/bin/sh
genscript() {
local PRIV=${1:?"No private key given"}
local PUB=${2:?"No public key given"}
local OTHER=${3:?"No peer public key given"}
local EP=${4:+"endpoint '$4':65534"}
local LL=$(echo $PUB | base64 -d | hexdump -n8 -e '"fe80:" 4/2 ":%04x" "/64\n"')
echo "ip link add dev wgadhoc type wireguard"
@lemmi
lemmi / uboot.log
Last active July 5, 2021 20:37
ER-12 u-boot
SPI stage 1 bootloader
SPI ID: c2:20:17:c2:20
header found at offset 0x2000
Image 1.2: address: 0xffffffffc0000000, header length: 192, data length: 359416
Validating data...
Starting next bootloader at 0xffffffff81000000
Board type: UBNT_E300
U-Boot 2013.07 (UBNT Build Version: e302_001_3f6cf) (Aug 27 2018 - 07:21:15)