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 bash | |
DEFAULT_FILESYSTEM='ext4' | |
for DEVICE in $(lsblk -lnd -o NAME | grep -v nvme0); do | |
VOLUME_ID=$(ebsnvme-id /dev/$DEVICE -v | cut -d' ' -f3) | |
MOUNT_POINT=$(aws ec2 describe-volumes --volume-id $VOLUME_ID | jq -r '.Volumes | .[].Tags | .[] | select(.Key == "MountPoint") | .Value') | |
echo "Device: ${DEVICE} - ${MOUNT_POINT}" | |
# Wait for attachment | |
aws ec2 wait volume-in-use --volume-ids $VOLUME_ID --filters Name=attachment.status,Values=attached | |
if [[ $(file -s /dev/$DEVICE | cut -d':' -f2) == " data" ]]; then | |
echo "Creating ext4 filesystem on /dev/$DEVICE." |
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
# From https://gist.github.com/li0nel/6cae382947e2d1f13ad594a1ef04f7cf | |
#!/usr/bin/env bash | |
#!/usr/bin/env bash | |
aws route53 wait resource-record-sets-changed --id \ | |
$(aws route53 change-resource-record-sets --hosted-zone-id \ | |
"$(aws route53 list-hosted-zones-by-name --dns-name $2. \ | |
--query HostedZones[0].Id --output text)" \ | |
--query ChangeInfo.Id \ | |
--output text \ | |
--change-batch "{ \ |
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
print("Hello World") | |
go_print("Hello from Go inside Lua") | |
print(test_str) |
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 python2.7 | |
# Copyright (C) 2017 Amazon.com, Inc. or its affiliates. | |
# All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"). | |
# You may not use this file except in compliance with the License. | |
# A copy of the License is located at | |
# | |
# http://aws.amazon.com/apache2.0/ |
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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "Recipes", | |
"type": "array", | |
"items": { | |
"title": "Recipe", | |
"type": "object", | |
"properties": { | |
"name": { | |
"type":"string" |
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
{ | |
"name":"casserole (herb)", | |
"recipeid":"1367", | |
"known":true, | |
"skill":"hot food cooking", | |
"trigger":"heat", | |
"cookers":[ | |
{"id":"oven"}, | |
{"id":"campfire","difficulty":5}, | |
{"id":"forge","difficulty":10} |
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
package sort | |
func mergeSort(arr []int) (c []int) { | |
sz := len(arr) | |
if sz <= 1 { | |
return arr | |
} | |
s := int(sz / 2) | |
a, b := arr[:s], arr[s:] | |
la, lb := len(a), len(b) |