This file contains 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
# RF codes located in appdaemon/config/rf_codes.yaml | |
93B408: | |
device_name: remote_ctl_1 | |
name: button_1_left | |
description: Turn on scene | |
# sync: 0x1D4C | |
# low: 0x010E | |
C10A39: |
This file contains 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
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(17, GPIO.IN) #PIR | |
GPIO.setup(21, GPIO.OUT) # LED | |
GPIO.setup(4, GPIO.OUT) # RELAY | |
try: |
This file contains 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
#!/usr/bin/env python3 | |
""" | |
The daemon responsible for changing the volume in response to a turn or press | |
of the volume knob. | |
The volume knob is a rotary encoder. It turns infinitely in either direction. | |
Turning it to the right will increase the volume; turning it to the left will | |
decrease the volume. The knob can also be pressed like a button in order to | |
turn muting on or off. |
This file contains 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
### Defining a variable for the admin API using the name of my management server and the default admin API port, which is 30004 | |
$AdminURI = "https://localhost:30004" | |
### Defining a variable for the Admin Authentication Site in my environment. Default port is 300072 but is changed in this environment to use 443 | |
$AuthSite = "https://localhost:30072" | |
### Defining a variable for the Client Realm, using the default value |
This file contains 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
#requires -version 2 | |
#------------------------------------------------------------------------------ | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory=$true)] | |
[Guid] $StampId, | |
[Parameter(Mandatory=$true)] | |
[int32] $Size, |
This file contains 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
#!/bin/bash | |
run_tests() { | |
[ -d ./results/$CLOUD/$TEST ] || mkdir -p ./results/$CLOUD/$TEST | |
# run provision and preparation before run | |
echo "Start preparing environemnt for $TEST in the $CLOUD" |
This file contains 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
import jinja2 | |
from jinja2 import Environment | |
import yaml | |
jinja2.filters.FILTERS['yaml'] = lambda s: yaml.safe_dump( | |
s, default_flow_style=True) | |
jinja2.filters.FILTERS['parse_aliases'] = lambda s: yaml.safe_dump( | |
s.split(','), default_flow_style=True) |
This file contains 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
#!/bin/bash -e | |
pip_install_source() | |
{ | |
REMOTE=$1 | |
EGG=$2 | |
[ -d ../src ] || mkdir ../src | |
git clone $REMOTE --depth 1 ../src/$EGG |
This file contains 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
from flask import jsonify | |
from flask import Flask | |
from flask import request | |
import yaml | |
app = Flask(__name__) | |
@app.route("/<path:path>", methods=['POST']) | |
def dump_relass(path): |
This file contains 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
var request = require('request'); | |
var rp = require('request-promise'); | |
export default function Model(model) { | |
/* Encapsulate Django Rest Frameowork actions | |
var page = new Model('web.page'); | |
page.list(function (pages) { |
NewerOlder