Skip to content

Instantly share code, notes, and snippets.

View liamdawson's full-sized avatar

Liam Dawson liamdawson

View GitHub Profile
@liamdawson
liamdawson / token.sls
Last active February 7, 2020 19:32
Set a grain from an api call on a minion
#!py
# The following statefile uses Python to set a grain ('sample-token') to
# a value pulled from a HTTP call. The call will not be repeated if the
# grain is already set.
from salt.utils.http import query
import json
def run():
@liamdawson
liamdawson / 2.2.1-typo.patch
Created March 7, 2015 12:05
Fixes a typo in MRI Ruby 2.2.1 when installing via rbenv's ruby-build
--- tool/rbinstall.rb 2015-03-07 21:59:28.834830008 +1000
+++ tool/rbinstall.rb.patch 2015-03-07 21:59:43.202830008 +1000
@@ -711,7 +711,7 @@
install?(:ext, :comm, :gem) do
begin
require "zlib"
- rescue LoadErroe
+ rescue LoadError
end
if defined?(Zlib)