Skip to content

Instantly share code, notes, and snippets.

@97-109-107
97-109-107 / json-split.py
Created November 18, 2014 11:41
A tiny python thing to split big json files into smaller junks.
#!/usr/bin/env python
# based on http://stackoverflow.com/questions/7052947/split-95mb-json-array-into-smaller-chunks
# usage: python json-split filename.json
# produces multiple filename_0.json of 1.49 MB size
import json
import sys
with open(sys.argv[1],'r') as infile:
o = json.load(infile)
@ipmb
ipmb / schedule.sls
Created December 17, 2013 18:05
Sample schedule pillar for Salmon
{% set minutes = 5 %}
{% set returner = "salmon_return" %}
schedule:
# all servers no args
{% for func in ['ps.physical_memory_usage', 'ps.virtual_memory_usage', 'ps.disk_io_counters', 'ps.network_io_counters'] %}
stat{{ loop.revindex }}:
function: {{ func }}
minutes: {{ minutes }}
returner: {{ returner }}