/etc/config/easycwmp
config local
	option interface wlan0
	option port 7547
	option ubus_socket /var/run/ubus.sock
	option date_format %FT%T%z
	option username bob
| #!/bin/sh | |
| # | |
| # Traffic logging tool for OpenWRT-based routers | |
| # Original code at https://code.google.com/p/wrtbwmon/ | |
| # For usage with OpenWRT, take a look at http://heyeshuang.tk/?p=268 | |
| # Created by Emmanuel Brucy (e.brucy AT qut.edu.au) | |
| # Modified by HeYSH (yeshuanghe AT gmail.com) | |
| # | |
| # Based on work from Fredrik Erlandsson (erlis AT linux.nu) | |
| # Based on traff_graph script by twist - http://wiki.openwrt.org/RrdTrafficWatch | 
| #!/bin/sh | |
| set -e | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
| echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list | |
| sudo add-apt-repository -y ppa:chris-lea/redis-server | |
| sudo add-apt-repository -y ppa:chris-lea/node.js | |
| sudo apt-add-repository -y ppa:brightbox/ruby-ng | |
| sudo apt-get -qq update | 
| USER=ubuntu | |
| GROUP=ubuntu | |
| sudo mkdir -p /opt/{dev,git} || exit 0 | |
| sudo chown -R $USER:$GROUP /opt/{dev,git} | |
| git clone git://github.com/json-c/json-c.git /opt/git/json-c | |
| cd /opt/git/json-c/ | |
| autoreconf -i | 
| #feeds | |
| cp feeds.conf.default feeds.conf | |
| echo "src-git openwisp https://github.com/openwisp/openwrt-feed.git" >> feeds.conf | |
| ./scripts/feeds update | |
| ./scripts/feeds install -d y openwisp-fw | |
| #config target | |
| echo "CONFIG_TARGET_ar71xx=y" > .config | |
| make defconfig | |
| make -j 4 | 
/etc/config/easycwmp
config local
	option interface wlan0
	option port 7547
	option ubus_socket /var/run/ubus.sock
	option date_format %FT%T%z
	option username bob
| -- Using LuaSQL for sqlite3 DB handling. | |
| luasql = require('luasql.sqlite3') | |
| local env = assert(luasql.sqlite3()) -- create the context | |
| local conn = assert(env:connect("test.sqlite")) -- connect to the DB | |
| -- Do some queries. | |
| assert(conn:execute("CREATE TABLE IF NOT EXISTS tbl1(one varchar(10), two smallint)")) | |
| assert(conn:execute("INSERT INTO tbl1 VALUES('hello!', 10)")) | 
| var mqtt = require('mqtt') | |
| // Make sure to change this to the IP address of your MQTT server | |
| , host = '192.168.128.204' // or localhost | |
| client = mqtt.createClient(1883, host, {keepalive: 10000}); | |
| // Subscribe to the temperature topic | |
| client.subscribe('temperature'); | |
| // When a temperature is published, it will show up here | |
| client.on('message', function (topic, message) { | 
| Working Huawei E3372h-153 SETPORT mappings | |
| replacing A1,A2 with FF turns off need for usb_modeswitch | |
| AT^SETPORT="A1,A2;12,1,16,A1,A2" | |
| ^GETPORTMODE: TYPE: WCDMA: huawei,PCUI:0,MDM:1,NDIS:2,CDROM:3,SD:4, | |
| AT^SETPORT="A1,A2;1,12,16,A1,A2" | 
| #!/bin/ash | |
| # Found on https://forum.openwrt.org/viewtopic.php?pid=135197 | |
| # | |
| # Some important definitions used by this script. | |
| # Only edit these in case something has changed and if you know | |
| # what you are doing. | |
| # | |
| # IPT6: path to the ip6tables binary | 
| #!/usr/bin/env python | |
| #coding=utf-8 | |
| # | |
| # Generate a list of dnsmasq rules with ipset for gfwlist | |
| # | |
| # Copyright (C) 2014 http://www.shuyz.com | |
| # Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules | |
| import urllib2 | |
| import re |