Skip to content

Instantly share code, notes, and snippets.

View UtahDave's full-sized avatar

David Boucha UtahDave

View GitHub Profile
"""pyvbox: setup appliance description and import_machines.
"""
import virtualbox
vbox = virtualbox.VirtualBox()
# Create new IAppliance and read the exported machine
# called 'ubuntu'.
appliance = vbox.create_appliance()
appliance.read("~/Documents/ubuntu.ova")
#!/bin/sh
# A self-extracting installer for RPMs
#
# To create: make a gzip-compressed tarball of RPMs (with no subdirectory),
# convert to base64, then concatenate onto the end of this file::
#
# cd /some/directory/of/rpm/files
# tar -cz *.rpm | base64 -w0 >> selfinstaller.bzx
main() {
@UtahDave
UtahDave / i3.conf
Last active August 29, 2015 14:12 — forked from diyan/i3.conf
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@UtahDave
UtahDave / icinga.py
Last active January 11, 2020 22:54 — forked from d--j/icinga.py
'''
Manages Icinga Passive Check delivery
'''
import logging
import logging.handlers
import os
import signal
LOG_LEVELS = (logging.WARNING, logging.INFO, logging.DEBUG)
base:
'*':
- base
- service-common
- order: 1
{% for root in opts['pillar_roots']['base'] -%}
{% set service_group_sls = '{0}/{1}.sls'.format(root, grains['service_group']) -%}
{% if salt['file.file_exists'](service_group_sls) %}
'service_group:{{ grains["service_group"] }}':
- match: grain
<contents of normal file>
# Add any additional locations to look for master runners
runner_dirs: [/srv/runners]
# Register a reactor whenever a cloud provider emits 'created'
# the * is the name of the VM, we want any, but you could
# do something like salt/cloud/Webservers-*/created if you only
# wanted your webservers
reactor:
@UtahDave
UtahDave / example.md
Last active August 29, 2015 14:06 — forked from ryan-lane/example.md

modules/modules/testme.py:

from salt.exceptions import CommandExecutionError

def testme(name):
    if name == 'fail':
        raise CommandExecutionError('test error message')
    else:
        return True
{
"rootDir": "{{ salt['pillar.get']('aptly:rootdir') }}",
"downloadConcurrency": 4,
"architectures": [],
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "mwrock/Windows2012R2"
config.vm.box_url = "https://vagrantcloud.com/mwrock/Windows2012R2/version/1/provider/hyperv.box"
# Change "." to a local folder you want to sync
config.vm.synced_folder ".", "/chocolateypackages", disabled: true
base:
# For each directory that can have pillar files
{% for root in opts['pillar_roots']['base'] -%}
# Set a variable to the path to check
{% set mygrain_sls = '{0}/{1}.sls'.format(root, grains['mygrain']) -%}
# Check to see if the file exists, if so, include that pillar file.
{% if salt['file.file_exists'](mygrain_sls) %}
'service_group:{{ grains["mygrain"] }}':
- match: grain
- {{ grains['mygrain'] }}