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 ( | |
"bufio" | |
"fmt" | |
"os" | |
"time" | |
"github.com/openai/api-client-go/openai" | |
) |
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
// Testing this stand alone first. Ideally, this would go into our module (where dynamic contenct generation makes sense for us) | |
// This matches up with what I see in the docs, and here https://www.hashicorp.com/blog/hashicorp-terraform-0-12-preview-for-and-for-each | |
// However, I get the following errors on attributes that should exist for these content blocks | |
/* | |
Error: Unsupported attribute | |
on test.tf line 59, in resource "aws_dynamodb_table" "dynamodb_table": | |
59: projection_type = global_secondary_index.projection_type |
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
-----BEGIN PGP MESSAGE----- | |
Version: Keybase OpenPGP v2.0.77 | |
Comment: https://keybase.io/crypto | |
wcBMA9X0O2Qy6nfzAQgAiU9deK3voaiZa061Zm5hV8Yf67rpY8Ge3x3F896lkhdf | |
omsPM+RKn2em9WGhi2+3Umx2sSexeiar3cu8MyKsrO+VZS2e8TE11omYmuM5zF1c | |
AglNKxQ+i57x+tT3i2Qp01mvub3CrKLx/ac/SBsQHATOI+8vpcOmQdWKUdv6r1U9 | |
qanjMnqs4xWIG0ysxbzDU6mkGRCAMTJO/aWAHYzWze+nLzOnSgbJVArzoUdSnvQ5 | |
grIUltxoc2l8VMSpxiAEm+64+ANbgY7UX9DhHsNf8I1OQVe60BccPZYQetyBSkCZ | |
NULlh+E5tXA5hE0zFmsQl6vuAdWzP6CVAIyQzpg6cdL/AABeHAHy3hy9JppKL84+ |
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 __future__ import print_function | |
from pyspark import SparkContext | |
import sys | |
if __name__ == "__main__": | |
if len(sys.argv) != 3: | |
print("Usage: wordcount ", file=sys.stderr) | |
exit(-1) | |
sc = SparkContext(appName="WordCount") | |
text_file = sc.textFile(sys.argv[1]) | |
counts = text_file.flatMap(lambda line: line.split(" ")).map(lambda word: (word, 1)).reduceByKey(lambda a, b: a + b) |
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
ipurcbasefc for tbe Sltbrars of | |
be TUniverait? of {Toronto | |
out of tbe proceeds of tbe fun& | |
bequeatbefc bp | |
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 fibonacci(max): | |
x, y = 0, 1 | |
while x < max: | |
yield x | |
x, y = y, x + y | |
fib_list = [n for n in fibonacci(1000)] | |
print("here is the fib_list: {}".format(fib_list)) |
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
curl 127.0.0.1:9292/tfsoa/add_tf_state -H "Content-Type: application/json" -X \ | |
POST -d '{"role_arn": "arn:aws:iam::357170183134:role/s3read","s3_bucket_name": "terraform-autozane-remote-state","s3_bucket_key": "autozane_kafka_awslogs_cloudwatch/promotion/Terraform"}' | |
curl 127.0.0.1:9292/tfsoa/add_tf_state -H "Content-Type: application/json" -X \ | |
POST -d '{"role_arn": "arn:aws:iam::357170183134:role/s3read","s3_bucket_name": "terraform-autozane-remote-state","s3_bucket_key": "autozane_aptly_awslogs_cloudwatch/promotion/Terraform"}' | |
curl 127.0.0.1:9292/tfsoa/add_tf_state -H "Content-Type: application/json" -X \ | |
POST -d '{"role_arn": "arn:aws:iam::357170183134:role/s3read","s3_bucket_name": "terraform-autozane-remote-state","s3_bucket_key": "golang-app-dev/promotion/Terraform"}' | |
curl 127.0.0.1:9292/tfsoa/add_tf_state -H "Content-Type: application/json" -X \ |
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
execute 'apt-get update' | |
package ['unzip'] | |
git '/var/lib/jenkins/tfenv' do | |
repository 'https://github.com/kamatama41/tfenv.git' | |
revision 'master' | |
action :sync | |
user 'jenkins' | |
group 'jenkins' |
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_launch_configuration" "lc" { | |
lifecycle { create_before_destroy = true } | |
image_id = "${var.ami_version}" | |
instance_type = "${var.instance_type}" | |
iam_instance_profile = "${var.service_name}-${var.environment}" | |
key_name = "${var.key_name}" | |
security_groups = ["${aws_security_group.sg1.id}"] | |
user_data = "user-data.sh" |
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/bash | |
# First arg should be the systemd service to watch | |
# Requires cloud-utils apt package and pip awscli | |
# Requires IAM access to IAM action autoscaling:SetInstanceHealth | |
EC2_INSTANCE_ID=$(ec2metadata --instance-id) | |
PROCESS_CHECK=$1 | |
REGION=$2 | |
while : |
NewerOlder