Skip to content

Instantly share code, notes, and snippets.

@tboerger
tboerger / inventory.py
Last active May 13, 2020
Dynamic inventory for Ansible on VMWare vCloud director
View inventory.py
#!/usr/bin/env python3
import json
import requests
import os
import argparse
import xml.etree.cElementTree as ET
from time import time
GLOBALS = {
@ddgenome
ddgenome / aws-creds.bash
Last active Nov 16, 2020
Fetch AWS STS keys and set environment variables
View aws-creds.bash
#!/bin/bash
# Fetch 24-hour AWS STS session token and set appropriate environment variables.
# See http://docs.aws.amazon.com/cli/latest/reference/sts/get-session-token.html .
# You must have jq installed and in your PATH https://stedolan.github.io/jq/ .
# Add this function to your .bashrc or save it to a file and source that file from .bashrc .
# https://gist.github.com/ddgenome/f13f15dd01fb88538dd6fac8c7e73f8c
#
# usage: aws-creds MFA_TOKEN [OTHER_AWS_STS_GET-SESSION-TOKEN_OPTIONS...]
function aws-creds () {
local pkg=aws-creds
@davelee212
davelee212 / import-vse-fw-rules.ps1
Last active Sep 29, 2020
import-vse-fw-rules.ps1
View import-vse-fw-rules.ps1
# Run from a PowerCLI shell that has been logged into the vCloud Director instance using “Connect-CIServer -server url”
# and then run the script passing the following parameters:
# -file or -f = The CSV file containing the rules to import
# -edge or -e = The Edge Gateway Name
#
# Example:
# ./import-vse-fw-rules.ps1 -f myfwrules.csv -e “My vShield Edge”
param (
[parameter(Mandatory = $true, HelpMessage="Edge Gateway Name")][alias("-edge","e")][ValidateNotNullOrEmpty()][string[]]$egwname,
You can’t perform that action at this time.