Skip to content

Instantly share code, notes, and snippets.

Avatar

Trent Lloyd lathiat

View GitHub Profile
@lathiat
lathiat / juju-run-split.py
Created November 16, 2020 08:47
Split the output from 'juju-run' into multiple files and process the escaped string
View juju-run-split.py
#!/usr/bin/env python3
import os
import re
import pprint
import sys
import yaml
if len(sys.argv) <= 1:
print("Usage: juju-split FILE_NAME")
View ceph_historic_inflight_ops_analyzer.rb
#!/usr/bin/env ruby
require 'pp'
require 'json'
require 'date'
input_fn = ARGV[0]
input_file = open(input_fn)
j = JSON.parse(input_file.read)
ops = {}
@lathiat
lathiat / gist:30ba24de073d45b0979a
Last active August 29, 2015 14:01
OnApp template creator for Ubuntu 14.04 Trusty Tahr
View gist:30ba24de073d45b0979a
## OnApp template creator Makefile for Ubuntu 14.04
## Creates an OnApp compatible template from the Ubuntu cloud base image
## You can run this script continiously to update the image
## You will want to customise the timezone and mirror
##
## Version 0.1 2014-05-07
## Trent Lloyd <trentl@webinabox.net.au>
## (1) Create a new directory, e.g. 'template-builder'
## (2) Download this file and name it Makefile
@lathiat
lathiat / gist:10790374
Created April 15, 2014 23:52
puppet network heira hack
View gist:10790374
---
network_internal:
ipaddress: "%{::ipaddress_eth1}"
ipaddress6: "%{::ipaddress6_eth1}"
network: "%{::network_eth1}"
netmask: "%{::netmask_eth1}"
prefixlen: "%{::prefixlen_eth1}"
netcidr: "%{::netcidr_eth1}"
netcidr6: "%{::netcidr6_eth1}"
ipcidr: "%{::ipcidr_eth1}"
@lathiat
lathiat / gist:10790228
Created April 15, 2014 23:50
puppet interfaces ipaddr prefixlen
View gist:10790228
require 'ipaddr'
require 'puppet/util/ipcidr'
interfaces = Facter.value('interfaces')
# If we do not have any interfaces, then there are no requested attributes
unless interfaces == :undefined
interfaces = interfaces.split(',')
interfaces.each do |iface|