Skip to content

Instantly share code, notes, and snippets.

View kpettijohn's full-sized avatar

Kevin Pettijohn kpettijohn

  • Figure Markets
  • Portland, Oregon
  • 23:35 (UTC -07:00)
View GitHub Profile
@kpettijohn
kpettijohn / keybase.md
Last active April 2, 2020 14:39
Keybase

Keybase proof

I hereby claim:

  • I am kpettijohn on github.
  • I am kp_ https://keybase.io/kp_ on keybase.
  • I have a public key ASDrnQR36gY_YR1HnEw-ckvaiI1g7dO3PZWt3KNS87EV5Ao

To claim this, I am signing this object:

@kpettijohn
kpettijohn / main.go
Created July 17, 2019 21:01
Add a Github label to all issues in a repository based on an existing label
package main
import (
"context"
"fmt"
"github.com/google/go-github/v27/github"
flag "github.com/spf13/pflag"
"golang.org/x/oauth2"
"log"
"net/url"
@kpettijohn
kpettijohn / alert.json
Last active January 28, 2019 17:13
Testing alerts with Alertmanager
[
{
"labels": {
"alertname": "ServiceHighRequestLatency",
"region": "useast2",
"job": "blackbox",
"protocol": "https",
"service": "www",
"instance": "https://www.example.com"
},
@kpettijohn
kpettijohn / prometheus_notes.md
Created December 5, 2018 17:36
Prometheus Notes
@kpettijohn
kpettijohn / getPluginsJson.groovy
Created April 26, 2018 17:13
Jenkins list all plugins with version number
import groovy.json.JsonBuilder
import groovy.json.JsonOutput
def json = new JsonBuilder().plugins {}
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
for (p in plugins){
j = new JsonBuilder().plugin {
"${p.getShortName()}" "${p.getVersion()}"
}
@kpettijohn
kpettijohn / tf_diff.sh
Created November 22, 2017 21:13
Terraform IAM Policy diff tool
#!/bin/bash
cat $1.txt| \
sed -E 's/\\n//g'| \
awk -F "=>" '{print $1}'| \
rev| \
cut -c 1-| \
rev| \
sed 's/[[:blank:]]//g'| \
sed -E 's/\\//g'|sed 's/^"//'| \
@kpettijohn
kpettijohn / install.sh
Last active February 25, 2017 19:31
Vagrant + libvirt setup (Fedora 23)
#!/bin/bash
USER=kp
VAGRANT_VERSION='1.9.1'
plugins="vagrant-libvirt vagrant-mutate vagrant-rekey-ssh"
sudo dnf install -y \
libxslt-devel \
libxml2-devel \
ruby-devel \
@kpettijohn
kpettijohn / bootstrap.sh
Created October 30, 2016 22:09
Consul agent, Prometheus node exporter, and Jenkins on CentOS 7.2
#!/bin/bash
# Install
# - Consul agent
# - Prometheus node_exporter
# - Jenkins
curl -O -L -s https://github.com/prometheus/node_exporter/releases/download/v0.13.0-rc.1/node_exporter-0.13.0-rc.1.linux-amd64.tar.gz
curl -O -L -s https://releases.hashicorp.com/consul/0.7.0/consul_0.7.0_linux_amd64.zip
unzip consul_0.7.0_linux_amd64.zip
@kpettijohn
kpettijohn / gist:672a93e1df9e5f721604
Last active March 3, 2018 06:03
i3 notes for the Thinkpad X1 Carbon 3rd gen

Fn + F[1-12] keysym name

F1 XF86AudioMute
F2 XF86AudioLowerVolume
F3 XF86AudioRaiseVolume
F4 XF86AudioMicMute
F5 XF86MonBrightnessDown
F6 XF86MonBrightnessUp
F7 XF86Display
F8 XF86WLAN
@kpettijohn
kpettijohn / ghprb_auth.groovy
Last active June 23, 2019 04:38
Configure GitHub Pull Request Builder Jenkins plugin with Groovy
// ghprb 1.29.2
import java.lang.reflect.Field
import jenkins.model.*
import org.jenkinsci.plugins.ghprb.*
def descriptor = Jenkins.instance.getDescriptorByType(org.jenkinsci.plugins.ghprb.GhprbTrigger.DescriptorImpl.class)
Field auth = descriptor.class.getDeclaredField("githubAuth")
auth.setAccessible(true)