Skip to content

Instantly share code, notes, and snippets.

View grepory's full-sized avatar
😃

Greg Poirier grepory

😃
  • SolarWinds
  • Atlanta, GA
View GitHub Profile
require 'octokit'
require 'business_time'
BusinessTime::Config.beginning_of_workday = "6:00 am"
BusinessTime::Config.end_of_workday = "6:00 pm"
client = Octokit::Client.new(
:access_token => ENV['GITHUB_API_TOKEN'],
)
package main
import (
"fmt"
"github.com/Knetic/govaluate"
)
type Entity struct {
Environment string
==================
WARNING: DATA RACE
Write at 0x00c420001eb8 by goroutine 24:
net/http.http2ConfigureServer()
/usr/local/go/src/net/http/h2_bundle.go:3938 +0x274
net/http.(*Server).onceSetNextProtoDefaults()
/usr/local/go/src/net/http/server.go:2986 +0x15f
net/http.(*Server).onceSetNextProtoDefaults_Serve()
/usr/local/go/src/net/http/server.go:2969 +0x5e
net/http.(*Server).(net/http.onceSetNextProtoDefaults_Serve)-fm()
type mockStore struct {
mock.Mock
// Entities
getEntityByID func(id string) (*types.Entity, error)
updateEntity func(e *types.Entity) error
deleteEntity func(e *types.Entity) error
getEntities func() ([]*types.Entity, error)
// Checks
getChecks func() ([]*types.Check, error)
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"os"
"sync"
"time"
@grepory
grepory / main.go
Last active March 14, 2017 15:18
Trivial example of repeated startup of embedded etcd
package main
import (
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"runtime/pprof"
@grepory
grepory / main.go
Last active March 6, 2017 20:39
Example of first write succeeding, but second write failing
package main
import (
"fmt"
"net/http"
"time"
"github.com/gorilla/websocket"
)
@grepory
grepory / gist:d2126c332e661f3508525bb9c17471ef
Created March 2, 2017 01:56
Welcome to the year of Linux on the desktop
λ ping google.com
PING google.com (172.217.5.110) 56(84) bytes of data.
64 bytes from sfo03s07-in-f14.1e100.net (172.217.5.110): icmp_seq=1 ttl=53 time=291 ms
64 bytes from sfo03s07-in-f14.1e100.net (172.217.5.110): icmp_seq=5 ttl=53 time=59.3 ms
64 bytes from sfo03s07-in-f14.1e100.net (172.217.5.110): icmp_seq=6 ttl=53 time=500 ms
64 bytes from sfo03s07-in-f14.1e100.net (172.217.5.110): icmp_seq=12 ttl=53 time=5139 ms
64 bytes from sfo03s07-in-f14.1e100.net (172.217.5.110): icmp_seq=15 ttl=53 time=10948 ms
64 bytes from sfo03s07-in-f14.1e100.net (172.217.5.110): icmp_seq=22 ttl=53 time=19375 ms
64 bytes from sfo03s07-in-f14.1e100.net (172.217.5.110): icmp_seq=21 ttl=53 time=20383 ms
64 bytes from sfo03s07-in-f14.1e100.net (172.217.5.110): icmp_seq=23 ttl=53 time=18351 ms
cat tf-test.log
2017/01/31 16:37:17 [INFO] Terraform version: 0.8.5
2017/01/31 16:37:17 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.8.5/bin/terraform", "fmt", "test.tf"}
2017/01/31 16:37:17 [DEBUG] Detected home directory from env var: /Users/grep
2017/01/31 16:37:17 [DEBUG] Detected home directory from env var: /Users/grep
2017/01/31 16:37:17 [DEBUG] Attempting to open CLI config file: /Users/grep/.terraformrc
2017/01/31 16:37:17 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/01/31 16:37:17 [DEBUG] Detected home directory from env var: /Users/grep
2017/01/31 16:37:17 [DEBUG] plugin: waiting for all plugin processes to complete...
2017/01/31 16:38:06 [INFO] Terraform version: 0.8.5
I'll be omitting syscalls with ellipsis.
The first thing that happens after you press enter is that bash resolves
curl to /usr/bin/curl and then forks(). The strace output is from the
forked process.
Fist execve() the /usr/bin/curl binary and pass an array of arguments to it.
execve("/usr/bin/curl", ["curl", "http://github.com"], [/* 8 vars */]) = 0
...