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
du -sk * | sort -rn | awk '{print $2}' | xargs -ia du -hs "a" |
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
# | |
# exists.rb | |
# | |
# James Fellows 8/8/12: cloned from git://gist.github.com/1160472.git then | |
# modified to resolve puppet:/// paths | |
# | |
# Copyright 2011 Puppet Labs Inc. | |
# Copyright 2011 Krzysztof Wilczynski | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); |
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
require "net/http" | |
require "net/https" | |
require "uri" | |
require "json" | |
require "socket" | |
require "puppet" | |
module Puppet::Parser::Functions | |
newfunction(:fetch_resource_types, :type => :rvalue) do |args| |
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
require "net/http" | |
require "net/https" | |
require "uri" | |
require "json" | |
require "socket" | |
require "puppet" | |
module Puppet::Parser::Functions | |
newfunction(:fetch_environments, :type => :rvalue) do |args| |
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
require 'irb/completion' | |
require 'puppet' | |
Puppet.settings.preferred_run_mode = :agent # or whatever section you need | |
Puppet.settings.initialize_global_settings(["--config=/the/config/file"]) | |
Puppet.settings.initialize_app_defaults( | |
Puppet::Settings.app_defaults_for_run_mode(Puppet.run_mode) | |
) | |
Puppet.push_context(Puppet.base_context(Puppet.settings)) |
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
## This class requires env_utils, node_manager and stdlib | |
# Array of PE Environment Groups excluding the default 'Agent-specified environment' group | |
$pe_environment_groups = delete(node_groups().filter |$key, $val| { $val["environment_trumps"] == true }.map |$key, $val| { $val["name"] }, 'Agent-specified environment') | |
# Obtain PuppetServer environments and munge to look like PE Classifier environment Groups | |
$puppet_environments = regsubst(capitalize(environments()), '$', ' environment', 'G') | |
# Array of PE Environment Groups that should be removed based | |
# the PuppetServer environment no longer exists |
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
$managed_groups = hiera_array(managed_groups) | |
notice ( $managed_groups ) | |
$managed_groups.each | $group | { | |
$g = hiera_hash(accounts::groups).filter | $key, $val | { $key == $group } | |
create_resources('group', $g) | |
} | |
$managed_users = hiera_array(managed_users) |
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
" Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" ================ General Config ==================== | |
set number "Line numbers are good | |
set backspace=indent,eol,start "Allow backspace in insert mode | |
set history=1000 "Store lots of :cmdline history |
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
#!/usr/bin/env bash | |
# Find available IP addresses from by using dig -x axfr | |
usage() { | |
cat <<-EOF | |
usage: ${0} <network> | |
example: ${0} 10.1.10 | |
EOF | |
} |
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
# Reference Commands | |
cmd_list='usermod groupmod find chgrp getent id awk tr wc' | |
# Function to check if referenced command exists | |
cmd_exists() { | |
if [ $# -eq 0 ]; then | |
echo 'WARNING: No command argument was passed to verify exists' | |
fi | |
cmd=${1} |
OlderNewer