15 July 2017 public link: https://hackmd.io/s/H1lA3HLrb #LoRaLIV
[TOC]
| Shortcut Description | |
| --------------------------------------------------------------- | |
| C-o Drop to the console | |
| Insert Select/deselect file | |
| * Invert selection on files | |
| + Specify file selection options (including custom pattern) | |
| - The same as above, but for deselecting | |
| F5/F6 Copy/move selected files |
| import cv2 | |
| import numpy as np | |
| import urllib.request | |
| import time | |
| import threading | |
| import math | |
| def getPokemon(start, end): | |
| print("Started worker for range :", start, "to", end) |
| import cv2 | |
| import time | |
| import glob | |
| import multiprocessing.pool as mp | |
| def process_img(image_file): | |
| if '_canny.jpg' not in image_file: | |
| print 'processing', image_file | |
| img = cv2.imread(image_file) | |
| img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) |
| #!flask/bin/python | |
| from flask import Flask, jsonify, abort, request, make_response, url_for | |
| from flask.ext.httpauth import HTTPBasicAuth | |
| app = Flask(__name__, static_url_path = "") | |
| auth = HTTPBasicAuth() | |
| @auth.get_password | |
| def get_password(username): | |
| if username == 'miguel': |
| 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 |
15 July 2017 public link: https://hackmd.io/s/H1lA3HLrb #LoRaLIV
[TOC]
| #!/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. | |
| """ |
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
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:
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: