Skip to content

Instantly share code, notes, and snippets.

View dwallraff's full-sized avatar

Dave Wallraff dwallraff

View GitHub Profile
@dwallraff
dwallraff / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@dwallraff
dwallraff / bash_generate_random_string.sh
Last active September 7, 2016 21:03 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@dwallraff
dwallraff / clone_vm.py
Last active March 8, 2016 18:34
Python script for cloning a VM
#!/usr/bin/env python
import atexit
from pyVmomi import vim
from pyVim import connect
from pyVim.connect import Disconnect
INPUTS = {'vcenter_ip': '123.123.123.123',
'vcenter_user': 'Administrator',
'vcenter_password': 'Password123',
@dwallraff
dwallraff / bosh_script.sh
Last active August 29, 2015 14:26
Bash wrapper to upload a run a script to a bosh job
#!/bin/bash
# Script will create a wrapper script with a random password
# upload your script and execute it with sudo.
# Please Note: This script requires a patched version of the BOSH cli.
# At this time, this patch is not publicly available.
# Variables
BOSH_JOB="<job_name>"
#!env python
### Assumes you've added a second network
import yaml
INPUT = yaml.load(open("bosh_prod.yml"))
ZONE_B_RESOURCES = []
IP_ADDRESS_MAP = {}
@dwallraff
dwallraff / OpsMgr export & Alias
Last active August 29, 2015 14:27 — forked from krujos/OpsMgr export & Alias
Export and alias to have bosh command "just work"
export BUNDLE_GEMFILE=/home/tempest-web/tempest/web/bosh.Gemfile
alias bosh='bundle exec bosh'
@dwallraff
dwallraff / ssl_compare.sh
Last active September 29, 2016 13:52
Compare fingerprints of server key and certificate (they should match)
openssl x509 -noout -modulus -in server.crt | openssl md5
openssl rsa -noout -modulus -in server.key | openssl md5
@dwallraff
dwallraff / AWS command to get ARN of SSL cert
Last active May 26, 2016 17:44
AWS command to get ARN of SSL cert
aws iam get-server-certificate --server-certificate-name <cert-name>
@dwallraff
dwallraff / Blockchain verification
Last active May 26, 2016 17:44
Blockchain verification
Verifying that +dwallraff is my blockchain ID. https://onename.com/dwallraff
@dwallraff
dwallraff / ERT_dependencies.sh
Last active July 15, 2017 02:17
Get ERT dependencies
curl -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token <PIVNET Token>" -X GET https://network.pivotal.io/api/v2/products/elastic-runtime/releases/639/dependencies | jq .