- Add the field to the Config struct (or an appropriate sub-struct) in
agent/config/config.go
. - Add the field to the actual RuntimeConfig struct in
agent/config/runtime.go
. - Add an appropriate parser/setter in
agent/config/builder.go
to translate. - Add the new field with a random value to both the JSON and HCL blobs in
TestFullConfig
inagent/config/runtime_test.go
, it should fail now, then
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"log" | |
"strconv" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Sets up outgoing dummynet in pf firewall suitable for use to throttle outgoing network | |
# connections. gtihub.com/tylertreat/comcast is a much nicer tool but I couldn't get it to work due | |
# to shell issues and more - it seemed to only setup inbound rules in pf which don't affect outbound | |
# TCP connections in my tests. | |
TARGET=$1 | |
PIPECFG=${2:-"plr 1"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run with node fix-auto-focus.js | |
// | |
// This disables the broken auto-focus on Logitech cameras. | |
// It works for me on my Logictech 920. | |
var UVCControl = require('uvc-control'); | |
var camera = new UVCControl(0x046d, 0x082d); | |
camera.get('autoFocus', function (error, value) { | |
console.log('Before AutoFocus setting:', value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ecdh implements a simple way to perform Diffie-Hellman Key Exchange using | |
// Curve25519 on the command line. | |
// | |
// NOTE: this is a toy for fun. Don't use it. | |
// | |
// See https://godoc.org/golang.org/x/crypto/curve25519 and | |
// https://cr.yp.to/ecdh.html for more info. | |
// | |
// The final shared secret given is the raw shared secret bytes from DH and is | |
// not typically suitable for direct use as an encryption key as it can leak |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goroutine 643475 [running]: | |
runtime/pprof.writeGoroutineStacks(0x3628a40, 0xd01a7ad7a0, 0x0, 0x0) | |
/usr/local/go/src/runtime/pprof/pprof.go:679 +0x9d | |
runtime/pprof.writeGoroutine(0x3628a40, 0xd01a7ad7a0, 0x2, 0x0, 0x0) | |
/usr/local/go/src/runtime/pprof/pprof.go:668 +0x44 | |
runtime/pprof.(*Profile).WriteTo(0x566ef00, 0x3628a40, 0xd01a7ad7a0, 0x2, 0xd01a7ad7a0, 0x7f8ec613a460) | |
/usr/local/go/src/runtime/pprof/pprof.go:329 +0x390 | |
net/http/pprof.handler.ServeHTTP(0xcf94a9c4f1, 0x9, 0x36771a0, 0xd01a7ad7a0, 0xc6c6572b00) | |
/usr/local/go/src/net/http/pprof/pprof.go:245 +0x356 | |
net/http/pprof.Index(0x36771a0, 0xd01a7ad7a0, 0xc6c6572b00) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Attaching to envoy_consul_1 | |
consul_1 | ==> Starting Consul agent... | |
consul_1 | ==> Consul agent running! | |
consul_1 | Version: 'v1.4.4-285-g19361f073-dev (19361f073+CHANGES)' | |
consul_1 | Node ID: '6d9e3780-cd4a-4520-c4a7-e59a58cb69a5' | |
consul_1 | Node name: 'a21b7272d6b9' | |
consul_1 | Datacenter: 'dc1' (Segment: '<all>') | |
consul_1 | Server: true (Bootstrap: false) | |
consul_1 | Client Addr: [0.0.0.0] (HTTP: 8500, HTTPS: -1, gRPC: 8502, DNS: 8600) | |
consul_1 | Cluster Addr: 127.0.0.1 (LAN: 8301, WAN: 8302) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"github.com/hashicorp/go-msgpack/codec" | |
) | |
var h codec.MsgpackHandle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UVCControl = require('uvc-control'); | |
var camera = new UVCControl(0x046d, 0x082d); | |
camera.get('autoFocus', function (error, value) { | |
console.log('Before AutoFocus setting:', value); | |
}); | |
camera.set('autoFocus', 0, function (error) { | |
if (error != undefined) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package state | |
import ( | |
"fmt" | |
"testing" | |
"github.com/hashicorp/go-memdb" | |
"github.com/hashicorp/consul/agent/structs" | |
"github.com/hashicorp/consul/api" |
NewerOlder