Skip to content

Instantly share code, notes, and snippets.

View blaketmiller's full-sized avatar

Blake Miller blaketmiller

View GitHub Profile
### Keybase proof
I hereby claim:
* I am blaketmiller on github.
* I am blakemiller (https://keybase.io/blakemiller) on keybase.
* I have a public key ASAxbcjludSqRlAcs0hVuO1q28DjhUD1yoEPSJdgxq0EpAo
To claim this, I am signing this object:
[INFO ] Running state [extra packages] at time 16:16:32.377088
[INFO ] Executing state pkg.installed for extra packages
[INFO ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-(none)\n'] in directory '/root'
[INFO ] Executing command ['yum', '--quiet', 'clean', 'expire-cache'] in directory '/root'
[DEBUG ] output:
[INFO ] Executing command ['yum', '--quiet', 'check-update'] in directory '/root'
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'host.example.net', 'tcp://10.11.12.13:4506', 'aes')
[DEBUG ] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'host.example.net', 'tcp://10.11.12.13:4506')
[DEBUG ] Requesting URL https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm using GET method
[ERROR ] An error was encountered while installing package(s): Error: HTTP 599: Timeout reading https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
extra packages:
pkg.installed:
- sources:
- epel-release: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
#!/usr/bin/env python
# Sample YAML file that smoke.py expects:
#
# example.com:
# - alice
# - bob/marley
# - charlie
# example.org:
# - david
# custom PS1 prompt
RED='\[\e[0;31m\]'
LIGHTRED='\[\e[1;31m\]'
GREEN='\[\e[0;32m\]'
LIGHTGREEN='\[\e[1;32m\]'
BLUE='\[\e[0;34m\]'
LIGHTBLUE='\[\e[1;34m\]'
YELLOW='\[\e[1;33m\]'
PURPLE='\[\e[0;35m\]'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlueColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
LjQ5MDE5NjA3ODQgMC41NjQ3MDU4ODI0IDAuNjQzMTM3MjU0OQAQAYAC0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp
@blaketmiller
blaketmiller / install-salt.sh
Created May 24, 2016 04:41
Install SaltStack
PY_VER=2.7.11
# make some directories
mkdir -p $HOME/usr $HOME/src $HOME/srv/salt $HOME/etc/salt/minion.d $HOME/etc/salt/master.d
# download requirements
curl https://www.python.org/ftp/python/$PY_VER/Python-$PY_VER.tgz -o $HOME/src/Python-$PY_VER.tgz
curl https://bootstrap.pypa.io/get-pip.py -o $HOME/src/get-pip.py
# extract tarball
@blaketmiller
blaketmiller / yaml2dir.py
Last active May 27, 2019 12:31
represent YAML as a directory
#!/usr/bin/env python
import os
import sys
import yaml
def dict_to_dir(data, path=str()):
"""dict_to_dir expects data to be a dictionary with one top-level key."""
@blaketmiller
blaketmiller / dir2yaml.py
Created March 11, 2015 04:50
represent a directory tree in YAML
#!/usr/bin/env python
import os
import sys
import yaml
def dir_to_dict(path):
directory = {}
@blaketmiller
blaketmiller / set_osx_admin.py
Last active December 22, 2015 19:29
This is a quick script that will create a local admin user on an Apple OS X client. Why is this useful? If you are establishing a managed Mac client system (e.g. salt, puppet, munki, absolute, god forbid SCCM) for the first time and have no existing tools and need to begin enrolling clients, this is a great one-off script that will save you 5 mi…
#!/usr/bin/python
import datetime
import os
import subprocess
import re
import random
import logging
fullname = "John Appleseed"