This file contains hidden or 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
# @summary A short summary of the purpose of this class | |
# | |
# A description of what this class does | |
# | |
# @example | |
# include collections::test | |
class collections::test { | |
# Contains tests of the collections constructs |
This file contains hidden or 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
class collections::file_test { | |
# This resource will create File['tmp/collections-file-test'], | |
# setting content => template('collections/file-test.erb'), | |
# with a $data variable merging the stanza below with all of the | |
# following fragments. | |
collections::file { '/tmp/collections-file-test': | |
collector => 'file-test', | |
template => 'collections/file-test.erb', | |
data => { |
This file contains hidden or 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
class collections::test { | |
# Contains tests of the collections constructs | |
# Define an iterator stack | |
collections::create { 'foo': | |
} | |
# Add a thing for the stack to do: | |
# collections::tap is a defined type that will create a notify resource containing its parameters |
This file contains hidden or 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
#!/bin/bash | |
# Zabbix LLD to show mounted filesystems that use true block devices (for use with items such as vfs.dev.read/write) | |
exec 3<"/proc/mounts" | |
echo -n '{"data":[' | |
opts=( FSDEV FSNAME FSTYPE FSOPTS FSDUMPFREQ FSDUMPPASS ) | |
linesep="" while read -u3 -a line; do | |
[[ -b "${line[0]}" ]] || continue echo -n "$linesep" linesep="}," | |
sep='{' | |
i=0 |
This file contains hidden or 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
#!/usr/bin/ruby | |
# THIS FILE IS MANAGED BY PUPPET | |
require 'zbxapi' | |
require 'pp' | |
zbx = ZabbixAPI.new('http://localhost/zabbix/api_jsonrpc.php', verify_ssl: false, http_timeout: 300) | |
zbx.login('<%= @admin_user %>', '<%= @admin_password %>') |
This file contains hidden or 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
#!/bin/bash | |
if (( $(id -u) != 0 )); then | |
echo "This script must be run as root" | |
exit 127 | |
fi | |
opt_exit_status=0 | |
write_diff="overlay.diff" |
This file contains hidden or 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
#!/bin/bash | |
PARAM_OPTS=( ) | |
function get_param_opts { | |
(( ${#PARAM_OPTS[@]} > 0 )) && return | |
PARAM_OPTS=( $( vim -h | sed -n -e '/^ *-[-a-z]* </s/ <.*$//p' ) ) | |
} | |
vim_args="" | |
files=( ) |
This file contains hidden or 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
_virsh_vm_name() | |
{ | |
virsh list --all --name "${@}" | |
} | |
_virsh_vol_name() | |
{ | |
virsh vol-list default | sed '1,2d' | awk '{print $1}' | |
} |
This file contains hidden or 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
class ProbabilityDensity < Array | |
def probability | |
Rational(1,count) | |
end | |
def to_density | |
if block_given? | |
each do |v| | |
if v.respond_to? :probability |
This file contains hidden or 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
require 'securerandom' | |
require 'strscan' | |
require 'pp' | |
module Dice | |
class Parser | |
module Term | |
class Number | |
attr_accessor :number, :value, :math_symbol |
NewerOlder