Skip to content

Instantly share code, notes, and snippets.

@malefs
malefs / _README.md
Created January 5, 2017 21:04 — forked from oleq/_README.md
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
@malefs
malefs / bbt_mqtt.py
Created January 10, 2017 14:33 — forked from bachwehbi/bbt_mqtt.py
Simple example showing how to use MQTT in Beebotte. This code uses the Paho.mqtt Python client library.
#!/usr/bin/python
# Copyright (c) 2013-2014 Beebotte <contact@beebotte.com>
# This program is published under the MIT License (http://opensource.org/licenses/MIT).
############################################################
# This code uses the Beebotte API, you must have an account.
# You can register here: http://beebotte.com/register
#############################################################
@malefs
malefs / PiCameraStream
Created May 2, 2017 16:20 — forked from nioto/PiCameraStream
Simple MJpeg streamer for Raspberri Pi Camera
#!/usr/bin/python
'''
A Simple mjpg stream http server for the Raspberry Pi Camera
inspired by https://gist.github.com/n3wtron/4624820
'''
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import io
import time
import picamera
@malefs
malefs / raspberry camview vlc
Created June 2, 2017 13:50
Raspberry cameraviewer vlc
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Howto simple stream Camera
#https://picamera.readthedocs.io/en/release-1.13/recipes1.html?highlight=server_socket.accept()%5B0%5D.makefile(%27wb%27)
#vlc tcp/h264://my_pi_address:8000/
## on the client
#raspivid -w 640 -h 480 -t 60000 -o - | nc my_server 8000
## on the server
@malefs
malefs / mjpeg_udp.py
Created June 2, 2017 13:55 — forked from mic159/mjpeg_udp.py
Raspberry Pi MJPEG stream over UDP
from picamera import PiCamera
from io import BytesIO
import socket
import time
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
with PiCamera(resolution='VGA', framerate=5) as camera:
time.sleep(2)
@malefs
malefs / Flask-raspberryPi-GPIO-camera-model.py
Created June 2, 2017 14:00 — forked from benyaminsalimi/Flask-raspberryPi-GPIO-camera-model.py
simple RestApi for RaspberryPi RPIO & camera model with flask
# BPi restFull-api by @BenyaminSalimi
# you can see log of this program in "BPi.log"
from flask import Flask,jsonify,send_file
import picamera
import time
import RPi.GPIO as GPIO
app = Flask(__name__)
@malefs
malefs / rpi-led-notes.md
Created June 10, 2017 00:37 — forked from taktran/rpi-led-notes.md
Controlling Raspberry Pi 2 LEDs

Commands for controlling the Raspberry Pi 2 LEDs.

See rpi-leds for a node module that does this.

Power (PWR) LED

  • OK (ACT) LED = led0
  • Power (PWR) LED = led1

Allow access

@malefs
malefs / tmux.conf
Created June 10, 2017 01:00 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@malefs
malefs / gist:0e4465a5dea9ea14cda7f0bfed275bd6
Created October 24, 2017 11:55 — forked from oysteinjakobsen/gist:44a2c87bb552871bec71
How install Docker on Raspberry Pi 2

Would you love to get Docker up and running on you Raspberry Pi 2? Fortunately someone already did most of the leg work for you, as you will see from the article "Kick-Ass Raspberry Pi 2 having a forbidden love affair with Docker 1.4.1".

Check the official article "Installing Operating System Images" for more information on how to install this Debian Wheezy OS.

After you have downloaded and installed the image referenced in the article you're ready to do some adjustments to improve security.

Create a user

Log in as root to create a personal user and give it a password:

@malefs
malefs / gist:765a953652c2fcb78f2202c549c569af
Created October 24, 2017 11:55 — forked from oysteinjakobsen/gist:e59cdd38a688ee8a418a
How to get docker-compose (fig) up and running on Raspberry Pi 2

Background

I assume you already have Docker up and running on your Raspberry Pi 2. If not, see this article.

The next natural step is to install Docker Compose (formerly Fig), but there's no ARM support out of the box. This recipe will help you install Docker Compose on your Raspberry Pi 2!

The following six steps will do the trick:

  1. Get the docker-compose source code from git