A collection of Splunk recipes for Heroku logs. Instructions for setting up Splunk Storm with Heroku can be found here. For the vast majority of these recipes you'll need to have enabled the Heroku labs feature, log-runtime-metrics, for your application.
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 'request_spec_helper' | |
| describe "Errors" do | |
| context "test", driver: :rack_test do | |
| include Rack::Test::Methods | |
| def app | |
| app = Rack::Builder.new do | |
| run Rewarder::Application | |
| end.to_app |
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 UriParser | |
| def self.uri_is_image?(uri) | |
| case File.extname(uri.path) | |
| when '.jpg', '.png', '.gif' | |
| return true | |
| else | |
| return false | |
| end | |
| end | |
| 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
| require 'paperclip' | |
| module Paperclip | |
| # Mechanize unlinks its Tempfiles immediately after creating them and some | |
| # Paperclip functionality relies on an actual file available in the | |
| # filesystem; not just a reference. | |
| class MechanizeDownloadAdapter < AbstractAdapter | |
| def initialize(target) | |
| @target = target | |
| cache_current_values |
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
| #!/usr/bin/env python | |
| '''\ | |
| Usage: cookbookdiff COOKBOOK_NAME COOKBOOK_VER LOCAL_PATH [--nocolor] | |
| Diff your LOCAL_PATH against what is on the chef server for a | |
| given cookbook and version. | |
| --nocolor: don't pipe output through 'colordiff' (in case you want to pipe to something else) | |
| Examples: | |
| cookbookdiff percona_toolkit 0.0.4 ~/chef-repo/cookbooks/percona_toolkit |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
- Install VirtualBox
- Install Vagrant
- Download Ubuntu Server ISO
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
| # Tested with: | |
| # * Ruby 2.0 | |
| # * Chef 11.6.2 | |
| require 'chef/knife' | |
| require 'chef/knife/ssh' | |
| module Nodename | |
| def self.prepended(base) |
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
| # Updated for rspec 3.0: | |
| module IncludeRecipeHelper | |
| def enable_stubbed_include_recipe | |
| # Don't worry about external cookbook dependencies | |
| allow_any_instance_of(Chef::Cookbook::Metadata).to receive(:depends) | |
| # Test each recipe in isolation, regardless of includes | |
| @included_recipes = [] | |
| allow_any_instance_of(Chef::RunContext).to receive(:loaded_recipe?).and_return(false) | |
| allow_any_instance_of(Chef::Recipe).to receive(:include_recipe) do |recipe, included_recipe| |
- Open AppleScript
- Paste the
xcode-select-install.osascript into the edit. - Save the file as
xcode-select-install.app, select "Application" from the "File Format" option.
It's important the app is saved with exact name specified or it won't be able to skip the accessibility confirmation when run.
Seeing LSOpenURLsWithRole() failed with error -10810 for the file /var/tmp/xcode-select-install.app?
Run: command "chmod +x xcode-select-install.app/Contents/MacOS/applet"