Skip to content

Instantly share code, notes, and snippets.

David Laing mrdavidlaing

Block or report user

Report or block mrdavidlaing

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9d8d934372cba968169a
--- /dev/null
+++ b/templates/logsearch_for_cloudfoundry.yml
@@ -0,0 +1,17 @@
+properties:
+ uaa:
+ clients:
+ elk-for-pcf:
+ authorities: uaa.none
+ authorized-grant-types: authorization_code,refresh_token
+ override: true
@mrdavidlaing
mrdavidlaing / Instructions.md
Created Mar 31, 2015
CF v205 + Logsearch v19 + logsearch-for-cloudfoundry-boshrelease
View Instructions.md
@mrdavidlaing
mrdavidlaing / README.md
Last active Aug 29, 2015
Ship wp-stream data to ingestor.meta.logsearch.io
View README.md

##Install After installing the WP-Stream plugin tested with - this version, replace wp-content/plugins/stream/classes/class-wp-stream-api.php with the modified file below to have WP-Stream also ship its data to ingestor.meta.logsearch.io so it can be seen in the WP-Stream dashboard

See diff for details of the changes; basically one function and one call to that function

##Firewall rules The source IP of the WP host needs to be added to the [TrustedIngestion Security Group](https://github.com/cityindex/labs-operations/bl

@mrdavidlaing
mrdavidlaing / EC2-2013-02-01.yml
Created Jan 20, 2014
Add support for spot instances to BOSH AWS CPI
View EC2-2013-02-01.yml
# Replace: /var/vcap/packages/director/gem_home/gems/aws-sdk-1.8.5/lib/aws/api_config/EC2-2013-02-01.yml
#
# Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
@mrdavidlaing
mrdavidlaing / Price-Latency-Kibana-dashboard.json
Last active Dec 28, 2015
Price Latency Kibana dashboard
View Price-Latency-Kibana-dashboard.json
{
"title": "Price Latency",
"services": {
"query": {
"idQueue": [],
"list": {
"0": {
"query": "*",
"alias": "All",
"color": "#DEDAF7",
@mrdavidlaing
mrdavidlaing / gist:4609876
Created Jan 23, 2013
Using latest http://github.com/zephirworks/cloudfoundry-mongodb-service-cookbook bundle exec kitchen test --platform ubuntu-12.04 gives: ``` [Wed, 23 Jan 2013 16:38:11 +0000] FATAL: NoMethodError: undefined method `notifies' for "cloudfoundry_source[cloud_controller]":String /Users/mrdavidlaing/.rvm/gems/ruby-1.9.3-p0/gems/vagrant-1.0.5/lib/vagr…
View gist:4609876
[16:32][mrdavidlaing@maccy001:~/Projects/zephirworks/cloudfoundry-mongodb-service-cookbook(master)]$ rm -rf /Users/mrdavidlaing/Projects/zephirwor/cloudfoundry-mongodb-service-cookbook/test/kitchen/.kitchen/
[16:32][mrdavidlaing@maccy001:~/Projects/zephirworks/cloudfoundry-mongodb-service-cookbook(master)]$ bundle exec kitchen test --platform ubuntu-12.04
checking cloudfoundry-mongodb-service
WARNING: No cookbooks to test in /Users/mrdavidlaing/Projects/zephirworks/cloudfoundry-mongodb-service-cookbook/.. - is your cookbook path misconfigured?
Assembling required cookbooks at [/Users/mrdavidlaing/Projects/zephirworks/cloudfoundry-mongodb-service-cookbook/test/kitchen/.kitchen/cookbooks].
[ubuntu-12.04] Importing base box 'opscode-ubuntu-12.04'...
[ubuntu-12.04] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
@mrdavidlaing
mrdavidlaing / microcf.app.rb.patch
Created Jan 23, 2013
w.r.t: http://help.ironfoundry.org/tickets/56610 Changes to .rb files in c:\IronFoundry\setup to get the IronFoundry DEA to connect to the latest Micro Cloud Foundry (v119).
View microcf.app.rb.patch
--- /var/vcap/packages/cloud_controller/cloud_controller/app/models/app.rb 2012-01-30 20:24:18.000000000 +0000
+++ /var/vcap/packages/cloud_controller/cloud_controller/app/models/app_new.rb 2012-03-13 23:24:19.214790495 +0000
@@ -23,8 +23,8 @@
AppStates = %w[STOPPED STARTED]
PackageStates = %w[PENDING STAGED FAILED]
- Runtimes = %w[ruby18 ruby19 java node node06 php erlangR14B02 python26]
- Frameworks = %w[sinatra rails3 java_web spring grails node php otp_rebar lift wsgi django unknown]
+ Runtimes = %w[ruby18 ruby19 java node php erlangR14B02 python26 aspdotnet40]
+ Frameworks = %w[sinatra rails3 java_web spring grails node php otp_rebar lift aspdotnet wsgi django unknown]
@mrdavidlaing
mrdavidlaing / CreditCard-complex-functional.js
Created Apr 16, 2011
A simple example of the "switch" code smell
View CreditCard-complex-functional.js
function CreditCard(http) {
this.process = function(cardType, cardNumber) {
var cardProcessor = {
"VISA": this.processVisa,
"MASTERCARD": this.processMasterCard,
"AMEX": this.processAmex
};
cardProcessor[cardType](cardNumber);
};
this.processVisa = function(cardNumber) {
View basic_for_loop.cs
List<Market> markets = api.GetMarkets(MarketType.FX);
/*
* Using a primitive for loop
* - Opportunity for off by one errors
* - Syntax noise - declaring an empty List, thinking about i & markets[i]
*/
List<Market> openMarkets = new List<Market>();
for(int i=0; i < markets.Count; i++)
{
You can’t perform that action at this time.