Skip to content

Instantly share code, notes, and snippets.

See: https://github.com/cloudfoundry/gorouter/pull/92
@markstgodard
markstgodard / instances.rb
Created December 10, 2015 18:55
dora secure cookie
class Instances < Sinatra::Base
get '/id' do
ID
end
post '/session' do
response.set_cookie('JSESSIONID', { value: ID, secure: true} )
"Please read the README.md for help on how to use sticky sessions."
end
end
@markstgodard
markstgodard / main.go
Created December 22, 2015 22:15
golang absolute request test
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
@markstgodard
markstgodard / example-context-paths.md
Last active January 13, 2016 16:45
CF example with context paths

Assume we have two apps (microservices) that comprise our "store" app

  • orders and
  • products

Orders app

cd ../orders
cf push orders
select count(*) from delayed_jobs where failed_at is null and attempts > 0 and last_error is not null
update delayed_jobs set priority = (case when priority = 0 then 1 else priority * 2 end) where failed_at is null and attempts > 0 and last_error is not null
shas=( 5fb89e4 ac3516a 962dc48 f97f07c 55d71d9 8f63d53 f079b7a a7bae13 0db2b0e )
for i in "${shas[@]}"
do
echo "Checking out sha $i"
git co $i
echo "Restoring godeps.."
godep restore ./...
echo "Building.."
go build
diff --git a/main.go b/main.go
index 2a7795b..cff7880 100644
--- a/main.go
+++ b/main.go
@@ -3,6 +3,7 @@ package main
import (
"crypto/tls"
"errors"
+ "log"
@markstgodard
markstgodard / routing-etcd.yml
Last active June 7, 2016 20:02
standalone bosh-lite etcd
director_uuid: REPLACE_WITH_BOSH_DIRECTOR_GUID_DUH
name: etcd
jobs:
- name: etcd_z1
instances: 3
networks:
- name: etcd1
static_ips: