<< Project description >>
There are two branches to this repository, master and production, these make it easier to use the same repository for developing as well as for sharing the code as a Git submodule.
| #include <OneWire.h> | |
| #define ZeroPercentVoltage 0.8; | |
| float val = 0; | |
| float RH = 0; | |
| float my_room_temperature = 20; //in degrees C ! | |
| float max_voltage = 3.27; | |
| OneWire ds(2); // Sensor DS18b20 on pin 2 |
| # encoding: utf-8 | |
| import urllib | |
| import demjson | |
| API_KEY = "YOUR_API_KEY" | |
| TRANSLATE_URL = "https://www.googleapis.com/language/translate/v2?key=" + API_KEY # &q=hello%20world&source=en&target=de | |
| DETECT_URL = "https://www.googleapis.com/language/translate/v2/detect?key=" + API_KEY # &q=google+translate+is+fast | |
| def unicode_urlencode(params): |
| // DS3231 Class is by Seeed Technology Inc(http://www.seeedstudio.com) and used | |
| // in Seeeduino Stalker v2.1 for battery management(MCU power saving mode) | |
| // & to generate timestamp for data logging. DateTime Class is a modified | |
| // version supporting day-of-week. | |
| // Original DateTime Class and its utility code is by Jean-Claude Wippler at JeeLabs | |
| // http://jeelabs.net/projects/cafe/wiki/RTClib | |
| // Released under MIT License http://opensource.org/licenses/mit-license.php | |
| #include <Wire.h> |
| #include <OneWire.h> | |
| #include <DallasTemperature.h> | |
| // pin setups | |
| int latchPin = 8; | |
| int clockPin = 12; | |
| int dataPin = 11; | |
| int tempPin = 7; | |
| char recMsg = '0'; |
| #!/bin/bash | |
| # This hook is run after a new virtualenv is activated. | |
| # ~/.virtualenvs/postmkvirtualenv | |
| LIBS=( PyQt4 sip.so ) | |
| PYTHON_VERSION=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") | |
| VAR=( $(which -a $PYTHON_VERSION) ) | |
| GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())" |
| #!/bin/bash | |
| export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY | |
| export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY | |
| export PASSPHRASE=YOU_PASSHRASE | |
| # directories, space separated | |
| SOURCE="/home/thomas/backup /home/thomas/bin /home/thomas/documents" | |
| BUCKET=s3+http://mybucket | |
| LOGFILE=/home/thomas/tmp/duplicity.log | |
| # set email to receive a backup report |
| # encoding: utf-8 | |
| import os | |
| import shelve | |
| import boto.glacier | |
| import boto | |
| from boto.glacier.exceptions import UnexpectedHTTPResponseError | |
| ACCESS_KEY_ID = "XXXXXXXXXXXXX" | |
| SECRET_ACCESS_KEY = "XXXXXXXXXXX" | |
| SHELVE_FILE = os.path.expanduser("~/.glaciervault.db") |
| >>> import logging | |
| >>> logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s: %(message)s') | |
| >>> logging.info("Hello") | |
| 2012-11-05 13:34:28,445 INFO: Hello | |
| >>> |
| import logging | |
| LOG_FILENAME = '/tmp/mongodb_backups.log' | |
| # Set up a specific logger with our desired output level | |
| logger = logging.getLogger('dico') | |
| logger.setLevel(logging.DEBUG) | |
| # Add the log message handler to the logger | |
| handler = logging.handlers.RotatingFileHandler( | |
| LOG_FILENAME, backupCount=3, maxBytes=10000000) | |
| handler.setFormatter(logging.Formatter("%(asctime)s;%(levelname)s;%(message)s", |