Skip to content

Instantly share code, notes, and snippets.

View slackpad's full-sized avatar

James Phillips slackpad

View GitHub Profile
@slackpad
slackpad / main.go
Created February 24, 2017 21:48
Consul ephemeral key example
package main
import (
"log"
"github.com/hashicorp/consul/api"
)
func main() {
client, err := api.NewClient(api.DefaultConfig())
@slackpad
slackpad / bootstrap.md
Last active September 27, 2020 17:57
Bootstrapping Consul Servers with Version 8 ACLs Enabled (v0.8.1)
@slackpad
slackpad / setrlimit.c
Created November 19, 2017 03:50
Increase fd rlimit for pid 18048
#include <stdlib.h>
#include <sys/resource.h>
int main() {
struct rlimit limit;
limit.rlim_cur = 4096;
limit.rlim_max = 4096;
int ret;
ret = prlimit(18048, RLIMIT_NOFILE, &limit, NULL);
@slackpad
slackpad / stack.txt
Created November 19, 2017 03:55
Full stack dump for hashicorp/consul issue #3700
goroutine profile: total 1272
1131 @ 0x42d6ec 0x42d7de 0x43ed74 0x43e999 0x473b79 0xa287a1 0xf2a44f 0xf2f72d 0xf78b28 0xf72c65 0xf71685 0x684dc4 0x686580 0x687af4 0x683c9d 0x45ce61
# 0x43e998 sync.runtime_Semacquire+0x38 /goroot/src/runtime/sema.go:56
# 0x473b78 sync.(*RWMutex).RLock+0x48 /goroot/src/sync/rwmutex.go:50
# 0xa287a0 github.com/hashicorp/consul/agent/local.(*State).Stats+0x50 /gopath/src/github.com/hashicorp/consul/agent/local/state.go:567
# 0xf2a44e github.com/hashicorp/consul/agent.(*Agent).Stats+0x21e /gopath/src/github.com/hashicorp/consul/agent/agent.go:2049
# 0xf2f72c github.com/hashicorp/consul/agent.(*HTTPServer).AgentSelf+0x3ac /gopath/src/github.com/hashicorp/consul/agent/agent_endpoint.go:75
# 0xf78b27 github.com/hashicorp/consul/agent.(*HTTPServer).AgentSelf-fm+0x47 /gopath/src/github.com/hashicorp/consul/agent/http.go:101
# 0xf72c64 github.com/hashicorp/consul/agent.(*HTTPServer).wrap.func1+0x664 /gopath/src/github.com/hashicorp/consul/agent/http.go:272
# 0xf71684 githu