Skip to content

Instantly share code, notes, and snippets.

View consolewitch's full-sized avatar

Steppin' Razor consolewitch

View GitHub Profile
@consolewitch
consolewitch / get_eth_device_from_adapter_number.sh
Last active April 3, 2018 17:26
get_eth_device_from_adapter_number.sh
#! /bin/bash
###
# Written by Alex N. Speaks
# Takes the position in which a NIC appears in the vmware console as an argument.
# Returns the ethernet device name that corresponds to that position number.
# Position numbers start at 0
# You can think of this as the old-style ethX number
NIC_INDEX=$1
@consolewitch
consolewitch / untangle_s3.py
Created June 20, 2017 19:16
untangle files that have been accidentally overwritten in a versioning-enabled s3 bucket
# this code will untangle files that have been accidentally overwritten in a versioning-enabled s3 bucket
# contact [email protected] for assistance
import boto.s3.connection, sys
from collections import defaultdict
accessKey="XXXXXXXX/XXXXXX.XXXX"
secretKey="XXXXXXX/XXXXXXXXXXX.XXXXXXXXX.XXXXXXXXXX"
srcKeyPrefix="path/to/key" #no leading or trailing slash
srcBucket="destination-bucket-name-here"
@consolewitch
consolewitch / bake_ami.yml
Created June 1, 2017 01:36
A skeleton for provisioning windows instances and then baking them into new AMIs through a firewall in AWS
---
# This is a stripped version of some code I wrote to bake windows AMIs with ansible through a bastion.
# It works but may need some coaxing if you are going to use it. It was a work-in-progress when we
# realized that we didn't need to do this for unrelated reasons. YMMV ~Alex
- name: "Start base image"
hosts: localhost
gather_facts: False
connection: local
vars:
@consolewitch
consolewitch / disableRoaming.command
Last active January 15, 2016 08:14
OSX GUI executable script to fix CVE-2016-0777 vulnerability
#!/bin/bash
echo ==========================================================================
echo This will disable openSSH roaming for your user
echo ==========================================================================
echo
ssh -v -T -o StrictHostKeyChecking=no [email protected] 2>&1 | grep Roaming
if [ $? == '0' ]
then
cat <<EOM >>~/.ssh/config
#
@consolewitch
consolewitch / gist:43f75c24d6a3a35d797e
Created January 11, 2016 06:05
onename verification
Verifying that +terminal is my blockchain ID. https://onename.com/terminal