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 |
| #!/usr/bin/python | |
| from Tkinter import * | |
| from phue import Bridge | |
| ''' | |
| This example creates 3 sliders for the first 3 lights | |
| and shows the name of the light under each slider. | |
| There is also a checkbox to toggle the light. | |
| https://github.com/studioimaginaire/phue/ | |
| ''' |
| :: create mongodb.conf and Install mongodb as autorun Service with DB and log File in this Directory | |
| ::https://docs.mongodb.com/v2.4/reference/configuration-options/ | |
| @echo off | |
| mkdir mongodb | |
| set MONGOCONF=mongodb.cfg | |
| echo logpath=%CD%\mongodb.log> %MONGOCONF% | |
| echo logappend=true >> %MONGOCONF% | |
| echo dbpath=%CD%\mongodb >> %MONGOCONF% | |
| echo bind_ip = 127.0.0.1 >> %MONGOCONF% | |
| echo port = 27017 >> %MONGOCONF% |
15 July 2017 public link: https://hackmd.io/s/H1lA3HLrb #LoRaLIV
[TOC]
| #!/usr/bin/python | |
| import os | |
| import datetime | |
| import ftplib | |
| import traceback | |
| import math | |
| import random, string | |
| import base64 | |
| import json |
| #!/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
| [general] | |
| allowguest=no | |
| port = 5060 | |
| bindaddr = 0.0.0.0 | |
| qualify = no | |
| disable = all | |
| allow = alaw | |
| allow = ulaw | |
| videosupport = no | |
| dtmfmode = rfc2833 |
| import time | |
| import shutil | |
| import RPi.GPIO as gpio | |
| import os | |
| import sys | |
| #Einstellungen | |
| klingel_gpio = 4 #GPIO, der mit der Schaltung verbunden ist | |
| callfilepfad = "/home/pi/klingel.call" #Dateipfad in dem das Script die .call-Datei ablegt | |
| sipkanal = "624" #Name des SIP-Kanals (in eckigen Klammern in der SIP.conf) |
| Weltempfänger | |
| Raspi als Internet-Radio mit Touch-Bedienung | |
| c't 6/17, S. 84 | |
| ----------------------------------------------------------- | |
| Für die meisten nachfolgenden Schritte sind Root-Rechte nötig: | |
| sudo su - | |
| Ausgabe auf Raspi-Touch-Display drehen: | |
| echo "lcd_rotate=2" >> /boot/config.txt | |
| Basis-Konfiguration von Raspbian: | |
| raspi-config |