This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import paho.mqtt.client as mqtt | |
| import time | |
| import json | |
| import base64 | |
| def on_connect(client, userdata, flags, rc): | |
| print("Connected with result code " + str(rc)) | |
| dev_eui = 'ZZZZZ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-*- coding: utf-8 -*- | |
| u""" | |
| MOD: pymongo | |
| """ | |
| import pymongo | |
| #=============================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # mongo_test_restaurants.py | |
| # Python 2.7.6 | |
| """ | |
| Test script to connect to MongoDB collections using pymongo library | |
| Connects to an already imported connection named "restaurants" | |
| source - https://docs.mongodb.org/getting-started/python/ | |
| """ | |
| from pymongo import MongoClient, ASCENDING, DESCENDING |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py | |
| $ cd <download location> | |
| $ sudo -H python ./get-pip.py | |
| Installing pip also installs Python3 | |
| To run Python3 | |
| $ python3 | |
| Install pip3 by just executing the same file as in the step above, but this time using Python3 | |
| $ sudo -H python3 ./get-pip.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # capture mjpegstream -r Framerate | |
| ffmpeg -f mjpeg -r 2 -i "http://127.0.0.1/rpicam/cam_pic_new.php?" -r 2 ./video.avi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <string> | |
| #include <ctime> | |
| #include <msgpack.hpp> | |
| struct message | |
| { | |
| std::string tag; | |
| std::time_t time; | |
| std::string text; | |
| MSGPACK_DEFINE(tag, time, text); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # --------- SCRIPT BEGIN ---------- | |
| # By Bret Stateham | |
| # This script assumes | |
| # - You are running on a linux machine | |
| # - You have the can-utils installed and working. See: | |
| # - https://github.com/linux-can/can-utils | |
| # - https://www.kernel.org/doc/Documentation/networking/can.txt | |
| # - You have a can device attached and configured as can0 (you can change the targetbus variable to match if otherwise) | |
| # - The can device is attached to your running target vehicle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // "Pacifica" | |
| // Gentle, blue-green ocean waves. | |
| // December 2019, Mark Kriegsman and Mary Corey March. | |
| // For Dan. | |
| // | |
| #define FASTLED_ALLOW_INTERRUPTS 0 | |
| #include <FastLED.h> | |
| FASTLED_USING_NAMESPACE |
Tool for creating isolated Python environments
The common use-cases:
- Handling different versions of same libraries per each service
- Same plus no access to site-packages