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
{ | |
"2.4ghz": { | |
"airtimeFairness": true, | |
"channel": "6", | |
"channelBandwidth": "20MHz", | |
"isMUMIMOEnabled": true, | |
"isRadioEnabled": true, | |
"isWMMEnabled": true, | |
"maxClients": 128, | |
"mode": "auto", |
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
# Create a Powerlevel10k prompt segment that shows that value of $VAULT_ADDR if set. | |
function prompt_my_vault_addr() { | |
if [[ -n $VAULT_ADDR ]]; then | |
p10k segment -i '🔐' -f brightwhite -b blue -t "$VAULT_ADDR" | |
fi | |
} | |
# Add it to the right prompt. | |
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=my_vault_addr |
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 'puppet/indirector/catalog/json' | |
# This is a write-only catalog cache terminus for saving compiled catalogs to disk as JSON. | |
# | |
# It extends the built-in JSON catalog terminus: | |
# * https://github.com/puppetlabs/puppet/blob/6.19.1/lib/puppet/indirector/catalog/json.rb | |
# * https://github.com/puppetlabs/puppet/blob/6.19.1/lib/puppet/indirector/json.rb | |
# | |
class Puppet::Resource::Catalog::WriteOnlyJson < Puppet::Resource::Catalog::Json | |
desc 'A write-only terminus that stores catalogs as flat, serialized JSON files.' |
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 is: ben_weird_sort/functions/sort_hiera_roles.pp | |
# | |
# Returns a list of hiera role paths in sorted order | |
# | |
# Strings are returned in lexical order, unless one path is a substring | |
# of another, in which case the longer string appears first. | |
# | |
# This is so that child roles are checked before parent roles | |
# | |
function ben_weird_sort::sort_hiera_roles($list) { |
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 | |
netblocks=$(dig TXT _spf.google.com +short | grep -E -o "include:_netblocks\d?\.google\.com" | sed 's/include://') | |
{ | |
for net in $netblocks; do | |
dig TXT "$net" +short | |
done | |
} | grep -E -o "ip4:[0-9\./]+" | sed 's/ip4://' | sort -V |
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
--- | |
message: "this is data in common.yaml" |
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
# | |
# get_module_files.rb | |
# | |
module Puppet::Parser::Functions | |
newfunction(:get_module_files, :type => :rvalue, :doc => <<-DOC | |
Returns an array of relative files names for a given module and optional | |
sub directory. Do not include 'files' in the optional relative path as it | |
is assumed. | |
Returns an empty array if no files are found. | |
Errors if the requested module 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
# | |
# All of these examples should return 'bar'. | |
# | |
$string = 'foo@bar' | |
notice($string.split('@')[-1]) | |
notice($string.regsubst(/\A.+@(.+)\Z/, '\1')) | |
with() || { | |
$string =~ /\A.+@(.+)\Z/ |
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
# PuppetDB Query method | |
$query = "package_inventory[package_name,version,provider] {certname = \"${facts['fqdn']}\"}" | |
$pkgs_from_puppetdb = puppetdb_query($query) | |
$bash_version_from_puppetdb = $pkgs_from_puppetdb.filter |$pkg| {$pkg['package_name'] == 'bash'}[0]['version'] | |
notice($bash_version_from_puppetdb) | |
# PE Inventory Fact method | |
$pkgs_from_inventory_fact = $facts['_puppet_inventory_1']['packages'] | |
$bash_version_from_inventory = $pkgs_from_inventory_fact.filter |$pkg| {$pkg[0] == 'bash'}[0][1] |
NewerOlder