Skip to content

Instantly share code, notes, and snippets.

View josh-padnick's full-sized avatar

Josh Padnick josh-padnick

View GitHub Profile
@josh-padnick
josh-padnick / example
Last active November 12, 2018 22:29
Terraform here doc syntax example
user_data = <<-EOF
#!/bin/bash
echo "hello world" > index.html
nohup busybox httpd -f -p "8080" &
EOF
@josh-padnick
josh-padnick / confluent-main.tf
Created June 3, 2018 21:09
Terraform Module depends_on, Part Deux
# This file should be at /confluent/main.tf
variable "kafka_cluster_deployment_done" {}
module "confluent_tools" {
source = "../server-group/"
rolling_deployment_done = "${var.kafka_cluster_deployment_done}"
}
josh@pad-mac ~/g/s/g/g/p/t/tf-modules (kafka-status-check)> terraform apply
2018/05/31 13:24:29 [INFO] Terraform version: 0.11.7 41e50bd32a8825a84535e353c3674af8ce799161
2018/05/31 13:24:29 [INFO] Go runtime version: go1.10.1
2018/05/31 13:24:29 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2018/05/31 13:24:29 [DEBUG] Attempting to open CLI config file: /Users/josh/.terraformrc
2018/05/31 13:24:29 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/05/31 13:24:29 [INFO] CLI command args: []string{"apply"}
2018/05/31 13:24:29 [TRACE] module source: "../tf-foo"
2018/05/31 13:24:29 [TRACE] module source: "../tf-bar"
2018/05/31 13:24:29 [INFO] command: empty terraform config, returning nil
@josh-padnick
josh-padnick / gist:4b2dc841475a482ce2d601df461e1c92
Created March 30, 2018 18:46
Yet Another Terraform Failure
kafka-standalone-ubuntu 2018/03/30 11:35:29 Error: Error applying plan:
kafka-standalone-ubuntu 2018/03/30 11:35:29
kafka-standalone-ubuntu 2018/03/30 11:35:29 2 error(s) occurred:
kafka-standalone-ubuntu 2018/03/30 11:35:29
kafka-standalone-ubuntu 2018/03/30 11:35:29 * module.zookeeper.module.zookeeper_servers.aws_launch_configuration.server_group: aws_launch_configuration.server_group: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.
kafka-standalone-ubuntu 2018/03/30 11:35:29
kafka-standalone-ubuntu 2018/03/30 11:35:29 Please include the following information in your report:
kafka-standalone-ubuntu 2018/03/30 11:35:29
kafka-standalone-ubuntu 2018/03/30 11:35:29 Terraform Version: 0.11.5
kafka-standalone-ubuntu 2018/03/30 11:35:29 Resource ID: aws_launch_configuration.server_group
@josh-padnick
josh-padnick / Schema Registry Log Output
Created February 4, 2018 23:38
Schema Registry Log Output
[2018-02-04 23:26:47,636] DEBUG Selector loop woken up from select, 1/3 selected (org.eclipse.jetty.io.SelectorManager:603)
[2018-02-04 23:26:47,637] DEBUG Queued change org.eclipse.jetty.io.SelectorManager$ManagedSelector$Accept@3b32c022 (org.eclipse.jetty.io.SelectorManager:481)
[2018-02-04 23:26:47,637] DEBUG Running change org.eclipse.jetty.io.SelectorManager$ManagedSelector$Accept@3b32c022 (org.eclipse.jetty.io.SelectorManager:526)
[2018-02-04 23:26:47,637] DEBUG onOpen NetworkTrafficSelectChannelEndPoint@3711c20b{/127.0.0.1:53908<->8081,Open,in,out,-,-,0/30000,null}{io=0,kio=0,kro=0} (org.eclipse.jetty.io.AbstractEndPoint:99)
[2018-02-04 23:26:47,637] DEBUG NetworkTrafficSelectChannelEndPoint@3711c20b{/127.0.0.1:53908<->8081,Open,in,out,-,-,0/30000,null}{io=0,kio=0,kro=0} idle timeout check, elapsed: 0 ms, remaining: 30000 ms (org.eclipse.jetty.io.IdleTimeout:151)
[2018-02-04 23:26:47,638] DEBUG new HttpChannelOverHttp@61c8edba{r=0,c=false,a=IDLE,uri=} -> NetworkTrafficSelectChannelEndPoint@3711c20b{/12
@josh-padnick
josh-padnick / script.sh
Last active August 31, 2017 19:33
Compute the number of hours used by a customer for a given date range in Zendesk
#!/bin/bash
# 1. Make sure obtain an API Token
# 2. This has only been validated to work with ZenDesk agents, not end users
# 3. Look up the customer's org ID by querying https://gruntwork.zendesk.com/api/v2/organizations.json
# 4. Look up the ZenDesk custom Field ID that stores the number of hours used by querying a complete ticket and inspecting the JSON output
# 5. This script all automatically sum the total of all numbers in the given month and ignore empty numbers.
zendesk_username="josh@gruntwork.io/token"
zendesk_password="<enter-your-api-token>"
@josh-padnick
josh-padnick / README.md
Last active April 15, 2017 06:25
Healthline Gist

HealthLine Temp AWS Infrastructure Instructions

We setup a limited version of the infrastructure needed by HealthLine in AWS using Terraform.

Environments

This infrastructure has two environments:

  • mgmt: Contains a Bastion Host where you SSH to get access to everything else
  • stage: Contains an ECS Cluster running the gruntwork-sample-app
@josh-padnick
josh-padnick / Details.md
Last active April 10, 2017 15:41
Play Framework Vulnerability 2017.04.07

April 7th 2017

Description

A deserialization vulnerability has been found in the socket appender and socket receiver in Logback, which is used by Play. This affects all versions of Play from 2.0.0 through 2.5.13.

Play includes integration with Logback through SLF4J. Logback has functionality that enables logging events to be sent over a network, using Java Serialization.

Using Logback in Play itself does not result in vulnerability as per the default Play configuration, but if Logback has been specifically configured to use SocketAppender or ServerSocketReceiver, then Play is vulnerable.

@josh-padnick
josh-padnick / workflow.md
Last active April 10, 2017 00:20
Workflow for Tesla

To deploy a change to an app to stage, in the current workflow, you'd do the following:

  1. Accept our previous github invitation for user l85m at https://github.com/gruntwork-io
  2. git clone https://github.com/gruntwork-io/sample-app-tesla && cd sample-app-tesla
  3. docker-compose up
  4. Open http://localhost:3000 to see the app.
  5. Make whatever changes you want and refresh your browser. A good file to change is app/index.html.
  6. git commit -am "some commit message"
  7. git push
  8. Normally, this would kick off a build in Jenkins which would automatically push a new Docker image to ECR and then auto-deploy to stage or prod. But because we haven't configured Jenkins yet, you would manually deploy as follows:
@josh-padnick
josh-padnick / crash.log
Created April 6, 2017 20:39
2017.04.06 -- Terraform Crash
This file has been truncated, but you can view the full file.
2017/04/06 13:34:57 [INFO] Terraform version: 0.9.2 6365269541c8e3150ebe638a5c555e1424071417+CHANGES
2017/04/06 13:34:57 [INFO] Go runtime version: go1.8
2017/04/06 13:34:57 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2017/04/06 13:34:57 [DEBUG] Detected home directory from env var: /Users/josh
2017/04/06 13:34:57 [DEBUG] Detected home directory from env var: /Users/josh
2017/04/06 13:34:57 [DEBUG] Attempting to open CLI config file: /Users/josh/.terraformrc
2017/04/06 13:34:57 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/04/06 13:34:57 [INFO] CLI command args: []string{"apply"}
2017/04/06 13:34:57 [DEBUG] Detected home directory from env var: /Users/josh
2017/04/06 13:34:57 [DEBUG] command: loading backend config file: /Users/josh/go/src/github.com/gruntwork-io/package-mongodb/examples/mongodb-sharded-cluster