Skip to content

Instantly share code, notes, and snippets.

View stonith's full-sized avatar

Darren Foo stonith

  • Shopify
  • Vancouver
View GitHub Profile
@mcfrojd
mcfrojd / Shield_Intents.MD
Last active May 20, 2024 19:55
Working INTENTS to use with Community Hass.io Add-ons: Android Debug Bridge for your Nvidia Shield TV

Latest Update 2021-03-06 : New image showing the new "Services" in Home Assistant and got some tips from the comments below.

Credits and thanks: Home Assistant Forum users & Github users: @ocso, @wiphye, @teachingbirds, @tboyce1, @simbesh, @JeffLIrion @ff12 @rebmemer @siaox @DiederikvandenB @Thebuz @clapbr @Finsterclown


Start apps on your android device (in the examples below, my Nvidia Shield TV) from Home Assistant

alt text

Starts Youtube App

entity_id: media_player.shield
command: >-
@afiune
afiune / Both drivers EC2 and Vagrant
Created August 8, 2014 17:42
[tk-multiplatform] - Test Transport Abstraction
salimafiune@afiuneChef:~/github/tk-multiplatform
$ bundle exec kitchen list
Instance Driver Provisioner Transport Last Action
default-windows-2008R2 Ec2 ChefZero winrm <Not Created>
default-ubuntu-1304 Ec2 ChefSolo ssh <Not Created>
default-windows-2012R2 Vagrant ChefSolo winrm <Not Created>
default-centos-65 Vagrant ChefZero ssh <Not Created>
salimafiune@afiuneChef:~/github/tk-multiplatform
$ bundle exec kitchen converge
-----> Starting Kitchen (v1.3.0)

ChefDK, Test Kitchen Driven NTP Cookbook

This gist uses TK+Berkshelf to drive creating a vagrant virts and converging a simple recipe to install and configure NTPd. This is a simple cookbook that has one recipe, one template (for ntp.conf) and one attribute file. It works on Ubuntu 12.04 and CentOS 6.4 (and derviatives) and the attribute file is used to support both distros.

This should work on Mac (where I developed it) and any chef-supported Linux that you can get Vagrant onto (Ubuntu/CentOS).

Because I use ChefDK and Test Kitchen, I can largely ignore setting up Vagrant and Berkshelf and can get right to work on writing recipe code.

NOTE: Modern (7/6/2014) Recipe Generation

@endzyme
endzyme / f5_lb_soap_savon.md
Created June 11, 2013 01:01
F5 Load Balancer SOAP API Interactions with Savon

SOAP Calls

Get Heartbeat String

Connection

soap = 
  Savon.client do |s|
    s.wsdl "https://#{ipaddress}/iControl/iControlPortal.cgi?WSDL=LocalLB.Monitor"
    s.basic_auth [user, password]
    s.ssl_verify_mode :none
    s.endpoint "https://#{ipaddress}/iControl/iControlPortal.cgi"
define ROOT C:\Program Files (x86)\nxlog
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log
<Extension json>
Module xm_json
@benwtr
benwtr / nagios.coffee
Last active January 13, 2016 08:29 — forked from oremj/nagios.coffee
# Description:
# This script receives pages in the formats
# /usr/bin/curl -d host="$HOSTALIAS$" -d output="$SERVICEOUTPUT$" -d description="$SERVICEDESC$" -d type=service -d notificationtype="$NOTIFICATIONTYPE$ -d state="$SERVICESTATE$" $CONTACTADDRESS1$
# /usr/bin/curl -d host="$HOSTNAME$" -d output="$HOSTOUTPUT$" -d type=host -d notificationtype="$NOTIFICATIONTYPE$" -d state="$HOSTSTATE$" $CONTACTADDRESS1$
#
# Based on a gist by oremj (https://gist.github.com/oremj/3702073)
#
# Configuration:
# HUBOT_NAGIOS_URL - https://<user>:<password>@nagios.example.com/cgi-bin/nagios3
#
@louiszuckerman
louiszuckerman / gist:4658921
Last active December 11, 2015 20:59
kibana on passenger in a subdirectory of an existing apache virtual host
# These instructions are derived from the Passenger documentation,
# http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rack_to_sub_uri
# And tested with kibana git master on 1/28/13
# First, create a symlink from the existing virtualhost's
# document root to your kibana installation's public/static
# directory. for example,
# ln -s /path/to/kibana/public /var/www/kibana
# kibana 0.2.0 and earlier will have a /static directory
# instead of /public
@jordansissel
jordansissel / gist:3840775
Created October 5, 2012 16:14
logstash index template for elasticsearch
curl -XPUT http://localhost:9200/_template/logstash-template -d '
{
"template": "logstash-*",
"settings": {
"index.cache.field.type": "soft",
"index.compress.stored": true,
"index.merge.policy.max_merged_segment": "5g",
"index.query.default_field": "@message",
"index.refresh_interval": "5s",
"index.store.compress.stored": true,
@rashidkpc
rashidkpc / gist:3794465
Created September 27, 2012 14:55
Kibana on Passenger
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11
PassengerRuby /usr/bin/ruby
<VirtualHost *:80>
ServerName logs.example.com
ServerAlias logs.example.com
DocumentRoot /home/httpd/Kibana/static
@jordansissel
jordansissel / RESULTS.md
Created September 21, 2012 07:41
screenshot + code showing how to query logstash/elasticsearch with a graphite function.

logstash queries graphed with graphite.

Operation: Decouple whisper from graphite.

Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.

Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?

The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.