Skip to content

Instantly share code, notes, and snippets.

View climate.yaml
- platform: mqtt
name: Downstairs Thermostat
retain: true
payload_on: "on"
payload_off: "off"
modes:
- "Off"
- "Heat"
- "Cool"
- "Auto"
View keybase.md

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:

View mqtt_sub.py
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")
View docker-compose.yaml
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 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
View docker-destroy-all.sh
#!/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 Jan 10, 2016 — forked from DenisFromHR/RPi_I2C_driver.py
RaspberryPi I2C LCD Python stuff
View RPi_I2C_driver.py
# -*- 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)
View gist:10700504
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
View gist:5906730
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 Dec 18, 2015
My custom bashrc (with Alsi)
View .bashrc
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
red="\[\e[0;33m\]"
yellow="\[\e[0;31m\]"