Skip to content

Instantly share code, notes, and snippets.

@flaviut
flaviut / Setting up Emporia Vue 2 with ESPHome.md
Last active June 6, 2024 06:00
Setting up Emporia Vue 2 with ESPHome
@xbmcnut
xbmcnut / shellypm1_fan.yaml
Last active March 12, 2021 08:19
How to make a dumb device smart using a Shelly PM1 | Fan Template example in Home Assistant
fan:
- platform: template
fans:
template_bedroom_fan:
friendly_name: "Master Bedroom Fan"
# Measures the power use from a Shelly1 PM and if over 3W, marks the fan as on
value_template: "{% if states('sensor.bedroom_fan_shelly_power') | float > 3 %}on{% else %}off{% endif %}"
# Uses the Shelly1 PM sensor value to determine what speed the fan is going at. Only set to measure 1, 2 & 3
speed_template: "{{ states('sensor.template_fan_speed_master') }}"
# Uses a fake switch from an input_boolean as the fan has no way of reporting direction back to HA

Use GnuPG to sign pkgsrc packages on SmartOS

I hope you have an public an private key already. If not there a lot of manuals out there who explain that very well.

Install the requirements

I would like to use gpg version 2 which supports gpg agent.

pkgin in gnupg2
@javouhey
javouhey / gist:9182400
Created February 24, 2014 05:26
Better git log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
from http://fredkschott.com/post/2014/02/git-log-is-so-2005/
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 13, 2024 21:24
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx