Skip to content

Instantly share code, notes, and snippets.

View tstellanova's full-sized avatar
💭
growing excited

Todd Stellanova tstellanova

💭
growing excited
View GitHub Profile
@tstellanova
tstellanova / gist:5017680
Created February 23, 2013 00:37
Crash in QT when running Chimera for node.js
Process: node [562]
Path: /usr/local/bin/node
Identifier: node
Version: ???
Code Type: X86-64 (Native)
Parent Process: bash [93773]
User ID: 501
Date/Time: 2013-02-22 14:31:39.031 -1000
OS Version: Mac OS X 10.8.2 (12C2034)
@tstellanova
tstellanova / gist:5096902
Created March 6, 2013 05:13
error using chimera with nodejitsu
localhost:slurpsports todd$ jitsu deploy
info: Welcome to Nodejitsu tstellanova
info: jitsu v0.12.2, node v0.8.17
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in update_league_rosters.coffee
info: Creating snapshot 0.0.0-1
info Uploading: [=============================] 100%
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
@tstellanova
tstellanova / gist:7131798
Created October 24, 2013 05:24
opencv cv2 BackgroundSubtractor
import cv2
 
backsub = cv2.BackgroundSubtractorMOG()
 
capture = cv2.VideoCapture("Balcony4_Vis.mpg")
 
if capture:
    while True:
        ret, frame = capture.read()
        if ret:
@tstellanova
tstellanova / gist:7131810
Created October 24, 2013 05:26
cv2 kalman filter / predictor
import cv2.cv as cv
kalman = cv.CreateKalman(4, 2, 0)
i = 0
# I read the point from an .txt file
with open('trajectory_0000.txt') as f:
array = []
for line in f: # read rest of lines
array.append([int(x) for x in line.split()])
So the Beaglebone uses the file uEnv.txt to store settings as it doesn't have any NAND allocated to do it with, by
default the file is pretty empty save from the line:
optargs=run_hardware_tests quiet
You may have read a number of things about boot.scr etc - ignore it, it's not correct.
The bootcmd is hardwired in uboot to do the following (i've seperated it all out to make things clearer) - you can see it by
interrupting the bootsequence and performing a 'printenv'.
bootcmd=
@tstellanova
tstellanova / bbb_boot_service_instructions.md
Last active September 26, 2023 09:43
How to setup a service to automatically run a python script when the BeagleBone Black (BBB) reboots. These instructions allow you to setup a python script to automatically start when the BeagleBone (running Angstrom linux with systemd) restarts.

Creating a service to startup at BeagleBone Black boot time:

  • Create a shell script such as /usr/bin/myFancyBash.sh:

      #!/bin/bash
    
      # this could be any runnable code or shell script, really
      /usr/bin/myFancyPython.py 
    

Note that the first line is critical.

import cv
import time
tolerance = 2
webcam_stream = cv.CaptureFromCAM(0)
print cv.GetCaptureProperty(webcam_stream,cv.CV_CAP_PROP_FPS)
print cv.GetCaptureProperty(webcam_stream,cv.CV_CAP_PROP_FRAME_WIDTH)
print cv.GetCaptureProperty(webcam_stream,cv.CV_CAP_PROP_FRAME_HEIGHT)
# -*- coding: utf-8 -*-
"""
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html
Author: Ola Sitarska <[email protected]>
Copyright: Licensed under the GPL-3 (http://www.gnu.org/licenses/gpl-3.0.html)
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/
"""
@tstellanova
tstellanova / homebrew_opencv_245.sh
Last active May 29, 2018 04:25
Install a specific version of OpenCV on OSX with homebrew
# 20131214
# switch to the relevant keg directory
cd /usr/local/Library/Taps/homebrew-science
brew versions opencv
# look for the version you want, eg:
# 2.4.5 git checkout ae74fe9 opencv.rb
# checkout the version you want
git checkout ae74fe9 opencv.rb
#!/bin/bash
#
# Lock GPU and MEM clocks to max MHz
#
# - benchmarking shows there is no need to override the MEM clock
#
echo
echo Locking GPU clock to max MHz for debugging porpoises...
# set to max