Skip to content

Instantly share code, notes, and snippets.

Cezar Sá Espinola cezarsa

Block or report user

Report or block cezarsa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View terraform output
$ TF_LOG=trace terraform plan
2019/08/19 18:46:11 [INFO] Terraform version: 0.12.6
2019/08/19 18:46:11 [INFO] Go runtime version: go1.12.7
2019/08/19 18:46:11 [INFO] CLI args: []string{"/usr/local/bin/terraform", "plan"}
2019/08/19 18:46:11 [DEBUG] Attempting to open CLI config file: /Users/cezarsa/.terraformrc
2019/08/19 18:46:11 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/08/19 18:46:11 [INFO] CLI command args: []string{"plan"}
2019/08/19 18:46:11 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/08/19 18:46:11 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/08/19 18:46:11 [DEBUG] New state was assigned lineage "f206e877-0e66-9514-49b4-031d2e56c320"
import os
from datetime import datetime, timedelta
import slack
import holidays
SLACK_TOKEN = os.environ.get('SLACK_TOKEN')
SLACK_USER = os.environ.get('SLACK_USER')
from_date = datetime.strptime('2019-01-01', '%Y-%m-%d')
to_date = datetime.strptime('2019-06-18', '%Y-%m-%d')
View gist:1a0a3aefe602bd072974926a0073312e
package main
import (
View gist:a919ddc198d509ea612518c2e05c984f
trap 'echo "Done user data script."' EXIT
echo "Running user data script..."
sleep 30
View a.diff
diff --git a/provision/kubernetes/deploy.go b/provision/kubernetes/deploy.go
index 587eac2e0..f729c2682 100644
--- a/provision/kubernetes/deploy.go
+++ b/provision/kubernetes/deploy.go
@@ -455,8 +455,12 @@ func monitorDeployment(client *clusterClient, dep *v1beta1.Deployment, a provisi
fmt.Fprintf(w, " ---> %d of %d new units created\n", dep.Status.UpdatedReplicas, specReplicas)
if healthcheckTimeout == nil && dep.Status.UpdatedReplicas == specReplicas {
- healthcheckTimeout = time.After(maxWaitTimeDuration)
- fmt.Fprintf(w, " ---> waiting healthcheck on %d created units\n", specReplicas)
View test.go
func (s *S) TestRoundTripSNI(c *check.C) {
var receivedReq *http.Request
ts := httptest.NewTLSServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
receivedReq = req
rw.Header().Set("X-Some-Rsp-Header", "rspvalue")
rw.Write([]byte("my result"))
defer ts.Close()
router := &recoderRouter{dst: ts.URL}
View nodecontainer.diff
diff --git a/provision/swarm/docker.go b/provision/swarm/docker.go
index 8d7b4eb..64b4bcf 100644
--- a/provision/swarm/docker.go
+++ b/provision/swarm/docker.go
@@ -601,7 +601,7 @@ func serviceSpecForNodeContainer(name, pool string) (*swarm.ServiceSpec, error)
return service, nil
-func upsertService(spec *swarm.ServiceSpec, client *docker.Client) (error, bool) {
+func upsertService(spec *swarm.ServiceSpec, client *docker.Client, placementOnly bool) (error, bool) {
View gist:d1ed0a2ae5d96b55094a21f2f302382b
View mgo.go
package main
import (
func withUpsert(c *mgo.Collection) {
_, err := c.Upsert(bson.M{"_id": 1, "x": 2}, bson.M{"$set": bson.M{"x": 3}})
View gist:47b96c951eb41c2688efdbfb12c18d7f
runtime: writebarrierptr *0xc820419698 = 0x20
fatal error: bad pointer in write barrier
runtime stack:
runtime.throw(0xd5c300, 0x1c)
/home/vagrant/.gimme/versions/go1.6.2.linux.amd64/src/runtime/panic.go:547 +0x90
/home/vagrant/.gimme/versions/go1.6.2.linux.amd64/src/runtime/mbarrier.go:140 +0xb3
/home/vagrant/.gimme/versions/go1.6.2.linux.amd64/src/runtime/asm_amd64.s:291 +0x79
You can’t perform that action at this time.