Best cheatsheet is: cucumber --help
Notification formats, in increasing order of verbosity:
Feature: solrserver remote health | |
In order to remotely ensure a healthy solrserver | |
As a client talking to the solrserver | |
I want to ensure solrserver is responsive | |
Scenario: Check the status of solrserver | |
Given a dns name of "solr" | |
And requests timeout after 2 seconds | |
When I fetch "http://solr:8983/solr/admin/cores?action=status" for each dns entry | |
Then there should be no timeouts |
class RakeLogger < Vagrant::UI | |
def initialize(env,logger) | |
super(env) | |
@logger = logger | |
end | |
[[:warn, :yellow], [:error, :red], [:info, nil], [:confirm, :green]].each do |method, color| | |
class_eval <<-CODE | |
def #{method}(message, opts=nil) | |
@logger.warn("\#{line_reset}\#{format_message(message, opts)}") |
# Use Chef resources in an application via solo mode. | |
# Could also be configured in client mode, and then use a server. | |
require 'rubygems' | |
require 'chef' | |
require 'chef/client' | |
require 'chef/run_context' | |
Chef::Config[:solo] = true | |
Chef::Config[:log_level] = :info |
% ruby multiple-to-rpm.rb thin sinatra cabin json | |
Trying to download {"gem":"thin","version":null,"level":"info"} | |
Using gem file {"path":"/home/jls/.rvm/gems/ruby-1.9.3-p0/cache/thin-1.3.1.gem","level":"info"} | |
Building native extensions. This could take a while... | |
Successfully installed thin-1.3.1 | |
1 gem installed | |
Trying to download {"gem":"sinatra","version":null,"level":"info"} | |
Using gem file {"path":"/home/jls/.rvm/gems/ruby-1.9.3-p0/cache/sinatra-1.3.2.gem","level":"info"} | |
Successfully installed sinatra-1.3.2 | |
1 gem installed |
#!/usr/bin/env ruby | |
recipe_path = ARGV[0] | |
if recipe_path.nil? | |
STDERR.puts "usage: chef-apply RECIPE_FILE" | |
exit 1 | |
end | |
recipe_path = File.expand_path(recipe_path) |
Several times in a month there pop up questions regarding query structure on the ElasticSearch user group. | |
Although there are good docs explaining this in depth probably the bird view of the Query DSL is necessary to | |
understand what is written there. There is even already some good external documentation available: | |
http://www.elasticsearch.org/tutorials/2011/08/28/query-dsl-explained.html | |
And there were attempts to define a schema: | |
http://groups.google.com/group/json-schema/browse_thread/thread/ae498ee818155d50 | |
https://gist.github.com/8887766ca0e7052814b0 |
The problem is that some lines in the file are missing timestamps when they aren't continuations of any previous line. It's dumb, really.
The mysql query log is seriously bullshit format, but nothing logstash can't unscrew.
The main goal here is to show how we can fix the 'missing timestamp' problem.
% ruby bin/logstash agent -e '
#!/usr/bin/env bash | |
set -e | |
# # Mac OS X 10.7/10.8/10.9/10.10 Bootstrapping | |
# | |
# ## Pre-requisites | |
# | |
# 1. Set your hostname: In **System Preferences** go to **Sharing** and enter | |
# the name in **Computer Name** | |
# 2. Run **Software Update** and reboot if necessary |
input { | |
tcp { | |
type => "linux-syslog" | |
port => 3333 | |
} | |
file { | |
type => "linux-syslog" | |
path => [ "/var/log/auth.log" ] | |
} |