Skip to content

Instantly share code, notes, and snippets.

View anaynayak's full-sized avatar

Anay Nayak anaynayak

View GitHub Profile
# (1) copy the newrelic rpm java client into #{RAILS_ROOT}/solr/newrelic
# (2) add a newrelic.yml in that directory with you API key
# (3) add this monkey patch in an initializer to load newrelic with the solr server
Sunspot::Rails::Server.class_eval do
def run
command = ['java']
command << "-Xms#{min_memory}" if min_memory
command << "-Xmx#{max_memory}" if max_memory
command << "-Djetty.port=#{port}" if port
command << "-Dsolr.data.dir=#{solr_data_dir}" if solr_data_dir
@anaynayak
anaynayak / sshgen.rb
Created April 7, 2012 02:38 — forked from warwickp/sshgen.rb
Knife plugin to generate OpenSSH config file from a Chef search
## Knife plugin to generate an OpenSSH config file from a Chef search
# From Harvest. www.getharvest.com
#
# Source: https://github.com/harvesthq/knife-plugins
#
# See http://wiki.opscode.com/display/chef/Knife+Plugins
# See http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config&sektion=5
#
## Install
# Place in .chef/plugins/knife/sshgen.rb