Skip to content

Instantly share code, notes, and snippets.

View dangarthwaite's full-sized avatar

Dan Garthwaite dangarthwaite

View GitHub Profile
@dangarthwaite
dangarthwaite / elasticsearch.yml
Created December 3, 2012 22:43
salt state for elasticsearch on squeeze
# vim: ft=yaml
cluster.name: {{ ES_CLUSTER_NAME }}
node.name: {{ grains['id'] }}
network.host: {{ salt['cmd.run']('awk \'/192.168/ {print $2}\' /etc/network/interfaces') }}
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["192.168.1.2", "192.168.1.3"]
@dangarthwaite
dangarthwaite / check_mk.py
Last active December 17, 2015 21:29
A first take on configuring check_mk to invoke check_mk_agent on minions over salt publish. See: http://saltstack.org and http://mathias-kettner.com/check_mk.html
#! /usr/bin/env python
'''Support for running check_mk_agent over salt
/srv/salt/_modules/check_mk.py'''
import os
import salt.utils
from salt.exceptions import SaltException
def __virtual__():
''' Only load the module if check-mk-agent is installed '''
if os.path.exists('/usr/bin/check_mk_agent'):
{:message=>"Patt: %{INTCOMBINEDAPACHELOG}(?: \\\"%{DATA:forwardfor}\\\" \\\"%{DATA:compression}\\\" \\\"%{WORD:node}:%{POSINT:pid}:%{POSINT:seq}\\\" %{NUMBER:delay} \\\"%{NOTSPACE:host}\\\")", :level=>:info}
{:message=>"Match type coerce: int", :level=>:info}
@dangarthwaite
dangarthwaite / etl.py
Last active October 21, 2015 18:36
Skeleton luigi example.
#!/usr/bin/env python
# encoding: utf-8
import luigi
import os
class Validate(luigi.Task):
region = luigi.Parameter()
def run(self):
@dangarthwaite
dangarthwaite / zerocruft.user.js
Created July 12, 2016 16:18
Userscript to add j/k keyboard navigation to zerohedge
// ==UserScript==
// @name ZeroCruft
// @version 1.1
// @namespace 1bae28cfed0eddb302b3ac9b578412a3
// @author Dan Garthwaite <[email protected]>
// @description Removes the cruft from the new zerohedge
// @include http://*zerohedge.com/*
// @run-at document-end
// ==/UserScript==
import jenkins.model.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import org.jenkinsci.plugins.plaincredentials.*
import org.jenkinsci.plugins.plaincredentials.impl.*
import hudson.util.Secret
import hudson.plugins.sshslaves.*
#!/usr/bin/env bash
# Override defaults with environment variables
CONFIGFILE="${CONFIGFILE:-/etc/lbry/chainqueryconfig.toml}"
DEBUGMODE="${DEBUGMODE:-false}"
RPC_USER="${RPC_USER:-lbry}"
RPC_PASSWORD="${RPC_PASSWORD:-lbry}"
RPC_HOST="${RPC_HOST:-localhost}"
MYSQL_SERVER="${MYSQL_SERVER:-localhost}"
MYSQL_USER="${MYSQL_USER:-lbry}"

Keybase proof

I hereby claim:

  • I am dangarthwaite on github.
  • I am dgartoptal (https://keybase.io/dgartoptal) on keybase.
  • I have a public key ASB30Icm14AEWu6t3zHHPw5Ik8LthOKIxFkSRkbxxFjrpgo

To claim this, I am signing this object: