Skip to content

Instantly share code, notes, and snippets.

@apetrone
apetrone / led_heart.ino
Created February 14, 2014 07:29
Firmware for the LED Heart, Valentine's Day 2014
/*
Date: February 2014
Author: Adam Petrone
Valentine's Day LED Heart
*/
#include <Adafruit_NeoPixel.h>
#include <avr/power.h>
const uint8_t NUM_PIXELS = 6;
@apetrone
apetrone / graylog2_proxy.py
Created April 28, 2014 00:27
graylog2 proxy which bridges the gap between Java compression and minizip.
# Adam Petrone, May 2012
import socket
import json
import zlib
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
host = "0.0.0.0"
port = 12202
sock.bind((host,port))
@apetrone
apetrone / livejson.py
Last active August 29, 2015 14:04
LiveJSON
# August 2014
# Adam Petrone
# This is a Sublime Text 2 plugin and was designed
# to allow live-editing of variables in my codebase
# for quicker iteration times.
# It communicates with CivetServer on the native C++ side
# and parses the incoming JSON.
@apetrone
apetrone / unix tips
Last active August 29, 2015 14:06
*nix tips
# We don't need dos2unix:
cat foo | col -b > foo2
# force process to background without killing it in a terminal.
$ sleep 1000
^Z
[1]+ Stopped sleep 1000
$ bg
$ disown
$ exit
@apetrone
apetrone / ios_tips
Created October 8, 2014 00:11
iOS tips
http://stackoverflow.com/questions/25770198/archive-in-xcode-6-is-producing-a-pkg-not-ipa
Add LSRequiresIPhoneOS YES to your plist.
@apetrone
apetrone / pan_tilt_receiver.ino
Last active August 29, 2015 14:07
pan_tilt_receiver
// Adam Petrone
// October 2014
// Code to control my custom pan/tilt mechanism.
// Target Hardware: Arduino Pro Mini 8 or 16MHz should do.
#include <Servo.h>
#include <SoftwareSerial.h>
// DOUT, DIN on the XBee to pins 6 and 7 respectively on the Pro Mini.
SoftwareSerial ss = SoftwareSerial(6, 7);
@apetrone
apetrone / string_to_layers.jsx
Created October 20, 2014 23:40
Split Active Layer Text String
// Adam Petrone
// Creation date: ~2011?
// Select a text layer in Photoshop/Illustrator and it will distribute
// each letter to its own layer.
try
{
// get the active document
var doc = app.activeDocument;
}
catch( e )
@apetrone
apetrone / rpiconfiguration
Last active August 29, 2015 14:19
raspberry pi configuration
/etc/fstab
# Force raspberry pi to use tmpfs for these mounts
tmpfs /tmp tmpfs defaults,noatime,nosuid,size=100m 0 0
tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=30m 0 0
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0
/boot/config.txt
@apetrone
apetrone / roomba_robot.ino
Last active September 4, 2015 01:44
roombot
// Adam Petrone, September 2014
// Robot based on original iRobot Roomba
#include <Wire.h>
#include <SoftwareSerial.h>
#include <Adafruit_NeoPixel.h>
// wired up to pins 12, and 13 of Arduino Pro Mini
SoftwareSerial ss = SoftwareSerial(13, 12);
// motor output pins
@apetrone
apetrone / rpi_board_revisions.md
Last active December 18, 2015 21:49
Raspberry Pi Board Revisions

(Original post by dom, Raspberry Pi forums)

There are three manufacturers of the boards, and they have unique board revs:

'0002' => 'Model B Revision 1.0',
'0003' => 'Model B Revision 1.0 + Fuses mod and D14 removed',
'0004' => 'Model B Revision 2.0 256MB', (Sony)
'0005' => 'Model B Revision 2.0 256MB', (Qisda)
'0006' => 'Model B Revision 2.0 256MB', (Egoman)
'0007' => 'Model A Revision 2.0 256MB', (Egoman)