Commands for controlling the Raspberry Pi 2 LEDs.
See rpi-leds for a node module that does this.
- OK (ACT) LED =
led0 - Power (PWR) LED =
led1
Allow access
| 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) |
| # 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__) |
Commands for controlling the Raspberry Pi 2 LEDs.
See rpi-leds for a node module that does this.
led0led1Allow access
| # 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 |
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.
Log in as root to create a personal user and give it a password:
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:
Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.
These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.
Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following
| #!/usr/bin/env python | |
| """ | |
| Plot data received over a ZeroMQ port in real time using matplotlib. | |
| Notes | |
| ----- | |
| This appears to segfault when run using the WxAgg backend. | |
| """ |
15 July 2017 public link: https://hackmd.io/s/H1lA3HLrb #LoRaLIV
[TOC]
| db = db.getSiblingDB("whyd_music") // explicitely select collection | |
| var jan2014 = ObjectId("52c35a800000000000000000"); // created using http://steveridout.github.io/mongo-object-time/ | |
| db.post.aggregate([ | |
| {"$sort": {"_id": -1}}, // order: antichronological | |
| {"$match": {"_id": {"$gt": jan2014}}}, // only documents that were created after the 1syt january 2014 | |
| {"$group": {"_id": "$eId", // group by value of the eId attribute -> _id attribute in the resulting output collection | |
| "name": {"$first": "$name"}, // -> include the name of each grouped category | |
| "count": {"$sum": 1}}}, // -> count attribute will contain the number of documents for each value of _eid | |
| {"$match": {"count": {"$gt": 50}}}, // limit output to results with count > 50 | |
| {"$sort": {"count": -1}} // output order: highest count first |