This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Derived from http://sundararajana.blogspot.com/2007/05/motion-detection-using-opencv.html | |
import cv | |
class Target: | |
def __init__(self): | |
self.capture = cv.CaptureFromCAM(0) | |
cv.NamedWindow("Target", 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.6 | |
import sys, os | |
# Add a custom Python path. | |
sys.path.insert(0, "..") | |
# Switch to the directory of your project. (Optional.) | |
os.chdir("/var/www/myproject") | |
os.environ['DJANGO_SETTINGS_MODULE'] = "settings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matt@valkyrie:/var/www/myproject$ sh myproject.fcgi | |
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI! | |
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI! | |
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI! | |
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI! | |
settings_local loaded | |
Status: 404 NOT FOUND | |
Content-Type: text/html | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html lang="en"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$HTTP["host"] =~ "myproject\.myhost\.com" { | |
fastcgi.server = ( | |
".fcgi" => ( | |
"localhost" => ( | |
"bin-path" => "/var/www/myproject/myproject.fcgi", | |
"socket" => "/tmp/myproject.sock", | |
"check-local" => "disable", | |
"min-procs" => 2, | |
"max-procs" => 4, | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matt@valkyrie:/etc/lighttpd/conf-available$ sudo ln -s /etc/lighttpd/conf-available/15-pictag.conf /etc/lighttpd/conf-enabled/15-myproject.conf | |
matt@valkyrie:/etc/lighttpd/conf-available$ sudo /etc/init.d/lighttpd restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FORCE_SCRIPT_NAME = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FORCE_SCRIPT_NAME = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
class SomeClass(object): | |
attribute = 0 | |
def main(): | |
c = SomeClass() | |
c.attribute = 5 | |
print c.attribute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pygame | |
from pygame.locals import * | |
import serial, time, random, os, datetime | |
ser = None | |
last_transmit = None | |
pygame.init() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ledPin = 13; | |
boolean ledOn = false; | |
void setup() { | |
pinMode(ledPin, OUTPUT); // Set servo pin as an output pin | |
Serial.begin(9600); | |
//Serial.println("Arduino serial"); | |
} | |
void loop() { |
OlderNewer