This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
# importlib.metadata is present in Python 3.8 and later | |
import importlib.metadata as importlib_metadata | |
except ImportError: | |
# use the shim package importlib-metadata pre-3.8 | |
import importlib_metadata as importlib_metadata | |
try: | |
__version__ = importlib_metadata.version(__package__ or __name__) | |
except importlib_metadata.PackageNotFoundError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "statsd" | |
# Create a stats instance. | |
statsd = Statsd.new("localhost", 8125) | |
# Increment a counter for 5 minutes, 1 point per second | |
(1...300).each { statsd.count("dev.mike.dogstatsd", 1) ; sleep 1 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
#require 'bundler/setup' | |
require 'date' | |
require 'jiralicious' | |
require 'json' | |
require 'net/https' | |
require 'uri' | |
# Pass component name on command line as first argument |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File dropped of by Chef, local modifications will be overwritten! | |
# 2013-05-08T00:00:02+00:00 10.87.125.117 haproxy[30746]: 10.44.133.138:39039 [07/May/2013:23:59:56.974] public dogdispatcher/i-5e4d843b:9000 4/0/5001/1002/6009 202 166 - - ---- 132/132/35/11/1 0/0 "POST /api/v1/series/?api_key=<redacted> HTTP/1.1" | |
# Field numbers, description, example | |
# Ref: https://code.google.com/p/haproxy-docs/wiki/HTTPLogFormat | |
# 1 (rsyslog) log time | |
# 2 (rsyslog) haproxy server | |
# 3 process_name '[' pid ']:' haproxy[14389]: | |
# 4 client_ip ':' client_port 10.0.1.2:33317 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## mysql::master | |
ruby_block "store_mysql_master_status" do | |
block do | |
node.set[:mysql][:master] = true | |
m = Mysql.new("localhost", "root", node[:mysql][:server_root_password]) | |
m.query("show master status") do |row| | |
row.each_hash do |h| | |
node.set[:mysql][:master_file] = h['File'] | |
node.set[:mysql][:master_position] = h['Position'] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
#njj From http://devops.me/2011/10/10/vagrant-tricks-and-troubleshooting/ | |
config.vm.customize ["modifyvm", :id, "--memory", "800"] | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Knife plugin to set node environment | |
# See http://wiki.opscode.com/display/chef/Environments | |
# | |
## Install | |
# Place in .chef/plugins/knife/set_environment.rb | |
# | |
## Usage | |
# Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node set_environment mynode.net my_env | |
# Looking for mynode.net | |
# Setting environment to my_env |