Skip to content

Instantly share code, notes, and snippets.

View spikedrba's full-sized avatar

Spike spikedrba

View GitHub Profile
@spikedrba
spikedrba / pmd.py
Last active August 13, 2021 17:42
RPi Motion detection with picamera python lib
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script was originally created by by killagreg î Thu Dec 18, 2014 7:53 am
# see http://www.raspberrypi.org/forums/viewtopic.php?p=656881#p656881
# This script implements a motion capture surveillance cam for raspberry pi using picam
# and is based on the picamera python library.
# It uses the "motion vectors" magnitude of the h264 hw-encoder to detect motion activity.
import io
import picamera
class MyOutput(object):
def __init__(self):
self.file_num = 0
self.output = None
def write(self, buf):
if buf.startswith(b'\xff\xd8'):
@spikedrba
spikedrba / gist:38a90e76cfce43c5e358
Created April 8, 2015 00:36
picamera mjpeg streaming test
#!/usr/bin/env python
import picamera
import socket
with picamera.PiCamera() as camera:
camera.resolution = (1296, 730)
camera.vflip = True
camera.start_preview()
@spikedrba
spikedrba / gist:e8ba93dde66decca39e9
Last active August 29, 2015 14:20 — forked from waveform80/motion_215.py
Basic skeleton for picamera motion detection with circular buffer and recording
#!/usr/bin/env python
import io
import time
import picamera
import picamera.array
import numpy as np
from PIL import Image, ImageDraw
@spikedrba
spikedrba / imv_capture.py
Created May 12, 2015 17:53
Motion vectors captures with picamera for testing
#!/usr/bin/env python
import picamera
from time import sleep
with picamera.PiCamera() as c:
c.resolution = (640, 480)
c.framerate = 15
c.vflip = True
c.start_preview()
@spikedrba
spikedrba / InstallE2GuardianUbuntuXenial1604.md
Last active February 14, 2017 02:39
Guide to install E2Guardian on Ubuntu Xenial

Overview

This document details the installation of E2guardian (from now on E2G) on Ubuntu Xenial 16.04.

E2Guardian does not work standalone and required a proxy to be also installed. The most common proxy software is Squid, but Ubuntu also ships other two lightweight proxies that may be installed to work with E2G, tinyproxy and oops. Examples will be provided for both proxies in the guide.

Getting E2Guardian

http://tristan.lt/blog/uefi-pxe-ubuntu-installation/
https://superuser.com/questions/1122753/uefi-syslinux-does-not-load-initrd-over-http-in-pxe-boot
https://wiki.ubuntu.com/UEFI/PXE-netboot-install
https://forums.opensuse.org/showthread.php/499052-PXE-Boot-in-UEFI-mode/page2?s=b4746336a5267538cc779a1a72d5f31a
@spikedrba
spikedrba / gist:057acad8b3bfb0266544347ced8b53d4
Created November 19, 2017 01:15
ramroot pxe ram based rescue system ubuntu
mkdir pxerescue
mkdir pxerescue/chroot
cd pxerescue
git clone https://github.com/medallia/ramroot
sudo debootstrap --arch=i386 xenial chroot http://apt/mirrors/ubuntu
sudo cp -r ramroot/initramfs-tools/* chroot/etc/initramfs-tools/
sudo chroot chroot
mount none -t proc /proc
mount none -t sysfs /sys
mount none -t devpts /dev/pts