Skip to content

Instantly share code, notes, and snippets.

@hemebond
hemebond / output
Created July 21, 2016 09:22
Pillar Interpolation Results
mem01.xen.local:
----------
sample1:
127.0.0.1/24/Contact me at
sample2:
127.0.0.1/24/Contact me at example.com
sample3:
127.0.0.1/24/Contact me at example.com 127.0.0.1
sample4:
${sample5} 24
@hemebond
hemebond / yamlloader.py
Last active March 13, 2016 10:42
Additional method on the SaltYamlSafeLoader class in yamlloader.py to fix YAML merging
class SaltYamlSafeLoader(yaml.SafeLoader, object):
def flatten_mapping(self, node):
merge = []
index = 0
while index < len(node.value):
key_node, value_node = node.value[index]
if key_node.tag == u'tag:yaml.org,2002:merge':
del node.value[index]
if isinstance(value_node, MappingNode):
#! /bin/bash
#
# Original at http://hempeldesigngroup.com/embedded/stories/debian-squeeze-pxe-netboot-for-virtualbox/
#
# -----------------------------------------------------------------------------
# makePxeInstaller.sh - Make a netbootable directory that has all the IDE
# and sata drivers needed for a VirtualBox install
#
# Works in the current directory
# -----------------------------------------------------------------------------
#!/usr/bin/python3
#
# Save Flash videos on Linux when using Mozilla Firefox
#
# When watching Flash videos in Mozilla Firefox using the Adobe Flash player a
# temporary but "deleted" file is created. This file can still be accessed and
# copied somewhere else. This script will find all the temporary video files
# and save them to the current directory.
#
@hemebond
hemebond / check_updates.ps1
Created March 2, 2015 10:27
PowerShell script checks for available updates and returns the result in the standard monitoring plugin output format.
$Session = New-Object -ComObject "Microsoft.Update.Session"
$Searcher = $Session.CreateUpdateSearcher()
$Result = $Searcher.Search("IsInstalled = 0 and IsHidden = 0")
$Updates = $Result.Updates
$Total = $Updates.Count
$Critical = @($Updates | Where-Object {$_.MsrcSeverity -eq 'Important' -or $_.MsrcSeverity -eq 'Critical'}).Count
if ($Critical -gt 0) {
$CheckResult = 'CRITICAL'
@hemebond
hemebond / sync_with_playlist.py
Last active April 15, 2019 21:29
Synchronise a directory with an .M3U playlist
#!/usr/bin/env python3
import os
import subprocess
import shutil
from time import time
import argparse
import codecs
import unicodedata
from tempfile import gettempdir