This file contains hidden or 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
deploy_cookbook () | |
{ | |
EXPECTED_ARGS=2; | |
BAD_ARGS_ERROR_CODE=65; | |
if [ $# -ne $EXPECTED_ARGS ]; then | |
echo 'Usage: deploy_cookbook ${ENV} ${COOKBOOK}'; | |
return $BAD_ARGS_ERROR_CODE; | |
fi; | |
environment=$1; | |
cookbook=$2; |
This file contains hidden or 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
This isn't even close. Catelyn Stark. | |
Did she make a single good decision during her lifespan? She chased away Jon Snow when another strong male would have been a huge asset. She went to pieces when Bran fell, and left the family in the hands of an inexperienced teenager. She convinced Ned to trust Littlefinger, which got him killed. She captured Tyrion, which started a war and made Sansa into a hostage. She didn't convince her teenaged son that marrying his new girlfriend was a horrible idea, which got all of them killed. She betrayed her own son. | |
This is a woman who claimed to care about her family more than anything, but managed to get almost the entire clan killed in under three years. | |
Cersei isn't a rocket scientist, and Viserys was an idiot, but he got himself killed before he could do much damage to anyone else. Joffrey wasn't stupid, he was batshit insane. |
This file contains hidden or 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
# Describe Launch Config formatting | |
<BlockDeviceMappings> | |
<member> | |
<DeviceName>/dev/xvdp</DeviceName> | |
<Ebs> | |
<SnapshotId>snap-1234abcd</SnapshotId> | |
<Iops>1000</Iops> | |
<DeleteOnTermination>true</DeleteOnTermination> | |
<VolumeType>io1</VolumeType> | |
<VolumeSize>100</VolumeSize> |
This file contains hidden or 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_block_device_mappings(user_input): | |
""" | |
Parse block device mappings per AWS CLI tools syntax (modified to add IOPS) | |
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html | |
Syntax: | |
/dev/xvd[a-z]=[snapshot-id|ephemeral]:[size in GB]:[Delete on Term]:[IOPS] | |
- Leave inapplicable fields blank | |
- Delete on Termination defaults to True |
This file contains hidden or 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 copy | |
import datetime | |
import itertools | |
import logging | |
import os | |
import re | |
import socket | |
import subprocess | |
import threading | |
import urllib2 |
This file contains hidden or 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
curl 'http://localhost:9200/_all/fluentd/_search?size=1&pretty=true' -XPOST -d '{ | |
"query": { | |
"query_string": { | |
"fields": ["uri"] | |
"query": "entagara-" | |
} | |
} | |
}' |
This file contains hidden or 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
// This works: | |
discount = 50.0 | |
if (!doc["discount"].empty) { | |
discount = doc["discount"].value; | |
} else { | |
discount = 50.0; | |
} | |
// This works: | |
discount = doc["discount"].empty ? 50.0 : doc["discount"].value; |
This file contains hidden or 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
for (Reservation reservation : descInstances.getReservations()) { | |
for (Instance instance : reservation.getInstances()) { |
This file contains hidden or 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 has_nested_key?(key, hash) | |
hash = hash.to_hash | |
if has_indeterminate_key?(key, hash) | |
return true | |
end | |
hash.values.each do |v| | |
if v.is_a?(Hash) && has_nested_key?(key, v) | |
return true | |
end |
This file contains hidden or 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
publish: | |
@if [ -e "$$HOME/.pypirc" ]; then \ | |
echo "Uploading to Pypi"; \ | |
python setup.py register ; \ | |
python setup.py sdist upload ; \ |