This file contains hidden or 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
class NodeUpdateFromFile < ::Chef::Knife | |
deps do | |
require "chef/node" | |
require "chef/json_compat" | |
require "chef/knife/core/object_loader" | |
end | |
banner "knife node update from file FILE (options)" | |
def loader |
This file contains hidden or 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
module Foo | |
def foo; end | |
end | |
module Bar | |
def bar; end | |
end | |
class Baz | |
include Foo |
This file contains hidden or 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
# This file is used by Rack-based servers to start the application. | |
require ::File.expand_path('../config/environment', __FILE__) | |
map '/redmine' do | |
run RedmineApp::Application | |
end |
This file contains hidden or 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
chef_gem "my_gem" | |
source "#{Chef::Config[:file_cache_path]}/my.gem" | |
# only do anything if we are notified | |
action :nothing | |
end | |
remote_file "#{Chef::Config[:file_cache_path]}/my.gem" do | |
source "http://example.com/my.gem" | |
checksum "deadbeefdeadbeefdeadbeef" |
This file contains hidden or 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
%{IP:client_ip}:%{INT:client_port} \[%{HAPROXYDATE:accept_date}\] %{NOTSPACE:frontend_name} %{NOTSPACE:backend_name}/%{NOTSPACE:server_name} %{INT:time_request}/%{INT:time_queue}/%{INT:time_backend_connect}/%{INT:time_backend_response}/%{NOTSPACE:time_duration} %{INT:http_status_code} %{NOTSPACE:bytes_read} %{DATA:captured_request_cookie} %{DATA:captured_response_cookie} %{NOTSPACE:termination_state} %{INT:actconn}/%{INT:feconn}/%{INT:beconn}/%{INT:srvconn}/%{NOTSPACE:retries} %{INT:srv_queue}/%{INT:backend_queue} (\{%{HAPROXYCAPTUREDREQUESTHEADERS}\})?( )?(\{%{HAPROXYCAPTUREDRESPONSEHEADERS}\})?( )?"%{WORD:http_verb} %{URIPATHPARAM:http_request}( HTTP/%{NUMBER:http_version}")? |
This file contains hidden or 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
map $http_accept_language $lang { | |
default en; | |
~de de; | |
~en en; | |
} | |
location /foo/bar/baz/lang.js { | |
try_files $uri.$lang $uri; | |
} |
This file contains hidden or 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 'yaml' | |
str = <<-EOF | |
- foo | |
2012-06-04 12:02:16.979 | |
EOF | |
str.to_yaml | |
# | |
# TypeError: can't convert nil into Integer | |
# from /Users/hjust/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych/scalar_scanner.rb:111:in `utc' |
This file contains hidden or 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
diff --git a/db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb b/db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb | |
index 0e76661..80a9a60 100644 | |
--- a/db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb | |
+++ b/db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb | |
@@ -50,6 +50,10 @@ class BuildInitialJournalsForActsAsJournalized < ActiveRecord::Migration | |
puts "ERROR: errors creating the initial journal for #{o.class.to_s}##{o.id.to_s}:" | |
puts " #{ex.message}" | |
end | |
+ rescue Exception => ex | |
+ puts "ERROR: errors creating the initial journal for #{o.class.to_s}##{o.id.to_s}:" |
This file contains hidden or 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
curl -XPUT 'http://localhost:9200/_template/template_logstash/' -d ' | |
{ | |
"template": "logstash-*", | |
"settings": { | |
"index.cache.field.type" : "soft", | |
"index.refresh_interval" : "5s", | |
"index.store.compress.stored" : true, | |
"index.store.compress.tv" : true, | |
"index.query.default_field" : "@message" | |
}, |
This file contains hidden or 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 'zmq' | |
require 'logstash-event' | |
context = ZMQ::Context.new(1) | |
socket = context.socket(ZMQ::PUSH) | |
socket.connect("tcp://127.0.0.1:5555") | |
event = LogStash::Event.new( | |
"@message" => "Hello World" | |
).to_json |