Skip to content

Instantly share code, notes, and snippets.

### Check config
{
"checks": {
"cron": {
"command": "/opt/sensu/embedded/bin/check-process.rb -p cron",
"subscribers": ["default"],
"interval": 60,
"handler": "default"
}
@sdmx
sdmx / keybase.md
Created March 2, 2017 19:34
keybase.md

Keybase proof

I hereby claim:

  • I am sdmx on github.
  • I am sdmx (https://keybase.io/sdmx) on keybase.
  • I have a public key whose fingerprint is DDEE CC77 E1B8 8C51 9517 33DD 6E67 D08B 4CFB B85E

To claim this, I am signing this object:

Segmented Fetch: SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[FPhZ18W7QtmtIAeKNOzs6w][logstash-2015.03.17][0]: SearchParseException[[logstash-2015.03.17][0]: query[ConstantScore(BooleanFilter(+cache(@timestamp:[1426610235903 TO 1426611135903])))],from[-1],size[500],sort[<custom:"@timestamp": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@7772fd10>!]: Parse Failure [Failed to parse source [{"size":500,"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}}},"query":{"filtered":{"query":{"query_string":{"query":"*"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":1426610235903,"lte":1426611135903}}}],"must_not":[]}}}},"sort":{"@timestamp":"desc"},"aggs":{"2":{"date_histogram":{"field":"@timestamp","interval":"30000ms","min_doc_count":0,"extended_bounds":{"min":1426610235903,"max":1426611135903}}}},"fields":["*","_source"],"script_fields":{"@timestamp":{"script"
@sdmx
sdmx / gist:34588d94461963bccd0e
Last active August 29, 2015 14:07
Ruby code test
#!/usr/bin/ruby
# Step 1 - This is literally terrible.
=begin
def Add(numbers) # Define the method Add, which takes the 'numbers' variable.
adds=numbers.split(",") # Apply the split method to the 'numbers' variable, breaking the string into an array of substrings. Store them in the 'adds' variable.
sum=adds[0].to_i+adds[1].to_i # Convert the substrings of the 'sum' variable to integers. I had problems doing this with a map method, so this is brute force. Store in the 'sum' variable.
puts sum # Present the summed result in the 'sum' variable.
end
@sdmx
sdmx / gist:a8cecfeeced1f99b464a
Created September 29, 2014 23:32
ruby snipper for calc task
def Add(numbers)
delim=numbers.scan(/^..(.)$/m)
adds=numbers.split(/\n/)
array=adds[1].split(/#{delim}/)
#puts delim
puts array
sum=array.compact.map{ |s| s.to_i}
sum=sum.inject(:+).to_i
puts sum
end