Skip to content

Instantly share code, notes, and snippets.

View d-baranowski's full-sized avatar
🎯
Focusing

Dan d-baranowski

🎯
Focusing
View GitHub Profile
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
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;
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)
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)
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;
#!/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
#!/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
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
@d-baranowski
d-baranowski / ASG Terraform definition
Created November 27, 2019 10:40
cluster autoscaler taint tags logs
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 = [