Skip to content

Instantly share code, notes, and snippets.

@jrossi
jrossi / lutron_pico_5_light.yaml
Last active April 23, 2023 22:12 — forked from smartqasa/lutron_pico_5_light.yaml
Lutron Pico 5 Button - Light Entity Control
blueprint:
name: Lutron Pico 5 Button - Light Entity Control
description: "This blueprint allows for the association a Lutron Pico 5 Button (model PJ2-3BRL-GXX-X01) remote with a light entity. It is designed to simulate the operation of a standard Lutron Caseta wall dimmer including the press and hold functionality for the raise/lower buttons. It allows for the control over the brightness step percentage and transition speed and the assignment of any action to the middle button."
source_url: https://gist.github.com/cymone-smart/9814a750a0d0cfb196fa1fa7ae3630bb
domain: automation
input:
pico_1:
name: Pico Device
package main
import (
"flag"
"net"
"os"
"syscall"
"github.com/golang/glog"
)
# Install Golang 1.4 and Arc65 + dependencies on fresh Amazon AWS EC2 Ubuntu 14.04 LTS
echo "install basic requirements"
apt-get update && upgrade
apt-get install build-essential mercurial git libssl-dev pkg-config tree
echo "download Go and install it, as well as create GOPATH directory"
cd ~
wget http://golang.org/dl/go1.4.linux-amd64.tar.gz && tar -xf go1.4.linux-amd64.tar.gz && rm go1.4.linux-amd64.tar.gz
mv go /usr/local && mkdir -p /usr/local/gopath
// Proof of concept CurveCP handshake over 0MQ.
//
// Demonstrates a confidential, authenticated connection between
// two 0MQ peers (two DEALER sockets in this example). See the
// curvecp.org website for details of the security design.
//
// This is a flat walk-through in code with minimal abstraction.
// The next version of this code will be more packaged.
//
// IMPORTANT NOTE: this code has not been reviewed by security experts
@jrossi
jrossi / txredns.py
Created February 4, 2013 04:32 — forked from fcoury/txredns.py
# Python/Twisted/Redis backed DNS server - resolves from NAME to IP addrs
# fallback to google or any other DNS server to resolv domains not present on Redis
# to set a new domain on redis, just issue a SET domain.tld ip_addr
# run with twistd -ny txredns.tac
# gleicon 2011
from twisted.names import dns, server, client, cache
from twisted.application import service, internet
from twisted.internet import defer
from twisted.python import log
; Clojure example for updating a DNS zone using dnsjava 2.1.1:
; http://www.xbill.org/dnsjava/
; Tested against named 9.3.6 from Red Hat on RHEL5.4
; Run using: java -cp clojure.jar:dnsjava-2.1.1.jar clojure.main dns-update.clj
(import '(org.xbill.DNS Update Name Type TSIG SimpleResolver))
(defn replaceArec [resolver zone host ip ttl]
(let [update (Update. zone)]
(do
(. update replace
@jrossi
jrossi / XMLtoJSON.py
Created November 30, 2012 23:57 — forked from smihica/XMLtoJSON.py
Xml to JSON parser-converter in Python.
#!/usr/bin/env python -S
# -*- coding: utf-8 -*-
import sys
import re
import xml.sax
import io # for 2.6
import StringIO # for 3.0
#
# ** If your python is 2.x and xml-cording is utf-8 set follows.
@jrossi
jrossi / txredns.py
Created January 19, 2012 04:51 — forked from fcoury/txredns.py
Python/Twisted/Redis backed DNS server.
# Python/Twisted/Redis backed DNS server - resolves from NAME to IP addrs
# fallback to google or any other DNS server to resolv domains not present on Redis
# to set a new domain on redis, just issue a SET domain.tld ip_addr
# run with twistd -ny txredns.tac
# gleicon 2011
from twisted.names import dns, server, client, cache
from twisted.application import service, internet
from twisted.internet import defer
from twisted.python import log