Skip to content

Instantly share code, notes, and snippets.

@flamingm0e
flamingm0e / climate.yaml
Created December 27, 2019 01:07
MQTT Climate
- platform: mqtt
name: Downstairs Thermostat
retain: true
payload_on: "on"
payload_off: "off"
modes:
- "Off"
- "Heat"
- "Cool"
- "Auto"

Keybase proof

I hereby claim:

  • I am flamingm0e on github.
  • I am flamingm0e (https://keybase.io/flamingm0e) on keybase.
  • I have a public key ASBIZrBpBmaXeVBhd_hkVQB2LU_TkqJ_Qd4VkCl_jGx7FQo

To claim this, I am signing this object:

import paho.mqtt.client as mqttClient
import time
def on_connect(client, userdata, flags, rc):
if rc == 0:
print("Connected to broker")
global Connected #Use global variable
Connected = True #Signal connection
else:
print("Connection failed")
version: '3.1'
services:
unifi:
container_name: unifi
restart: unless-stopped
image: linuxserver/unifi
volumes:
- /srv/docker/unifi:/config
environment:
- PGID=0
@flamingm0e
flamingm0e / docker-destroy-all.sh
Created May 1, 2016 16:44 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@flamingm0e
flamingm0e / RPi_I2C_driver.py
Created January 10, 2016 20:13 — forked from DenisFromHR/RPi_I2C_driver.py
RaspberryPi I2C LCD Python stuff
# -*- coding: utf-8 -*-
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
var fs = require('fs');
// read a file
function read_the_file(filename, callback) {
// begin by reading a file
fs.readFile(filename, function (err, contents) {
// an error occurred, i.e. the file was not found.
// instead of throwing an error, skip the other
rm ~/.gem*
gem install bundler
PATH=$PATH:/usr/lib/ruby/gems/1.8/bin
cd ~
git clone git://github.com/chiliproject/chiliproject.git
cd chiliproject
git checkout stable
@flamingm0e
flamingm0e / .bashrc
Last active December 18, 2015 05:49
My custom bashrc (with Alsi)
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
red="\[\e[0;33m\]"
yellow="\[\e[0;31m\]"