This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check YAML files for syntax | |
task :default do | |
require 'yaml' | |
d = Dir["./**/*.yaml"] | |
d.each do |file| | |
begin | |
f = YAML.load_file(file) | |
rescue Exception | |
puts "Invalid YAML #{file}: #{$!}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import pprint | |
import subprocess | |
clientcert = subprocess.check_output(['puppet', 'config', 'print', 'certname']).strip() | |
catalog_file = '/opt/puppetlabs/puppet/cache/client_data/catalog/' + clientcert + '.json' | |
with open(catalog_file) as f: | |
data = json.load(f) | |
pp = pprint.PrettyPrinter(indent=4) | |
for res in data['resources']: |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rule Name: Microsoft Whiteboard | |
---------------------------------------------------------------------- | |
Description: Microsoft Whiteboard | |
Enabled: Yes | |
Direction: Out | |
Profiles: Domain,Private,Public | |
Grouping: Microsoft Whiteboard | |
LocalIP: Any | |
RemoteIP: Any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geoff@computer:~/github/boxcutter_windows$ make eval-win10x64-enterprise --debu | |
GNU Make 4.1 | |
Built for x86_64-pc-linux-gnu | |
Copyright (C) 1988-2014 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. | |
Reading makefiles... | |
Updating goal targets.... | |
File 'eval-win10x64-enterprise' does not exist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# big parameters for testcase purposes - normally default to empty hash and lookup from hiera | |
class profiles::myapp( | |
Hash $packages = { | |
"vb" => { | |
description => "the best beer in australia", | |
}, | |
"oldgnarlyhen" => { | |
description => "for hipsters", | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REFS=$(git log Gemfile | grep commit | awk '{print $2}') | |
for REF in $REFS ; do | |
git checkout $REF Gemfile | |
mkdir -p gemfiles/$REF | |
cp Gemfile gemfiles/$REF | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"os" | |
"log" | |
) | |
var stderr = log.New(os.Stderr, "RUHROH-->", 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"os" | |
"log" | |
) | |
type Person struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -AssemblyName System.IO.Compression.FileSystem | |
$zipFile = [System.IO.Compression.ZipFile]::openread("c:\Vagrant\download_and_do\spec\mock\test.zip") | |
foreach ($zipFileEntry in $zipFile.Entries) { | |
$pwd = (Get-Item -Path ".\" -Verbose).FullName | |
$outputFile = [io.path]::combine($pwd, $zipFileEntry.FullName) | |
$dir = ([io.fileinfo]$outputFile).DirectoryName | |
if (-not(Test-Path -type Container -path $dir)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#<# | |
#.Synopsis | |
# Rewrite configuration files based on hiera data | |
#.Description | |
# .. | |
# | |
#.Parameter DataFile | |
# Exported data from hiera (JSON) | |
#.Parameter AppData | |
# File to read configurable settings from |