Skip to content

Instantly share code, notes, and snippets.

Dominic Cleal domcleal

View GitHub Profile
@domcleal
domcleal / cloudapp-export.rb
Last active Apr 15, 2016 — forked from adamcooke/cloudapp-export.rb
Export all your drops from CloudApp using this quick Ruby script
View cloudapp-export.rb
#!/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
#
View output_debug.md
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 ["
View 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"
View 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"
View foreman_report_processor.rb
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
View gist:4208957
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'],
}
View 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
You can’t perform that action at this time.