Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -euo pipefail
page=1
repo_list=()
while true ; do
output=$(hub api -XGET -F type=all -F page=$page -F per_page=100 /user/repos | jq -r '.[].full_name')
if [[ -n $output ]]; then
readarray -t chunk <<<"$output"
#!/usr/bin/env bash
set -euo pipefail
main() {
parse_cmdline "$@"
}
# parse the command line
parse_cmdline() {
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
17:31 $ git diff-files
17:32 $ git diff
17:32 $ git diff-files
17:32 $ touch seed/main.tf
@robinbowes
robinbowes / input.json
Created January 11, 2019 20:21
Given input.json, I'd like to extract all the variable names and any default values
{
"variable": {
"cloud": {
"description": "The cloud for this service"
},
"cluster": {
"default": "default",
"description": "The cluster name to use for this service"
},
"cost_center": {
for repo in ${list_of_repos[*]} ; do
if [[ -d $repo ]]; then
(
cd "$repo"
git checkout master
git pull
)
else
git clone "git@github.com:org/$repo.git"
fi
[terragrunt] 2018/06/29 22:45:27 Running command: terraform state show terraform_remote_state.vpc
id = 2018-06-29 20:38:21.841932892 +0000 UTC
backend = s3
cidr_block = 172.18.0.0/16
config.% = 3
config.bucket = acme-terraform-state-global
config.key = aws/aws/us-east-1/vpc/terraform.tfstate
config.region = us-east-1
environment = default
name = acme.com
{
"version": 3,
"terraform_version": "0.11.7",
"serial": 14,
"lineage": "87dbf850-b517-fce3-1f34-d270ee9153d7",
"modules": [
{
"path": [
"root"
],
@robinbowes
robinbowes / modules|services|netbox|main.tf
Created June 29, 2018 21:15
Example code for vpc.id problem
module "security_groups" {
source = "./modules/security_groups"
db_port = "${var.db_port}"
identifier = "${local.identifier}"
vpc_id = "${var.vpc_id}"
}
@robinbowes
robinbowes / consul.yaml
Created May 4, 2018 17:05
datadog consul check config
instances:
- url: http://localhost:8500
new_leader_checks: true
catalog_checks: true
service_whitelist: []
# Nothing to configure here
init_config:
import click
import mps.aws
import mps.config
from mps.exceptions import NoCredentialsException
# create module-specific logger
logger = logging.getLogger(__name__)