View Copy dynamodb table schema
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
aws dynamodb describe-table --table-name chess_lobby | jq '.Table' | jq 'del(.TableArn)' | jq 'del(.TableSizeBytes)' | jq 'del(.TableStatus)' | jq 'del(.TableId)' | jq 'del(.ItemCount)' | jq 'del(.CreationDateTime)' | jq 'del(.GlobalSecondaryIndexes[].IndexSizeBytes)' | jq 'del(.ProvisionedThroughput.NumberOfDecreasesToday)' | jq 'del(.GlobalSecondaryIndexes[].IndexStatus)' | jq 'del(.GlobalSecondaryIndexes[].IndexArn)' | jq 'del(.GlobalSecondaryIndexes[].ItemCount)' | jq 'del(.GlobalSecondaryIndexes[].ProvisionedThroughput.NumberOfDecreasesToday)' > chess_lobby.json | |
aws dynamodb create-table --cli-input-json file://chess_lobby.json --endpoint-url http://localhost:8000 |
View Get all jdbi sql queries from code
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 com.sportinglife.application; | |
import org.apache.commons.lang3.reflect.MethodUtils; | |
import org.skife.jdbi.v2.sqlobject.SqlQuery; | |
import org.skife.jdbi.v2.sqlobject.SqlUpdate; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.lang.reflect.Method; | |
import java.util.ArrayList; |
View GoLang Binary Tree walk
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 main | |
import ( | |
"fmt" | |
"golang.org/x/tour/tree" | |
) | |
func main() { | |
fmt.Println("Tour of Go Solution - Equivalent Binary Trees\n") | |
t1 := tree.New(5) |
View GoLang Binary Tree walk
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 main | |
import ( | |
"fmt" | |
"golang.org/x/tour/tree" | |
) | |
func main() { | |
fmt.Println("Tour of Go Solution - Equivalent Binary Trees\n") | |
t1 := tree.New(5) |
View put items in dynamo
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
aws dynamodb scan --table-name PredictorPoc > sample.json | |
cat sample.json | jq -cr ".Items" > sample2.json | |
./split-array.sh sample2.json | |
for i in $(ls -t /tmp/item.*); do bash -c "aws dynamodb put-item --table-name PredictorDanPlayground --item file://$i"; done; |
View jq split array into files
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 | |
jq -cr 'keys[] as $k | "\($k)\n\(.[$k])"' $1 | while read -r key; do | |
tmpfile=$(mktemp /tmp/item.XXXXXX) | |
read -r item | |
printf '%s' "$item" > "$tmpfile" | |
done |
View jq split array into files
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 | |
jq -cr 'keys[] as $k | "\($k)\n\(.[$k])"' $1 | while read -r key; do | |
tmpfile=$(mktemp /tmp/item.XXXXXX) | |
read -r item | |
printf '%s' "$item" > "$tmpfile" | |
done |
View Copy dynamodb table to local
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
aws dynamodb describe-table --table-name chess_lobby | jq '.Table' | jq 'del(.TableArn)' | jq 'del(.TableSizeBytes)' | jq 'del(.TableStatus)' | jq 'del(.TableId)' | jq 'del(.ItemCount)' | jq 'del(.CreationDateTime)' | jq 'del(.GlobalSecondaryIndexes[].IndexSizeBytes)' | jq 'del(.ProvisionedThroughput.NumberOfDecreasesToday)' | jq 'del(.GlobalSecondaryIndexes[].IndexStatus)' | jq 'del(.GlobalSecondaryIndexes[].IndexArn)' | jq 'del(.GlobalSecondaryIndexes[].ItemCount)' | jq 'del(.GlobalSecondaryIndexes[].ProvisionedThroughput.NumberOfDecreasesToday)' > chess_lobby.json | |
aws dynamodb create-table --cli-input-json file://chess_lobby.json --endpoint-url http://localhost:8000 |
View ASG Terraform definition
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
resource "aws_autoscaling_group" "node_monitoring_asg_az1" { | |
launch_configuration = aws_launch_configuration.node_monitoring_node.id | |
max_size = var.monitoring_node_max_count | |
min_size = var.monitoring_node_min_count | |
name = "${var.product}-${var.environment}-asg-monitoring-az1-${var.app}" | |
vpc_zone_identifier = [element(var.cluster_subnet_ids, 0)] | |
enabled_metrics = [ |