Skip to content

Instantly share code, notes, and snippets.

# dmesg
[ 0.000000] Linux version 5.15.137 (builder@buildhost) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r23630-842932a63d) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Tue Nov 14 13:38:11 2023
[ 0.000000] printk: bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[ 0.000000] MIPS: machine is Ubiquiti LiteBeam AC Gen2
[ 0.000000] SoC: Atheros AR9342 rev 2
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[ 0.000000] Zone ranges:
#!/bin/sh
. /lib/functions.sh
. /usr/share/libubox/jshn.sh
. /etc/openwrt_release
uci_add_list() {
local PACKAGE="$1"
local CONFIG="$2"
local OPTION="$3"
@stargieg
stargieg / update-ubnt-nano-m.sh
Created March 12, 2021 21:13
Build Firmware for ubnt-nano-m with minimal packages selection
#!/bin/sh
#sudo apt install subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev xsltproc zip imagemagick
umask 022
upd_out="ubnt-nano-m"
upd_target="ar71xx"
upd_subtarget="generic"
upd_profile="ubnt-nano-m"
upd_profilel=$(echo "$upd_profile" | tr '[:upper:]' '[:lower:]')
#slot="snapshots"
@stargieg
stargieg / update-luci2-ffwizard.sh
Last active March 15, 2021 05:34
create ipkg feed for the imagebuilder
#!/bin/sh
#sudo apt install python2 python3 subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev xsltproc zip imagemagick
upd_out="luci2-ffwizard"
upd_path=$(pwd)
upd_targets="ath79 ar71xx x86 brcm2708"
upd_subtargets="generic 64 bcm2708 legacy mikrotik"
slots="snapshots 19.07.7"
gcc_vers="gcc-8.4.0_musl gcc-8.4.0_musl_eabi gcc-7.5.0_musl gcc-7.5.0_musl_eabi"
for slot in $slots;do
@stargieg
stargieg / mqtt-send-ip6-neigh.lua
Created January 13, 2019 19:05
Send ip6 neigh addr via mqtt
local function send_ip6neigh(mqtt,dev)
local neigh_table = nil
local neightbl = require "neightbl"
local neigh = nil
local qos = 1
local retain = false
neigh_table=neightbl.get(dev)
for ip,mac in pairs(neigh_table) do
if mac then
@stargieg
stargieg / mikrotik-dynv6
Last active November 21, 2024 07:58
Mikrotik dyndns for dynv6.com
# Define User Variables
:global ddnspass "TOKEN"
:global ddnshost "HOSTNAME.dynv6.net"
#:global ddnspool "pool0"
#:global ddnsinterface "bridge"
#:global ddnsinterface "6to4-henet"
#:global ddnsinterface "pppoe-out1"
#:global ddnsinterface "ether1"
# Define Global Variables
@stargieg
stargieg / dynv6.sh
Last active January 2, 2017 21:51 — forked from corny/dynv6.sh
Update script for dynv6.com to set your IPv4 address and IPv6 prefix
#!/bin/sh -e
hostname=$1
device=$2
file=$HOME/.dynv6.addr6
[ -e $file ] && old=`cat $file`
if [ -z "$hostname" -o -z "$token" ]; then
echo "Usage: token=<your-authentication-token> [netmask=64] $0 your-name.dynv6.net [device]"
exit 1
fi
rt_sigprocmask(SIG_SETMASK, ~[HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1], ~[KILL STOP RTMIN RT_1], 8) = 0
select(15, [3 9 11 13], [14], [], {0, 0}) = 0 (Timeout)
rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0
clock_gettime(CLOCK_MONOTONIC, {1775, 17053534}) = 0
rt_sigprocmask(SIG_BLOCK, NULL, ~[KILL STOP RTMIN RT_1], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
ioctl(14, USBDEVFS_DISCARDURB, 0x9f568f8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0
clock_gettime(CLOCK_MONOTONIC, {1775, 18762334}) = 0
@stargieg
stargieg / olsrd-dyn-hna6.sh
Created March 29, 2015 08:47
olsrd dyn hna6 announcement
#!/bin/sh
. /lib/functions.sh
. /usr/share/libubox/jshn.sh
update_hna6() {
local cfg="$1"
local address="$2"
local mask="$3"
config_get interface $cfg interface
#!/bin/sh
export MAILTO=""
#OLSR Router IPv6 Adresse
ROUTER="2001:470:6c:393::2"
#DNS Master Servername or IPv6 Adresse
SERVER="127.0.0.1"
#DNS Zonenenname for AAAA entry's
ZONENAME="pberg.freifunk.net."
ZONENAME1="pberg.freifunk.net"