Skip to content

Instantly share code, notes, and snippets.

View zipkid's full-sized avatar
💭
Eating 🍪

Stefan Goethals zipkid

💭
Eating 🍪
View GitHub Profile
- id: <UUID>
alias: Power Alert
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.dsmr_reader_power_consumed
for:
hours: 0
minutes: 5
seconds: 0

Keybase proof

I hereby claim:

  • I am zipkid on github.
  • I am zipkid (https://keybase.io/zipkid) on keybase.
  • I have a public key whose fingerprint is 614B 88C6 C2FF 0292 7C9F 6215 5CE9 BFD9 8859 FE9E

To claim this, I am signing this object:

Verifying that +zipkid is my openname (Bitcoin username). https://onename.io/zipkid
@zipkid
zipkid / gist:1ba71dd286d744c0ec54
Created July 29, 2014 11:56
treeperms bash function
treeperms(){ d=$(cd "$1" ; pwd -P) ; ls -ld "$d"; [[ "$d" != "/" ]] && treeperms $(dirname "$d"); }
@zipkid
zipkid / cron
Last active August 29, 2015 14:03
Puppet cron type wiping an existing crontab if it contains invalid entries
Tested on
- 3.4.2 : FAIL
- 3.6.2 : FAIL
[root@stditop ~]# cat c.pp
cron { 'test':
ensure => present,
command => 'ls',
}
@zipkid
zipkid / Vagrantfile
Created July 14, 2014 09:48
Shell provisioner use in Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
config.vm.define :puppet do |vm_config|'
vm_config.vm.provider :digital_ocean do |provider, override|
# stuff for DO
---
:hierarchy:
- 01_Nodes/%{::domain}/%{::hostname}
- 01_Nodes/%{::domain}/common
- 02_Nodes_Certname/%{::clientcert}
- 03_Operatingsystem/%{::operatingsystem}
- 03_Operatingsystem/%{::operatingsystem}/%{::operatingsystemmajrelease}
- 03_Operatingsystem/%{::operatingsystem}/%{::operatingsystemmajrelease}/%{::operatingsystemrelease}
- 05_OsFamily/%{::osfamily}
- 06_Kernel/%{::kernel}
19:58 < happytux> I do this because I want that the role 'role::mail::primary' will be looked up as mail_primary.yaml.
see files...
[root@poison ~]# cd /etc/puppet/modules/
[root@poison modules]# mkdir -p broken/manifests
[root@poison modules]# cd broken/manifests/
[root@poison manifests]# vi init.pp
[root@poison manifests]# cat init.pp
class broken (
$param1="default1", $param2='default2', $param3='default3'
) {
notify { "class broken, param1=${param1} param2=${param2} param3=${param3}": }
}
@zipkid
zipkid / gist:b2d28fd64e5be6a6f1f6
Last active August 29, 2015 14:01
Puppet 3.6.1 parser = future FixNum conversion
puppet apply --parser current -e '$f=1 file { "abc": content=>$f, path=>"/tmp/abc"}'
This is OK
puppet apply --parser future -e '$f=1 file { "abc": content=>$f, path=>"/tmp/abc"}'
Error: Parameter content failed on File[abc]: Munging failed for value 1 in class content: can't convert Fixnum into String at line 1
puppet apply --parser current -e '$f=1 file { $f: path=>"/tmp/abc" }'
This is OK