Skip to content

Instantly share code, notes, and snippets.

View dwilkins's full-sized avatar

David H. Wilkins dwilkins

View GitHub Profile
# /boot/config.txt
# See /boot/overlays/README for all available options
gpu_mem=64
dtoverlay=dwc2
@dwilkins
dwilkins / nuvinci.cpp
Created March 23, 2016 19:39
Arduino program to test nuvinci hub
#include <Wire.h>
#include <Adafruit_MCP4725.h>
Adafruit_MCP4725 dac;
volatile int counter = 0;
void setup(void) {
Hello,
I need to use the PWM for my project using cubieboard2. I know this has been asked numerous times but I still do not know what to do.
This is my first time using Linux and Debian so I have no experience at all.
How do I patch my cubieboard using your files on github? Could you shed some light please on how to patch?
Right now I am using Cubian from here http://cubian.org/downloads/ and using LXDE X windows.
[{"_id"=>"Jefferson", "ids"=>["51e84c2619425203eb000005"]},
{"_id"=>"Birmingham AL", "ids"=>["51dd9fcd0e59d3e98f000051"]},
{"_id"=>"Birmingham, AL ",
"ids"=>["51e95c1f307d7ba22d000077", "51c47c9790052811f0000020"]},
{"_id"=>"", "ids"=>["50d39ab41a85bee5dd000003", "50c761b4d1d11d6096000001"]},
{"_id"=>nil, "ids"=>["50c0b257720d38253f000b6f"]},
{"_id"=>"Brookside",
"ids"=>["51cdfea9299d8189d0000032", "50c0b22b720d38253f00040c"]},
{"_id"=>"Fairfield",
"ids"=>
@dwilkins
dwilkins / group.rb
Created January 27, 2014 20:58
MongoDB aggregation / grouping
locs = Location.collection.aggregate({"$match" => {"counties" => "Jefferson"}},
{"$group" => {"_id" => "$city", "ids" => {"$addToSet" => "$_id"}}})
<% ['production', 'development', 'test','import'].each do |env| %>
<%= env %>:
database: <%= "#{Rails.root.basename.to_s.underscore}_development" %>
adapter: postgresql
encoding: unicode
pool: 5
username:
password:
min_messages: warning
host: localhost
@dwilkins
dwilkins / rfcomm.conf
Created January 12, 2014 08:57
rfcomm.conf example
rfcomm0 {
bind yes;
# Replace the device address with the address of your bluetooth serial device
device 20:13:10:25:40:43;
# channel 1 is VERY IMPORTANT
channel 1;
comment "Bluetooth Serial";
}
@dwilkins
dwilkins / rfcomm_wont_upload.patch
Created January 12, 2014 05:22
Patch for avrdude to make rfcomm devices work again
Index: ser_posix.c
===================================================================
--- ser_posix.c (revision 1255)
+++ ser_posix.c (working copy)
@@ -315,6 +315,7 @@
static int ser_send(union filedescriptor *fd, unsigned char * buf, size_t buflen)
{
int rc;
+ int retries = 10;
unsigned char * p = buf;
@dwilkins
dwilkins / pantech.txt
Created January 5, 2014 19:31
Pantech info from lsusb -v -d 10a9:6064
Bus 002 Device 016: ID 10a9:6064 SK Teletech Co., Ltd
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
@dwilkins
dwilkins / routes.txt
Created January 5, 2014 05:00
routes
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.101 * 255.255.255.255 UH 0 0 0 tun0
192.168.1.200 192.168.1.101 255.255.255.255 UGH 0 0 0 tun0
192.168.3.0 * 255.255.255.0 U 0 0 0 ath0
192.168.32.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
224.0.0.0 * 240.0.0.0 U 0 0 0 ath0
default 192.168.32.2 0.0.0.0 UG 0 0 0 eth0