Skip to content

Instantly share code, notes, and snippets.

View jasonkeene's full-sized avatar
:shipit:

Jason Keene jasonkeene

:shipit:
View GitHub Profile
@jasonkeene
jasonkeene / upload-to-om.sh
Last active January 16, 2018 11:35
Download a product from GCS and upload it to OpsMan
#!/bin/bash
set -e
tile=pivotal-container-service-0.7.1-build.6.pivotal
om_username=some-username
om_password=some-password
om_target=https://1.2.3.4
mkdir -p $HOME/tile-dl
cd $HOME/tile-dl
@jasonkeene
jasonkeene / ort_bench_test.go
Created November 25, 2017 16:59
Stable Sort Benchmarks
package main
import (
"math/rand"
"sort"
"testing"
)
func benchSort(size int, b *testing.B) {
b.StopTimer()
@jasonkeene
jasonkeene / leak.go
Created October 1, 2017 01:33
Test program for playing with pprof's heap profiler.
package main
import (
"log"
"math/rand"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"runtime/debug"
@jasonkeene
jasonkeene / diode_heads.dlv
Created May 15, 2017 04:44
Query a metron process for the read/write head delta.
b github.com/cloudfoundry/diodes.(*OneToOne).TryNext
c
p d.readIndex
p d.writeIndex
q
n
@jasonkeene
jasonkeene / trace.go
Created May 14, 2017 16:26
A demo program to experiment with tracing Go programs on linux.
// This program atomically increments two unit64 values and prints them out
// periodically.
//
// The objective is to capture the same data `stat()` is providing by
// instrumenting calls to `read()` and `write()`.
package main
import (
"log"
"sync/atomic"
@jasonkeene
jasonkeene / java-concurrency-in-practice-notes.md
Last active September 25, 2022 23:15
Java Concurrency In Practice

Preface

  • Read on the train, no notes.

Chapter 1 - Introduction

  • Read on the train, no notes. Basic introduction to concurrency concepts.

Chapter 2 - Thread Safety

package main
import (
"net"
"os"
)
const sock = "/tmp/test.sock"
func main() {
type lock struct {
l uint32
}
func (l *lock) Lock() {
for {
if atomic.CompareAndSwapUint32(&l.l, 0, 1) {
return
}
}
@jasonkeene
jasonkeene / bootstrap.md
Last active July 20, 2016 22:32
Bootstrap your involvement in the CO Go community!

Community Discussion

Get an invite to the gopher's slack. It is a great resource for just asking questions or discussing various topics you might be interested in.

For Pivots there is also #gophers and #gopher-den-community slack channels.