Skip to content

Instantly share code, notes, and snippets.

Avatar

John E. Vincent lusis

View GitHub Profile
@lusis
lusis / myorg.proto
Created Feb 13, 2020
example.proto
View myorg.proto
syntax = "proto3"
package = "com.myorg.ptypes";
message User {
int64 id = 1;
UserStatus status = 2;
}
message Group {
int64 id = 1;
@lusis
lusis / README.md
Created Apr 10, 2019
exabgp promethues exporter
View README.md

Current metrics at startup

root@node1:~# curl -s http://localhost:9569/metrics  | grep peer
# HELP peer_route_state shows the current peer state for a given route
# TYPE peer_route_state gauge
peer_route_state{family="ipv4 unicast",peer_asn="64496",peer_ip="192.168.1.2",route="192.168.88.2/32",self_asn="64496",self_ip="192.168.1.184"} 1
# HELP peer_state shows the current peer state
# TYPE peer_state gauge
peer_state{peer_asn="64496",peer_ip="192.168.1.2",self_asn="64496",self_ip="192.168.1.184"} 1
@lusis
lusis / test.py
Created Jan 10, 2018
test scripts for rundeck url script loading
View test.py
print("hello from a python script")
@lusis
lusis / twopass_test.go
Created Jan 9, 2018
two-pass but it's only in testing
View twopass_test.go
func TestSCMPluginForProjectResponseEnableImport(t *testing.T) {
obj := &SCMPluginForProjectResponse{}
// The test response file used here does NOT match the struct
data, dataErr := testdata.GetBytes(ListSCMPluginsResponseExportTestFile)
if dataErr != nil {
t.Fatalf(dataErr.Error())
}
placeholder := make(map[string]interface{})
_ = json.Unmarshal(data, &placeholder)
@lusis
lusis / t_test.go
Created Jan 9, 2018
fml golang json.Unmarshal
View t_test.go
package main
import (
"encoding/json"
"testing"
"github.com/alecthomas/assert"
"github.com/davecgh/go-spew/spew"
)
View simple_permissions.yaml
---
operations:
default: 'read'
paths:
- '[^/debug/pprof/trace.*]': 'none'
debug:
default: 'none'
paths:
- '(^/reload|^/debug/pprof/.*)': 'write'
View artifactory.conf
# place in /etc/yum/pluginconf.d/artifactory.conf
[main]
enabled=1
@lusis
lusis / cache_test.t
Created Nov 3, 2016
Test::Nginx to validate cache behaviour
View cache_test.t
use Test::Nginx::Socket 'no_plan';
no warnings;
no_diff;
#repeat_each(5);
run_tests();
__DATA__
View artifactory.md

Things I like

simple deployment

Initially getting started is very easy. Being a java based application, it ships with a nice embedded db that will meet most small usage scenarios very easily.

backup/recovery

Artifactory makes backups very easy to configure and restores are very straightforward. I've done several migrations from/to AWS and installs and it's worked very well.

dedupe

@lusis
lusis / README.md
Last active Jun 6, 2017
Proxying puppetforge files with Artifactory
View README.md

Proxying puppetforge requests with Artifactory and Nginx

We have two goals:

  • Ensure that we have local deterministic cache of puppet modules pulled from the forge
  • Force all server requests to go through artifactory where possible

Artifactory configuration

We're going to use a remote repo type of generic pointing to forgeapi.puppetlabs.com. The json in this gist should provide the relevant information.

nginx configuration

You can’t perform that action at this time.