Skip to content

Instantly share code, notes, and snippets.

@domcleal
domcleal / cloudapp-export.rb
Last active April 15, 2016 06:59 — forked from adamcooke/cloudapp-export.rb
Export all your drops from CloudApp using this quick Ruby script
#!/usr/bin/env ruby
# A quick script to download all your files from CloudApp.
# To run this just run the script passing your e-mail & password
# to the script, for example:
#
# gem install cloudapp_api
# ruby cloudapp-export.rb adam@atechmedia.com mypassword
#
Info: Applying configuration version '1418826679'
Debug: Augeas[kerberos_etc_services](provider=augeas): Opening augeas with root /, lens path /var/lib/puppet/lib/augeas/lenses, flags 32
Debug: Augeas[kerberos_etc_services](provider=augeas): Augeas version 1.0.0 is installed
Debug: Augeas[kerberos_etc_services](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'defnode' with params ["kerberostcp", "/files/etc/services/service-name[.=\"kerberos\"][protocol = \"tcp\"]", "kerberos"]
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'set' with params ["$kerberostcp/port", "88"]
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'set' with params ["$kerberostcp/protocol", "tcp"]
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'remove' with params ["$kerberostcp/alias"]
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'ins' with params ["
@domcleal
domcleal / augeas.md
Last active August 29, 2015 14:11 — forked from riton/augeas.md

After first puppet execution

augtool> print /files/etc/services/service-name[.="kerberos"]
/files/etc/services/service-name[171] = "kerberos"
/files/etc/services/service-name[171]/port = "88"
/files/etc/services/service-name[171]/protocol = "tcp"
/files/etc/services/service-name[171]/alias[1] = "kerberos5"
/files/etc/services/service-name[171]/alias[2] = "krb5"
/files/etc/services/service-name[171]/alias[3] = "kerberos-sec"
@domcleal
domcleal / augeas.md
Last active August 29, 2015 14:11 — forked from riton/augeas.md

After first puppet execution

augtool> print /files/etc/services/service-name[.="kerberos"]
/files/etc/services/service-name[171] = "kerberos"
/files/etc/services/service-name[171]/port = "88"
/files/etc/services/service-name[171]/protocol = "tcp"
/files/etc/services/service-name[171]/alias[1] = "kerberos5"
/files/etc/services/service-name[171]/alias[2] = "krb5"
/files/etc/services/service-name[171]/alias[3] = "kerberos-sec"
require 'spec_helper'
require 'puppet/reports'
require 'webmock/rspec'
require 'ostruct'
class ErbStruct < OpenStruct
def initialize(values)
values.each { |k,v| instance_variable_set("@#{k}", v) }
super
end
class sodefaultserver {
include resolv_conf
resolv_conf{ 'resolv.conf' :
domainname=> 'abc.com',
searchpath=> 'abc.com',
nameservers => ['10.87.42.109', '10.87.42.110'],
options => ['timeout:2', 'attempts:3'],
}
@domcleal
domcleal / ruby.rb
Created November 14, 2012 10:30 — forked from raphink/ruby.rb
if before or after
# Insert before or after given path
aug.insert(before or after, "path", before ? true : false)
entry_path = "#{fpath}/path[count(*)=0]"
end