Skip to content

Instantly share code, notes, and snippets.

@jbayer
jbayer / gist:8967588
Created February 13, 2014 00:46
cf-release example for openstack compatible with v154
---
<%
director_uuid = 'your-director-guid-here'
deployment_name = 'cf'
protocol = 'http'
cf_release = '154'
ip_address = 'some.director.ip.address'
common_password = 'somepassword'
root_domain = 'some.important.domain.com'
%>
@jbayer
jbayer / gist:9435262
Created March 8, 2014 17:16
example of scaling to a 4GB app on run.pivotal.io
$ cf apps
Getting apps in org jbayer-normal-org / space development as jbayer+normal@gopivotal.com...
OK
name requested state instances memory disk urls
hello-java-james stopped 0/1 512M 1G hello-java-james.cfapps.io
$ cf scale hello-java-james -m 4G
This will cause the app to restage. Are you sure you want to scale hello-java-james? y
@jbayer
jbayer / gist:10520248
Created April 12, 2014 05:31
boosh error
$ go version
go version go1.2.1 darwin/amd64
jamesbayer:workspace jamesbayer$ git clone https://github.com/vito/boosh.git
Cloning into 'boosh'...
remote: Reusing existing pack: 426, done.
remote: Total 426 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (426/426), 567.70 KiB | 582 KiB/s, done.
Resolving deltas: 100% (73/73), done.
jamesbayer:workspace jamesbayer$ cd boosh
jamesbayer:boosh jamesbayer$ go get github.com/kr/godep
jamesbayer:boosh jamesbayer$ go get -u ./...
package _/Users/jamesbayer/workspace/boosh: unrecognized import path "_/Users/jamesbayer/workspace/boosh"
package _/Users/jamesbayer/workspace/boosh/builder: unrecognized import path "_/Users/jamesbayer/workspace/boosh/builder"
@jbayer
jbayer / gist:11387928
Last active August 29, 2015 14:00
example of updated heroku compile output with env-var dir passed to compile script
$ heroku config:set BUILDPACK_URL=https://github.com/jbayer/null-buildpack.git
Setting config vars and restarting secure-dawn-7547... done, v4
BUILDPACK_URL: https://github.com/jbayer/null-buildpack.git
$ heroku config:set FOO=BAR
Setting config vars and restarting secure-dawn-7547... done, v5
FOO: BAR
$ mate README.txt
jamesbayer:env-heroku jamesbayer$ git add .
jamesbayer:env-heroku jamesbayer$ git commit -am 'initial commit'
[master (root-commit) ae9249d] initial commit
@jbayer
jbayer / gist:11388173
Created April 29, 2014 00:51
cloudfoundry example env vars in buildpack staging from compile script
-----> Downloaded app package (4.0K)
Cloning into '/tmp/buildpacks/null-buildpack'...
-----> build dir
env1: /tmp/staged/app
env2: /tmp/cache
env3:
-----> current env
USER=vcap
VCAP_APPLICATION={"limits":{"mem":256,"disk":1024,"fds":16384},"application_version":"65655208-793b-4585-ae61-2678b3e67965","application_name":"env-heroku","application_uris":["env-heroku.tabasco-app.cf-app.com"],"version":"65655208-793b-4585-ae61-2678b3e67965","name":"env-heroku","space_name":"development","space_id":"34abe92a-fc08-431a-a6ca-b673c021972e","uris":["env-heroku.tabasco-app.cf-app.com"],"users":null}
STAGING_TIMEOUT=900.0
@jbayer
jbayer / gist:3f6d31f06dcb26f7c325
Created April 30, 2014 06:22
Bash function demonstrating how to export the content of the buildpack compile script ENV_DIR into the environment from heroku docs
export_env_dir() {
env_dir=$1
whitelist_regex=${2:-''}
blacklist_regex=${3:-'^(PATH|GIT_DIR|CPATH|CPPATH|LD_PRELOAD|LIBRARY_PATH)$'}
if [ -d "$env_dir" ]; then
for e in $(ls $env_dir); do
echo "$e" | grep -E "$whitelist_regex" | grep -qvE "$blacklist_regex" &&
export "$e=$(cat $env_dir/$e)"
:
done
@jbayer
jbayer / docker-aws.yml
Created April 30, 2014 15:43
example of docker bosh release deployment manifest
<% deployment_name = 'docker' %>
<% os = 'ubuntu' %>
<% tld = 'microbosh' %>
<% director_uuid = 'GET_FROM_BOSH_STATUS' %>
---
name: <%= deployment_name %>
director_uuid: <%= director_uuid %>
releases:
- name: docker
@jbayer
jbayer / gist:de8eaec0c5ae7d96e041
Created May 1, 2014 17:39
example output from pushing the container-info buildpack
$ mkdir killroy
$ cd killroy/
$ ls
$ touch killroywashere
$ cf p killroywashere -b https://github.com/cloudfoundry-community/container-info-buildpack.git -m 256M
Creating app killroywashere in org jbayer-org / space development as jbayer@gopivotal.com...
OK
Creating route killroywashere.tabasco-app.cf-app.com...
OK
@jbayer
jbayer / cf-logs-recent-output.txt
Created May 29, 2014 19:36
example of a tmate app on on cloud foundry hosted on pivotal web services
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/http_compat.h
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/http_struct.h
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/keyvalq_struct.h
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/listener.h
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/rpc.h
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/rpc_compat.h
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/rpc_struct.h
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/tag.h
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/tag_compat.h
2014-05-29T10:33:34.76-0700 [App/0] OUT include/event2/thread.h