Skip to content

Instantly share code, notes, and snippets.

View treeherder's full-sized avatar

Brendan Reddy-Best treeherder

View GitHub Profile
@treeherder
treeherder / README.md
Last active August 29, 2015 14:05
instructions for operating the camera tower

Camera Tower

to reboot the pi, press ctrl -alt - backspace and then type sudo reboot or to shutdown sudo shutdown -h now

login: pi
password: raspberry

-when finished booting, type startx to begin the graphical desktop session
-open LXTermnial icon from the desktop
-type sudo ./camera into the terminal to begin the app.

@treeherder
treeherder / rpc_cli.py
Last active August 29, 2015 14:03
fledgling rpc for some automated tasks.. works great so far.
import xmlrpclib, time
server = xmlrpclib.ServerProxy('http://localhost:8000',allow_none=True)
print(server.system.listMethods())
server.capture(time.time())
server.tx("/1Z5000R")
@treeherder
treeherder / bbb_rootfs.md
Last active July 1, 2023 21:36
how to expand the rootfs of the beagle bone black from a flashed eMMC onto the SD card

We have used the most recent beagleboard debian eMMC flasher image to flash the beagle bone black eMMC. As of this writing: wget http://debian.beagleboard.org/images/BBB-eMMC-flasher-debian-7.5-2014-05-14-2gb.img.xz After flashing is complete, erase the sd card, then reboot. Once booted, We can use fdisk -l to list our available devices, I found mine by checking the size and the partition table. After verfifying the card's address, we can reformat it to fit our needs. Of course, this can be done before plugging the card in, as well.

debian@beaglebone:~$ fdisk -l
Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 
        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192    31116287    15554048    b  W95 FAT32
@treeherder
treeherder / kmler.py
Last active August 29, 2015 14:02
i went through a lot of work to format/fix this script i found for parsing kismet data from the OLDCORE kismet (versions before circa 2008), and didn't want to lose it.
#!/usr/bin/env python
# modified from http://www.larsen-b.com/Article/204.html
import sys
try:
from elementtree import ElementTree
except:
from xml.etree import ElementTree
try:
@treeherder
treeherder / returval.c
Last active August 29, 2015 13:56
trouble with dereferecing
#include <stdio.h>
struct ret
{
int c_1;
int c_2;
};
int main()
@treeherder
treeherder / l298.ino
Last active August 29, 2015 13:56
control l298d breakout module
#include <stdint.h>
#define EN1A 9
#define M1A 8
#define EN1B 3
#define M1B 2
#define EN2A 4
#define M2A 5
#define EN2B 7
@treeherder
treeherder / a_g.c
Last active August 29, 2015 13:56
accelerometer structure for handling data in a way that might be sane
#include <stdio.h>
typedef struct ret ret;
struct ret {
char *id;
int accel_x;
int accel_y;
int accel_z;
int gyro_x;
@treeherder
treeherder / compile.sh
Last active August 29, 2015 13:56
a generic compile script for my type A 3d printer
#!/bin/bash
if [ -f ./$1.scad ]
then
openscad -o ${1}.stl ${1}.scad
fi
perl -I/home/debian/Slic3r /home/debian/Slic3r/slic3r \
--load /home/debian/Slic3r/slicer.ini \
--max-fan-speed 100 \
@treeherder
treeherder / keypad.ino
Created January 14, 2014 03:04
for darren's door
#include <SoftwareSerial.h>
const int rxpin = 2; // pin used to receive
const int txpin = 3; // pin used to send to
SoftwareSerial keypad(rxpin, txpin); // new serial port on given pins
void setup()
{
Serial.begin(9600);
@treeherder
treeherder / average.py
Created October 6, 2013 01:36
average a stream
streaam = []
P = 100
def SMA(N):
stream.append(N)
if len(stream) > P:
# Only average the last P elements of the stream
del(stream[:1])
elif len(stream) == 0:
average = 0