Skip to content

Instantly share code, notes, and snippets.

@wrtcoder
wrtcoder / readme.txt
Created October 10, 2016 02:21 — forked from artizirk/readme.txt
Huawei E3372h-153
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"
@wrtcoder
wrtcoder / listening-client.js
Created September 12, 2016 21:48 — forked from kaosat-dev/listening-client.js
Simple MQTT Server. Tessel acts as an MQTT client sending temperature data to a host
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) {
@wrtcoder
wrtcoder / sqlite3.lua
Last active August 19, 2016 03:35 — forked from perusio/sqlite3.lua
Lua SQlite handling via LuaSQL
-- 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)"))

/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
#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
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
@wrtcoder
wrtcoder / genieacs-install.sh
Created July 17, 2016 08:23 — forked from allanmc/genieacs-install.sh
Install GenieACS on Ubuntu 14.04
#!/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
@wrtcoder
wrtcoder / wrtbwmon
Created July 7, 2016 03:50 — forked from heyeshuang/wrtbwmon
wrtbwmon -- modified for openwrt
#!/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

Testing qemu 2.1 arm64 support

qemu-system-aarch64 -m 1024 -cpu cortex-a57 -nographic -machine virt -kernel trusty-server-cloudimg-arm64-vmlinuz-generic -append 'root=/dev/vda1 rw rootwait mem=1024M console=ttyAMA0,38400n8 init=/usr/lib/cloud-init/uncloud-init ds=nocloud ubuntu-pass=ubuntu' -drive if=none,id=image,file=trusty-server-cloudimg-arm64-disk1.img -netdev user,id=user0 -device virtio-net-device,netdev=user0 -device virtio-blk-device,drive=image

qemu-system-aarch64 -m 1024 -cpu cortex-a57 -nographic -machine virt -kernel trusty-server-cloudimg-arm64-vmlinuz-generic -append 'root=/dev/vda1 rw rootwait mem=1024M console=ttyAMA0,38400n8 init=/usr/lib/cloud-init/uncloud-init ds=nocloud' -drive if=none,id=image,file=trusty-server-cloudimg-arm64-disk1.img -netdev user,id=user0 -device virtio-net-device,netdev=user0 -device virtio-blk-device,drive=image

[A Quick'n'Dirty Set-up of an Aarch64 Ubuntu 14.04 VM with QEMU]

Set up L2TP/IPsec VPN on Debian

Set up IPsec

Set up networking