Skip to content

Instantly share code, notes, and snippets.

@elliotf
elliotf / How-To.md
Last active August 27, 2022 22:07 — forked from ionspin/How-To.md
How to make an up-to-date OpenWRT image for loading onto a Raspberry Pi Compute Module 4 with a DFRobot Router Carrier Board.

The background is that the default OpenWRT image for Raspberry Pi lacks drivers for the LAN port (RTL8111) on the DFRobot board. DFRobot provide an image, but that one is made from a quite old daily snapshot of OpenWRT which is not entirely stable. Also, it is better to know how to fish than be given a fish.

DFRobot's page about the router board:
https://wiki.dfrobot.com/Compute_Module_4_IoT_Router_Board_Mini_SKU_DFR0767

OpenWRT main page:
https://openwrt.org/

You are expected to have some general knowledge on Linux and OpenWRT. The instructions for flashing the resulting firmware image are presented on DFRobot's page.

@elliotf
elliotf / segfault.js
Created July 11, 2014 23:50
Make knex segfault
var Knex = require('./');
var config = require('./test/knexfile');
var db = Knex(config.maria);
@elliotf
elliotf / ldap_reuse.js
Last active January 4, 2016 16:59
reuse of an ldap client
var ldap = require('ldapjs')
, port = 1389
, host = '127.0.0.1'
;
var server = ldap.createServer();
var client;
var showFailure = process.argv.indexOf('fail') > -1;
var serverDelay = 100;
@elliotf
elliotf / package.json
Last active December 29, 2015 01:19
sequelize example "enforcing a foreign key reference" -- trying to get to work
{
"dependencies": {
"sequelize": "~2.0.0-beta.1",
"sqlite3": "~2.1.19"
}
}
@elliotf
elliotf / debug.js
Created November 22, 2013 00:38
struggling with sequelize foreign key constraints
var Sequelize = require('sequelize')
, _ = require('lodash')
, config = require('./config/config.json')['development']
, options
, sequelize
, Feed
, Article
;
options = {
@elliotf
elliotf / wildcard.js
Last active November 28, 2023 19:20
/*
to run:
echo '{}' > package.json
npm install --save express
node wildcard.js
*/
var express = require('express')
@elliotf
elliotf / haml.js
Last active December 16, 2015 21:59
compiled js template benchmarks
// version 0.4.3
var Haml;
(function () {
var matchers, self_close_tags, embedder, forceXML, escaperName, escapeHtmlByDefault;
function html_escape(text) {
return (text + "").
We couldn’t find that file to show.
@elliotf
elliotf / ._jade_include_locals
Last active December 16, 2015 11:59
Jade templates cannot be reused for individual items and lists
We couldn’t find that file to show.
@elliotf
elliotf / package.json
Last active December 16, 2015 08:19 — forked from warnero/gist:5404395
var dbURI = 'mongodb://localhost/noClear-example'
, mongoose = require('mongoose')
, clearDB = require('mocha-mongoose')(dbURI, { noClear: true })
, expect = require('chai').expect
;
var User = mongoose.model('User', new mongoose.Schema({
name: {type: String },
email: {type: String },
username: {type: String }