Skip to content

Instantly share code, notes, and snippets.

@malefs
malefs / dhcpd.conf
Created January 13, 2016 09:43
Raspberry PI router
#/etc/dhcp/dhcpd.conf
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
max-lease-time 3600;
default-lease-time 3600;
log-facility local7;
@malefs
malefs / ldr.py
Created January 22, 2016 15:28 — forked from electronut/ldr.py
Display analog data from Arduino using Python (matplotlib animation)
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import sys, serial, argparse
https://androidonlinux.wordpress.com/2013/05/12/setting-up-adb-on-linux/
sudo apt-get install ia32-libs
sudo apt-get purge openjdk*
#java ORACLE installieren Debian http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee /etc/apt/sources.list.d/webupd8team-java.list
@malefs
malefs / Linux_Raspberry_Setup.info
Last active November 17, 2020 19:39
Raspberry Linux Camera Opencv Accesspoint
########################################
----Raspberry Cheat Sheet---------------
by Malef
########################################
#change hostname:
sudo nano /etc/hosts
127.0.1.1 myname
sudo nano /etc/hostname
myname
@malefs
malefs / pmd.py
Created March 23, 2016 22:58 — forked from spikedrba/pmd.py
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.
@malefs
malefs / gist:abba938c4836181783f6
Created March 23, 2016 23:00 — forked from spikedrba/gist:38a90e76cfce43c5e358
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()
@malefs
malefs / supervisord.service
Created April 25, 2016 15:39 — forked from andreaskweber/supervisord.service
Running supervisord with systemd on Debian Jessie
#
# /etc/systemd/system/supervisord.service
#
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
@malefs
malefs / runinenv.sh
Created April 25, 2016 15:42 — forked from parente/runinenv.sh
run a command in virtualenv, useful for supervisord
#!/bin/bash
VENV=$1
if [ -z $VENV ]; then
echo "usage: runinenv [virtualenv_path] CMDS"
exit 1
fi
. ${VENV}/bin/activate
shift 1
echo "Executing $@ in ${VENV}"
exec "$@"
@malefs
malefs / readserial.py
Created April 29, 2016 14:38 — forked from andypiper/readserial.py
Scrape serial port for text data and publish on MQTT
#!/usr/bin/python
#
#simple app to read string from serial port
#and publish via MQTT
#
#uses the Python MQTT client from the Mosquitto project
#http://mosquitto.org
#
#Andy Piper http://andypiper.co.uk
#2011/09/15
@malefs
malefs / motion_detect.cpp
Created June 3, 2016 21:49 — forked from tanmaykm/motion_detect.cpp
OpenCV Motion Detection Based Action Trigger
/*
* motion_detect.cpp
* To accompany instructions at:
* http://sidekick.windforwings.com/2012/12/opencv-motion-detection-based-action.html
*
* Created on: Dec 02, 2012
* Author: tan
*
*/
#include <iostream>