This file contains hidden or 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 | |
| name="a-terrible-thing-$RANDOM" | |
| url='http://localhost:9093/api/v1/alerts' | |
| echo "firing up alert $name" | |
| curl -XPOST $url -d @- <<EOF | |
| [{ | |
| "labels": { |
This file contains hidden or 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
| [2018-08-13 14:46:48+0000] fatal error: sync: Unlock of unlocked RWMutex | |
| [2018-08-13 14:46:48+0000] | |
| [2018-08-13 14:46:48+0000] goroutine 68250842 [running]: | |
| [2018-08-13 14:46:48+0000] runtime.throw(0xa72d45, 0x20) | |
| [2018-08-13 14:46:48+0000] /var/vcap/data/packages/golang-1.9-linux/88a7626f51143d021545ce3f6ac2a6ed44766aed/src/runtime/panic.go:605 +0x95 fp=0xc4221274b8 sp=0xc422127498 pc=0x42d615 | |
| [2018-08-13 14:46:48+0000] sync.throw(0xa72d45, 0x20) | |
| [2018-08-13 14:46:48+0000] /var/vcap/data/packages/golang-1.9-linux/88a7626f51143d021545ce3f6ac2a6ed44766aed/src/runtime/panic.go:594 +0x35 fp=0xc4221274d8 sp=0xc4221274b8 pc=0x42d575 | |
| [2018-08-13 14:46:48+0000] sync.(*RWMutex).Unlock(0xc420d9d590) | |
| [2018-08-13 14:46:48+0000] /var/vcap/data/packages/golang-1.9-linux/88a7626f51143d021545ce3f6ac2a6ed44766aed/src/sync/rwmutex.go:125 +0xa1 fp=0xc422127508 sp=0xc4221274d8 pc=0x475131 | |
| [2018-08-13 14:46:48+0000] code.cloudfoundry.org/gorouter/route.(*RoundRobin).Next(0xc42034f260, 0xc420d9d590) |
This file contains hidden or 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
| export GOPATH=/root/go | |
| export GOROOT=/usr/local/go/ | |
| export PATH=$GOPATH/bin:$GOROOT/bin:$PATH | |
| cd /root | |
| cat > test.go # Copy file above | |
| # Remount /tmp rw | |
| mount -o remount,exec /tmp |
This file contains hidden or 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 ruby | |
| # | |
| # This scripts gets a bosh job spec, a bosh manifest, and prints the properties that are declared in the spec and defined in the manifest. | |
| # | |
| # Usage: | |
| # spec_job_properties.rb ~/workspace/uaa-release/jobs/uaa/spec cf-manifest.yml | |
| # | |
| require 'yaml' | |
| class PropertyTree |
This file contains hidden or 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 ruby | |
| # Crunch requires a special date format, the balance and a filtered description. | |
| # | |
| # ./tide2crunch.rb < tide.csv > crunch.csv | |
| # | |
| # There is a thread requesting the balance in the CSV here[1] | |
| # https://www.tide.co/community/t/balance-on-csv/1732/7 | |
| require "csv" | |
| # Extract the hash of entries |
This file contains hidden or 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 python:3-alpine | |
| ENV TERRAFORM_VERSION=0.9.8 | |
| RUN apk add --no-cache --update ca-certificates openssl curl && \ | |
| wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \ | |
| unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/bin/ && \ | |
| rm -f terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \ | |
| pip install awscli |
This file contains hidden or 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
| // | |
| // Small echo server for testing purposes. Simply prints the request. | |
| // Usage: | |
| // - To create certs: | |
| // openssl req -subj '/CN=company.com/O=SomeCompany./C=DB' \ | |
| // -new -newkey rsa:2049 -days 365 -nodes -x509 \ | |
| // -keyout server.key -out server.crt | |
| // - To start: | |
| // HTTP_PORTS=8080,8081 HTTPS_PORTS=8443,12345 \ | |
| // HTTPS_SERVER_CERT_CRT_FILE=$(pwd)/server.crt \ |
This file contains hidden or 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
| 2017/05/19 17:36:44 [INFO] Terraform version: 0.9.5 a59ee0b30e1350d18e44a3a2a405124302751f93 | |
| 2017/05/19 17:36:44 [INFO] Go runtime version: go1.8 | |
| 2017/05/19 17:36:44 [INFO] CLI args: []string{"/home/keymon/local/terraform-0.9.5/terraform", "apply", "-var-file", "spurious.json"} | |
| 2017/05/19 17:36:44 [DEBUG] Detected home directory from env var: /home/keymon | |
| 2017/05/19 17:36:44 [DEBUG] Detected home directory from env var: /home/keymon | |
| 2017/05/19 17:36:44 [DEBUG] Attempting to open CLI config file: /home/keymon/.terraformrc | |
| 2017/05/19 17:36:44 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
| 2017/05/19 17:36:44 [DEBUG] Detected home directory from env var: /home/keymon | |
| 2017/05/19 17:36:44 [INFO] CLI command args: []string{"apply", "-var-file", "spurious.json"} | |
| 2017/05/19 17:36:44 [DEBUG] command: loading backend config file: /home/keymon/workspace/tf_json_bug |
This file contains hidden or 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/sh | |
| ORIG_MSG_FILE="$1" | |
| TICKETNO="$(git rev-parse --abbrev-ref HEAD | sed 's/.*\(PLAT-[0-9]*\).*/\1/')" | |
| if [ -n "${TICKETNO}" ]; then | |
| grep -q "${TICKETNO}" "${ORIG_MSG_FILE}" && exit | |
| TEMP="$(mktemp /tmp/git-XXXXX)" | |
| (cat "$ORIG_MSG_FILE"; echo; echo "$TICKETNO";) > "$TEMP" | |
| cat "$TEMP" > "$ORIG_MSG_FILE" | |
| rm "${TEMP}" |
This file contains hidden or 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
| # Deletes a cloudformation stack | |
| clean_up_cloudformation() { | |
| component_name="$1" | |
| aws cloudformation delete-stack \ | |
| --region eu-west-1 \ | |
| --stack-name "${component_name}" | |
| } | |
| # Checks if the given cloudformation stack is deleted | |
| check_cloudformation(){ | |
| component_name="$1" |