Skip to content

Instantly share code, notes, and snippets.

if __name__ == '__main__':
unittest.main()
#!/bin/bash
export ACCOUNT_ID=$(PASSWORD_STORE_DIR=$HOME/.paas-pass pass compose/account_id)
export ACCESS_TOKEN=$(PASSWORD_STORE_DIR=$HOME/.paas-pass pass compose/dev/access_token)
export USERNAME=betademo
export PASSWORD=nottobes
export LOG_LEVEL=debug
# run tests
go test -v $(go list ./... | grep -v '/vendor/')
# run app locally
package main
import (
"fmt"
"os"
"github.com/cloudfoundry-community/go-cfclient"
)
func main() {
package main
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
)
func main() {
## Autoscaling groups
I started looking at autoscaling in the `provisioning/aws/dmz.tf` file, as this
was the simplest.
Changing the aws_instance terraform config to a launch config was relatively
straightforward. Some of the config params are different, but they are very
similar. The biggest change is tags must be specified individually. Dean had
already done this for the sensu load balancer. However, you cannot specify tags
for az and name in the same way as ec2 instances
@timmow
timmow / notes.md
Created May 13, 2016 10:30
Notes from pivotal cf 101 meetup
  • Pivotal web services is run with 4 ops engineers
  • PCF has an ops manager and apps manager, web interfaces for the cli commands
  • There is an autoscaler for PCF in the marketplace
  • There is a project called RackHD for treating bare metal like cloud infra, and a cpi for this
  • People were asking how you do service discovery of microservices - I thought this was something our tenants might ask, had some ideas myself but not 100% sure of the answers
@timmow
timmow / gist:c955f5fbc9d08ef8848c
Created March 17, 2016 16:08
Create aws users password / key and encrypt
#!/bin/bash
set -euo pipefail
function create_user {
USERNAME=$1
RECIPIENT=$2
aws iam create-user --user-name $USERNAME
ACCESS_KEY_JSON=$(aws iam create-access-key --user-name $USERNAME)
ACCESS_KEY_ID=$(echo $ACCESS_KEY_JSON | jq -r '.[] | .AccessKeyId')

Destroy

Hijack the cf-deployment container:

fly -t remote hijack -j "deploy-cloudfoundry/deploy-cf" sh

Now login to the microbosh instance

First, checkout a new branch of cf-terraform from vanilla_cf_prototype

git checkout vanilla_cf_prototype # from master
git checkout -b vanilla_cf_prototype_split

Then run the following -

@timmow
timmow / after
Created March 3, 2015 11:35
Dashboard queries before and after
[03-Mar-15 11:29:58] DEBUG [django.db.backends:79] (0.004)
SELECT c.relname
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r', 'v', '')
AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
AND pg_catalog.pg_table_is_visible(c.oid); args=None
[03-Mar-15 11:29:58] DEBUG [django.db.backends:79] (0.002) SELECT "django_content_type"."id", "django_content_type"."name", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."model" = 'logentry' AND "django_content_type"."app_label" = 'admin' ); args=('logentry', u'admin')
[03-Mar-15 11:29:58] DEBUG [django.db.backends:79] (0.001) SELECT "auth_permission"."content_type_id", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "django_content_type" ON ( "auth_permission"."content_type_id" = "django_content_type"."id" ) WHERE "auth_permission"."content_type