Skip to content

Instantly share code, notes, and snippets.

View gerhard's full-sized avatar

Gerhard Lazu gerhard

View GitHub Profile
---
- name: Register New Relic repository.
get_url: url=http://download.newrelic.com/debian/newrelic.list
dest=/etc/apt/sources.list.d/newrelic.list
- name: Download repo key.
apt_key: url=http://download.newrelic.com/548C16BF.gpg
- name: Install New Relic.
apt: pkg=newrelic-sysmond update_cache=yes
### Keybase proof
I hereby claim:
* I am gerhard on github.
* I am gerhard (https://keybase.io/gerhard) on keybase.
* I have a public key whose fingerprint is 6224 6FEB B789 9C1F A270 C1CE DA0C AD31 A4BC B3FF
To claim this, I am signing this object:
@gerhard
gerhard / servers.rb
Last active August 29, 2015 14:02
Servers from hash - ordering, match by name
Server = Struct.new(:ami, :name, :created_at) do
def self.from_aws(ami_name_created_at)
ami, name, created_at_string = ami_name_created_at[0], *ami_name_created_at[1].split(" ")
new(ami, name, Time.parse(created_at_string))
end
end
class Servers
def self.from_aws_hash(hash)
new(hash.map(&Server.method(:from_aws)))
@gerhard
gerhard / the_way_cloudcredo_developers_work.md
Last active August 29, 2015 14:07
The way CloudCredo developers work

This description of "the way we work" is targeted at new CloudCredoers, developers from other organisations that we pair with and other people which are interested in this process.

Inception

Every project stage starts with an Inception. Each project stage normally spans 3 months.

In an inception we talk about Goals, Non-goals, Risks, Actors, Activities and Stories.

The outcome of the Inception are pointed Stories the team can start working on straight away.

@gerhard
gerhard / bosh_cf_service_terminologies.md
Created October 15, 2014 14:31
Bosh/CF service terminologies

Service

External process type which provides functionality to a CF application. MySQL, Redis, RabbitMQ, Hadoop are examples of services.

Service Instance

Allocation of a service type resource which is shared by instances of one or more CF applications. For example, multiple instances of the same Rails application would share a single MySQL service instance. A Rails web process will share the same MySQL instance with a Rails worker process. When deployed to CF, these web and worker processes will appear as 2 separate applications.

Service Instance Binding

@gerhard
gerhard / nginx.conf
Last active August 29, 2015 14:10 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
#!/usr/bin/env bash
[ -z "$DEBUG" ] || set -x
main() {
resolve_dependencies
if [[ "$@" =~ watch ]]
then
autotest
jQuery('select[name*=product_type_id]').each(function() {
console.log(jQuery(this).val());
// these categories won't have products associated to them
// MAKE SURE the ids stay the same
if ( jQuery.inArray(jQuery(this).val(), ["4", "6", "7"]) )
// hide the product_id select parent, p in this case
jQuery(this).parent().next().hide();
});
// NOTE TO SELF
/Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/dependencies.rb:262:in `load_missing_constant': Expected /Users/gerhardlazu/code/sitedirect/app/models/work_order_item.rb to define Work_order_item (LoadError)
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/dependencies.rb:468:in `const_missing'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/dependencies.rb:480:in `const_missing'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/inflector.rb:285:in `constantize'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/inflector.rb:284:in `each'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/inflector.rb:284:in `constantize'
from /Users/gerhardlazu/code/sitedirect/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:143:in `constantize'
from /Users/gerhardlazu/code