Skip to content

Instantly share code, notes, and snippets.

View RolfKoenders's full-sized avatar

Rolf Koenders RolfKoenders

  • iO Digital
  • The Netherlands
View GitHub Profile
@jhjelmar
jhjelmar / Z2M_Hue_Dimmer_Switch_v3.yaml
Last active November 16, 2023 14:35 — forked from hugalafutro/Z2M_Hue_Dimmer_Switch_v2.yaml
Z2M_Hue_Dimmer_Switch_v3.yaml
blueprint:
name: Zigbee2Mqtt Hue Dimmer Switch control v3
description: ''
domain: automation
input:
dimmer_action:
name: Dimmer MQTT topic
description: 'type in your Dimmer MQTT topic (i.e. zigbee2mqtt/Dimmer/action)'
selector:
text:
@freakshock88
freakshock88 / philips_hue_tap_dial_switch_zigbee2mqtt_actions_blueprint.yaml
Created September 16, 2022 18:16
philips_hue_tap_dial_switch_zigbee2mqtt_actions_blueprint
blueprint:
name: Zigbee2MQTT - Philips Hue Tap dial switch (8719514440937/8719514440999) actions
description: >
Define actions your Philips Hue Tap dial switch using Zigbee2MQTT.
For your button entity, choose the right sensor with your button name and the entity id which ends with '_action', e.g. 'sensor.bedroom_bed_tap_dial_switch_action'
domain: automation
input:
button_sensor:
name: Philips Hue Tap dial switch sensor entity
description: Sensor for Philips Hue Tap dial switch to use (Use sensor with entity_id ends with _action)
@aheadley
aheadley / start-telegraf.sh
Created September 21, 2017 17:46
Telegraf on FreeNAS
#!/bin/bash
# full path to the telegraf executable in the jail it was installed in
TELEGRAF_BIN='/mnt/tank0/jails/telegraf-test/usr/local/bin/telegraf'
# dir for storing the pid, config, and log files
BASE_DIR='/mnt/tank0/home/aheadley'
if [ -f $BASE_DIR/telegraf.pid ] && kill -0 $(cat $BASE_DIR/telegraf.pid) &>/dev/null; then
# don't start it again if it's already running
echo "Telegraf running ($(cat $BASE_DIR/telegraf.pid))..."
@Dunkelheit
Dunkelheit / bunyan-serializers.js
Last active December 1, 2017 15:01
Logging errors with bunyan: with vs. without default serializers
const bunyan = require('bunyan');
const loggerWithoutSerializers = bunyan.createLogger({name: "w/o-srlzrs"});
loggerWithoutSerializers.info('Logging without serializers');
try {
throw new Error('Hiya buddy');
} catch (err) {
loggerWithoutSerializers.error({err}, 'Logging approach #1');
services:
myservice:
volumes: npm-cache:/root/.npm
command: npm run install-start
volumes:
npm-cache:
external: false
@jherax
jherax / filterArray.js
Last active May 6, 2024 09:35
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@hollodotme
hollodotme / Install-nginx-with-http2-support.md
Created April 9, 2016 17:07
Install nginx with http2 support on ubuntu 14.04 LTS (Trusty)

How to install nginx (>= 1.9.5) with http2 support on Ubuntu 14.04 LTS (Trusty)

IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available)!

Remove old nginx

Remove old nginx incl. nginx-common:

apt-get autoremove --purge nginx nginx-common
@devx00
devx00 / LiveCoding Instructions
Created July 11, 2015 19:37
Instructions to setup external streaming and chatting for livecoding.tv streams
// ************** Instructions for connecting to the LiveCoding chatrooms from a 3rd party application. ****************
Step 1a (Ubuntu/ any OS with aptitude (aka apt-get)) :
sudo apt-add-repository ppa:rsrchboy/profanity && sudo apt-get update
apt-get install profanity
--
Step 1b (OSX w/ homebrew):
$ brew install profanity
--------
@protrolium
protrolium / ffmpeg.md
Last active May 3, 2024 18:58
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@JeffPaine
JeffPaine / i3-cheat-sheet.md
Last active May 5, 2024 22:39
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3