Skip to content

Instantly share code, notes, and snippets.

View dwilkins's full-sized avatar

David H. Wilkins dwilkins

View GitHub Profile
@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"}}})
[{"_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"=>
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.
@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) {
# /boot/config.txt
# See /boot/overlays/README for all available options
gpu_mem=64
dtoverlay=dwc2
# /etc/netctl/usbpizero
Description='pizero g_ether gadget'
Interface=usb0
Connection=ethernet
IP=static
Address=('192.168.7.3/24')
## Gateway address is the one we'll specify later
## in dhcpd.conf of the computer on the other end
## of the USB cable
Gateway='192.168.7.150'
# /boot/config.txt
# See /boot/overlays/README for all available options
gpu_mem=64
dtoverlay=dwc2
# /etc/modules-load.d/raspberrypi.conf
bcm2708-rng
snd-bcm2835
dwc2
g_ether
@dwilkins
dwilkins / g_ether.conf
Created April 17, 2016 21:31
Options for the g_ether module
# /etc/modprobe.d/g_ether.conf
options g_ether host_addr=12:a5:cf:42:92:fd dev_addr=5e:bc:ca:27:92:b1 idVendor=1317 idProduct=42146
netctl enable usbpizero
systemctl start dhcpd4