Skip to content

Instantly share code, notes, and snippets.

View ftclausen's full-sized avatar

Friedrich Clausen ftclausen

View GitHub Profile
@ftclausen
ftclausen / gradle-dependency-lock-plugin v2.2.2_v2.2.3.diff
Created October 22, 2015 03:08
What breaks the lock file generation?
diff --git a/gradle.properties b/gradle.properties
index 48c940f..cf19926 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1 +1 @@
-version=2.2.2
+version=2.2.3
diff --git a/src/main/groovy/nebula/plugin/dependencylock/DependencyLockPlugin.groovy b/src/main/groovy/nebula/plugin/dependencylock/DependencyLockPlugin.groovy
index 81a5466..eb6125d 100644
--- a/src/main/groovy/nebula/plugin/dependencylock/DependencyLockPlugin.groovy
require 'spec_helper'
describe 'test_mycookbook::doit' do
iaas_providers = [ 'ec2' ]
iaas_providers.each do |provider|
context "Test on cloud provider #{provider}" do
let(:chef_run) { ChefSpec::Runner.new(platform: 'ubuntu', version: '12.04').converge('test_mycookbook::doit') }
it 'should do the thing' do
require 'chef/node'
require 'chef/run_list'
require 'json'
nodes = search(:node, 'name:*example*')
nodes.each do |node|
new_run_list = '["recipe[example_cookbook]", "role[some_role]"]'
node.run_list(JSON.parse(new_run_list))
node.save
end
@ftclausen
ftclausen / gist:292aef2ff55477711d89
Created August 19, 2014 04:23
CloudFormation - Attempt to use security group with subnet.
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template UpdateTutorial Part 1: Sample template that can be used to test EC2 updates. **WARNING** This template creates an Amazon Ec2 Instance. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"WebServerInstanceType" : {
"Description" : "WebServer EC2 instance type",
"Type" : "String",
@ftclausen
ftclausen / find_unattached_nrsysmond.rb
Created July 20, 2014 23:38
Find unattached nrsysmond instances.
#!/usr/bin/env ruby
require 'rubygems'
require 'rest_client'
require 'json'
banner = <<-EOS
Report all New Relic applications that do not have the system monitor
daemon reporting into the given application environment.
Usage:
@ftclausen
ftclausen / davmail-soap.xml
Created February 18, 2014 00:56
Davmail -> Exhange server SOAP request.
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP1"/>
</soap:Header>
<soap:Body>
<m:FindFolder Traversal="Shallow">
<m:FolderShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
@ftclausen
ftclausen / cat-less
Created October 10, 2013 09:57
While loop avoiding useless use of cat
exec 6<somelist.txt
while read -u 6 -r item; do
echo "Doing something with $item
done
@ftclausen
ftclausen / cat
Created October 10, 2013 09:53
Useless use of cat?
while read -r item; do
echo "Doing something with $item"
done < <(cat somelist.txt)