Skip to content

Instantly share code, notes, and snippets.

@endor-force
endor-force / lovelace_energy.yaml
Created January 14, 2022 14:39
Example Home assistant lovelace YAML for presenting consumption energy data from HAN port
- title: Energi
id: energi
icon: mdi:home-lightning-bolt-outline
cards:
- type: energy-date-selection
- type: vertical-stack
cards:
- type: energy-usage-graph
- type: gauge
name: Aktuell förbrukning
@alexellis
alexellis / k8s-pi.md
Last active April 11, 2024 14:17
K8s on Raspbian
@elleryq
elleryq / dump-gsettings.py
Created April 10, 2015 14:23
dump all gsettings. It is same as 'gsettings list-recursively'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""dump gsettings"""
from __future__ import print_function
from subprocess import check_output
def get_schemas():
output = check_output(['gsettings', 'list-schemas'])
schemas = output.split('\n')
@solarce
solarce / ec2.tf
Last active February 4, 2022 04:04
terraform.io example template for ec2 instance with tags
# The various ${var.foo} come from variables.tf
# Specify the provider and access details
provider "aws" {
region = "${var.aws_region}"
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
}
@rothgar
rothgar / main.yml
Last active March 8, 2024 07:16
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@arantius
arantius / simple-rrd-merge.py
Created March 23, 2012 02:43
A very simple script to merge multiple RRD files, since none of those available seem to work.
#!/usr/bin/env python
"""Simple script to merge multiple RRD files together.
Accepts any number of RRD file names as arguments. Produces an "rrdtool dump"
style file on stdout. The last RRD file should have a slot for every possible
record in the resulting merged RRD.
Run something like:
$ python simple-merge-rrd.py filea.rrd fileb.rrd filec.rrd | \