Skip to content

Instantly share code, notes, and snippets.

View jeffmccune's full-sized avatar

Jeff McCune jeffmccune

View GitHub Profile
@jeffmccune
jeffmccune / google_netblocks.sh
Last active July 30, 2021 08:28 — forked from n0531m/list_gcp_iprange.sh
Google Cloud Platform : ip address range
#! /bin/bash
#
# Return the subnets used by Google Services
#
# There are a growing number of netblocks, 2,3,4,5,6,7, etc...
# Dig them all until an empty string is returned.
txt="$(dig TXT _netblocks.google.com +short @8.8.8.8)"
idx=2
while [[ -n "${txt}" ]]; do
echo "$txt" | tr '[:space:]+' "\n" | grep : | cut -d: -f2-
#! /bin/bash
## NOTE:
## This script requires the follwing in /etc/hosts:
## 127.0.0.2 puppet master1.example.org
# This will fail with a stock puppet 3.1.1, but will succeed if all of the
# certificate subjects contain only the "CN" portion, and no O, OU, or
# emailAddress.
@jeffmccune
jeffmccune / gist:942021
Created April 26, 2011 09:15 — forked from lak/gist:941981
Using VIM to create html renderings of code
# vim: syntax=ruby
require 'bluecloth'
require 'erb'
outputs = []
FileList['examples/*'].each do |input|
output = File.join("output", File.basename(input)).sub(/\.\w+/, ".html")
outputs << output
# Recursively diff two hashes, showing only the differing values.
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license.
#
# Example:
#
# a = {
# "same" => "same",
# "diff" => "a",
# "only a" => "a",
# "nest" => {