This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FlattenedMapEntry { | |
String key; | |
String value; | |
} | |
public static List<FlattenedMapEntry> flattenMap(String parent, Map<?, ?> map) { | |
List<FlattenedMapEntry> results = new ArrayList<>(); | |
for (Object o : map.entrySet()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imp | |
import yaml | |
from bottle import Bottle | |
def get_yaml(): | |
with open("template.yml", 'r') as stream: | |
string = '' | |
for line in stream.readlines(): | |
string += line.replace('!', '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
import random | |
from time import sleep | |
def get_cluster_nodes(): | |
nodes = [] | |
resp = requests.get('http://localhost:9200/_nodes').json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import boto3 | |
import json | |
def get_reserved_instances(client): | |
resp = {} | |
ris = client.describe_reserved_instances( | |
Filters=[{'Name': 'state', 'Values': ['active', ]}]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dict_to_item(raw): | |
if type(raw) is dict: | |
resp = {} | |
for k,v in raw.iteritems(): | |
if type(v) is str: | |
resp[k] = { | |
'S': v | |
} | |
elif type(v) is int: | |
resp[k] = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse_dynamo_item(item): | |
resp = {} | |
if type(item) is str: | |
return item | |
for key,struct in item.iteritems(): | |
if type(struct) is str: | |
if key == 'I': | |
return int(struct) | |
else: | |
return struct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# | |
# keepalived LVS cluster monitor daemon. | |
# | |
# Written by Andres Salomon <[email protected]> | |
# | |
### BEGIN INIT INFO | |
# Provides: keepalived | |
# Required-Start: $syslog $network $remote_fs | |
# Required-Stop: $syslog $network $remote_fs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$investments = curl(https://btcjam.com/api/v1/listings?appid=[APP ID]&secret=[APP Secret]) \\ you get the idea | |
foreach($investments as $investment) { | |
if(!$db->query(FIND THIS INVESTMENT IN MY DB)){ | |
curl(https://btcjam.com/api/v1/investments&listing_id=$investment['id']&amount=0.000001); | |
$db->insert(WE HAVE INVESTED!); | |
}else{ | |
continue; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Everything is explained here: | |
// https://github.com/kuzetsa/gekko/blob/master/docs/Configuring_gekko.md | |
var config = {}; | |
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
// GENERAL SETTINGS | |
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
// Gekko stores historical history |