This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/freeradius/sites-enabled/default | |
# ... other sections omitted for brevity ... | |
authorize { | |
# enable rml_rest module | |
if (&User-Password) { | |
update control { | |
Auth-Type := 'rest' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from .models import Config | |
class ConfigAdmin(admin.ModelAdmin): | |
def add_view(self, request, form_url='', extra_context={}): | |
if 'config' in self.model.__name__.lower(): | |
extra_context.update({'CONFIG_SPECIFIC': True}) | |
return super(ParentAdmin, self).add_view(request, form_url, extra_context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- print table structure | |
require('luci.util') | |
require('luci.jsonc') | |
t = {'test'} | |
print(luci.util.dumptable(t)) | |
print(luci.jsonc.stringify(t)) | |
-- disable luci caching to make it easy to do live editing on a test router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BASE_URL="http://ninux-graph.netjson.org" | |
# put your network topology id here | |
UUID="<uuid>" | |
# put your network topology key here | |
KEY="<key>" | |
# host where OLSR is running | |
OLSR_HOST="127.0.0.1" | |
# port on which OLSR is listening, change it according to your configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "NetworkGraph", | |
"protocol": "olsrv2", | |
"version": "0.1", | |
"revision": "e38e0a8", | |
"router_id": "10.27.253.2", | |
"metric": "ff_dat_metric", | |
"topology_id": "0", | |
"label": "ipv4", | |
"nodes": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BASE_DIR="/var/www/downloads.openwisp.org/$JOB_NAME" | |
REVISION=$(git describe --tags --always) | |
ARCHS="ar71xx ramips" | |
cd openwrt && git pull || (git clone git://git.openwrt.org/openwrt.git --depth=1 && cd openwrt) | |
cp feeds.conf.default feeds.conf | |
echo "src-link openwisp $WORKSPACE" >> feeds.conf | |
./scripts/feeds update packages luci targets openwisp | |
./scripts/feeds install packages luci targets openwisp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
from django.db.models.signals import pre_save | |
from django.dispatch import receiver | |
from django_netjsongraph.models import Node | |
def whois(query, hostname='chi.ninux.org'): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/config/dhcp | |
# example config of how to use odchp instead of dnsmasq for ipv4 | |
config odhcpd 'odhcpd' | |
# this tells openwrt to use odchpd instead of dnsmasq | |
option maindhcp '1' | |
# ensure the directory exists or the lease | |
# file won't be written and will fail silently | |
option leasefile '/tmp/odhcp-leases' | |
option leasetrigger '/usr/sbin/odhcpd-update' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "NetworkGraph", | |
"protocol": "OLSR", | |
"version": "0.8", | |
"revision": null, | |
"metric": "ETX", | |
"nodes": [ | |
{ | |
"id": "172.16.172.7" | |
}, |