Skip to content

Instantly share code, notes, and snippets.

#Install all required applications
apt-get install -y sshfs autossh python3-dev build-essential libjpeg8-dev zlib1g-dev python3-pip python3-setuptools
#opencv tools
#apt-get install -y libatlas3-base libwebp6 libtiff5 libjasper1 libilmbase12 libopenexr22 libilmbase12 libgstreamer1.0-0 libavcodec57 libavformat57 libavutil55 libswscale4 libgtk-3-0 libpangocairo-1.0-0 libpango-1.0-0 libatk1.0-0 libcairo-gobject2 libcairo2 libgdk-pixbuf2.0-0
#Install required Python modules
pip3 install wheel
pip3 install pillow picamera adafruit-io
#pip3 install opencv-python-headless
@JarrettR
JarrettR / cam.py
Last active January 22, 2019 20:27
from io import BytesIO
from time import sleep, time
import picamera
from PIL import Image
import imgcompare
from Adafruit_IO import Client, Feed
ADAFRUIT_IO_KEY = ''
ADAFRUIT_IO_USERNAME = 'jrainimo'
// ==UserScript==
// @name Partsio
// @namespace This service is pretty great though, convince your boss to buy you a subscription
// @version 0.1
// @description Remove trial modal dialog
// @author Jarrett
// @match http*://parts.io/*
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
@JarrettR
JarrettR / bsp.diff
Created August 30, 2017 01:57
git diff imx6sx_ai_m4/ imx6sx_sdb_m4/ > bsp.diff
diff --git a/imx6sx_ai_m4/board.h b/imx6sx_sdb_m4/board.h
index 8801729..f259fb1 100644
--- a/imx6sx_ai_m4/board.h
+++ b/imx6sx_sdb_m4/board.h
@@ -38,7 +38,7 @@
#include "clock_freq.h"
/* The board name */
-#define BOARD_NAME "IMX6SX_AI_M4"
+#define BOARD_NAME "IMX6SX_SDB_M4"
@ECHO OFF
ECHO "%~1"
CD /d "%~dp1"
SET svgToEps="%ProgramFiles%\Inkscape\inkscape.exe" -f %~n1.svg -E %~n1.eps"
SET dxfToEps="%ProgramFiles%\Inkscape\inkscape.exe" -f %~n1.dxf -E %~n1.eps"
SET epsToAi="%ProgramFiles%\pstoedit\pstoedit.exe" -dt -f ps2ai "%~n1.eps" %~n1.ai
IF "%~x1"==".svg" (
ECHO SVG
%svgToEps%
%epsToAi%
@JarrettR
JarrettR / Makefile
Created September 27, 2016 06:29
Corrected Makefile for libusbJava for ZTEX boards on Raspberry Pi
# Makefile for libusbJava, a Java libusb wrapper
# Copyright (C) 2009-2014 ZTEX GmbH
# http://www.ztex.de
#
# This Makefile ia a part of the reorganized version of the libusbJava source tree
# with proper makefiles. (SVN version of Apr. 6, 2009).
#
# Please visit http://libusbjava.sourceforge.net for more information about the
# original project.
def parseSQL(filename):
fd = open(filename, 'r')
sqlFile = fd.read()
fd.close()
memberCount = []
keyholderCount = []
friendCount = []
cardCount = []
otherCount = []
outVar = 0
while outVar <= 0xFFFFFFFF:
#print hex(outVar)
print '{:010x}'.format(outVar)
outVar = outVar + 1
@JarrettR
JarrettR / ParameterIO.py
Created February 18, 2016 04:12
Crash fix for Fusion360 add-in "ParameterIO"
#Author-Wayne Brill
#Description-Allows you to select a CSV (comma seperated values) file and then edits existing Attributes. Also allows you to write parameters to a file
import adsk.core, adsk.fusion, traceback
commandId = 'ParamsFromCSV'
workspaceToUse = 'FusionSolidEnvironment'
panelToUse = 'SolidModifyPanel'
# global set of event handlers to keep them referenced for the duration of the command
@JarrettR
JarrettR / servo.py
Created November 3, 2015 07:29
Turn a CSV file into servo movements with a RasPi
#Setup here:
#http://cihatkeser.com/servo-control-with-raspberry-pi-in-5-minutes-or-less/
import os
import time
os.system('./servod')
def servoPosition(servoId, servoPos):