Skip to content

Instantly share code, notes, and snippets.


Frank syphernl

  • The Netherlands
View GitHub Profile
syphernl / ventilation.yaml
Last active May 8, 2021 — forked from SqyD/ventilation.yaml
ESPHome PWM fan using a Wemos D1 mini lite
View ventilation.yaml
# 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:
# * The amazing ESPHome firmware tool:
# * Home Assistant to tie it all together:
# I used to use a Raspberry Pi and some Python code for this. See
# The Wemos approach seems more stable and doesn't require external USB power.
syphernl /
Last active Sep 23, 2016
Saltstack MasterMinion show_highstate attempt
# -*- 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
syphernl / discover_vhosts.php
Created Dec 1, 2014
Low Level Discovery Userscript for Zabbix Agent
View discover_vhosts.php
#!/usr/bin/env php -n
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)
syphernl / gist:25b901d343588ada6e7b
Last active Aug 29, 2015
Saltstack "eventbus" returner
View gist:25b901d343588ada6e7b
# -*- 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.