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
# Controlling my Buva Qstream ventilation system using: | |
# * A Wemos D1 mini lite (an ESP8266 based board) | |
# * A Wemos power shield so I can power the Wemos from the ventilation units 12V supply. | |
# * A simple PWM to 10V convertor like this: https://www.cheaptech.nl/pwm-signaal-te-voltage-converter-1-3-khz-0-10-v-pw.html | |
# * The amazing ESPHome firmware tool: https://esphome.io | |
# * Home Assistant to tie it all together: https://www.home-assistant.io | |
# | |
# I used to use a Raspberry Pi and some Python code for this. See https://gist.github.com/SqyD/a927ab612df767a0cc892bcde23d025c | |
# The Wemos approach seems more stable and doesn't require external USB power. |
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
# -*- coding: utf-8 -*- | |
''' | |
Functions to interact with the state compiler on the master | |
''' | |
from __future__ import absolute_import | |
import pprint | |
# Import salt libs | |
import salt.utils.minion |
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 php -n | |
<?php | |
function apache_vhosts($binary='/usr/sbin/apache2ctl') | |
{ | |
$command = " -S 2>&1 | grep 'port ' | awk {'print $2,$4'} | sort -u -t' ' -k2,2 | grep -v 'localhost'"; | |
$vhosts = shell_exec(sprintf("%s %s", $binary, $command)); | |
$vhosts = explode("\n", trim($vhosts)); | |
$results = array(); | |
foreach($vhosts as $vhost) |
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
# -*- coding: utf-8 -*- | |
''' | |
Return data to a the Salt Eventbus. | |
Huh, that's default behavior isn't it? Technically yes. | |
But.. Not when you: | |
- use 'salt-call' on a minion | |
- use the Salt scheduler to execute periodically | |
Which means, the master doesn't get executed tasks in its job cache. | |
Very annoying if you want to create nice graphs of state executions. |