Skip to content

Instantly share code, notes, and snippets.

View gregohardy's full-sized avatar

Greg Hardy gregohardy

  • Puppet Labs
  • Belfast
View GitHub Profile
@gregohardy
gregohardy / azure_resource_content.pp
Created March 28, 2017 13:41
azure resource with content
azure_resource_group { 'test-rg':
ensure => present,
location => 'eastus',
}
# Example with a source
azure_resource_template { 'test-storage-account':
ensure => 'present',
resource_group => 'test-rg',
source => 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-storage-account-create/azuredeploy.json',
params => {
@gregohardy
gregohardy / ruby_spec.rb
Last active October 10, 2016 15:39
Server spec
require 'spec_helper'
require 'pry'
%w(serverspec rake).each do |package_name|
describe package(package_name) do
it { should be_installed.by('gem') }
end
end
[
@gregohardy
gregohardy / OSXtest.sh
Last active October 8, 2016 09:24
gzip => base64 encoding of long strings => decode => gunzip
#!/bin/bash
BAR=$(printf '#!/bin/bash\ntouch /tmp/ididit\necho \"root:changeme2016\" | chpasswd"' | gzip | openssl base64 -A)
echo $BAR | python -m base64 -d | gunzip
@gregohardy
gregohardy / Installation and runnanization
Last active July 29, 2016 15:40
Azure ARM simple ruby examples
$ gem install gem install azure_mgmt_compute
$ ruby status.rb
There are [1] in this account
AZURE VM IDs FOR THIS ACCOUNT
=============================
/subscriptions/<subscription id###>/resourceGroups/CLOUD-ACCEPTANCE-TESTS/providers/Microsoft.Compute/virtualMachines/CLOUD-3cdbed43
=============================