Skip to content

Instantly share code, notes, and snippets.

View simianAstronaut's full-sized avatar

Sam Lindley simianAstronaut

  • Ashland, Oregon
View GitHub Profile
@mmdclx
mmdclx / ps3_eye_mic_fix_for_raspberry_pi.sh
Last active November 6, 2024 14:10
Fix for ps3 eye microphone on a raspberry pi requiring a physical unplug / reconnect on reboot to be useable as capture device
#!/bin/bash
# Logically eject and re-enable driver for Playstation Eye on a Pi running Raspbian Jessie.
# This is necessary because on boot, the microphone on the Eye will appear in `lsusb` and
# `arecord -l`, but will not function correctly (error "audio open error: Device or
# resource busy" or error "read error: Input/output error").
# Can read about others having this problem here https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=14903
# and here https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=15851&p=160394#p160394
# point a cronjob to this file, using the special @reboot nickname to run at startup.
@mathebox
mathebox / color_conversion.py
Created April 12, 2015 16:47
Python methods to convert colors between RGB, HSV and HSL
import math
def rgb_to_hsv(r, g, b):
r = float(r)
g = float(g)
b = float(b)
high = max(r, g, b)
low = min(r, g, b)
h, s, v = high, high, high