Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jmoberly on github.
  • I am jmoberly (https://keybase.io/jmoberly) on keybase.
  • I have a public key ASCD383Kc1eGnagvgOJFk7hauOh1HJQ6kf13bihHwADsTwo

To claim this, I am signing this object:

@jmoberly
jmoberly / Quick_Prometheus
Created October 31, 2017 20:16
Prometheus monitoring stack quick start
sudo docker run -d -p 3000:3000 \
-v /var/lib/grafana:/var/lib/grafana \
-e "GF_SECURITY_ADMIN_PASSWORD=secret" \
grafana/grafana
sudo docker run \
--net host -m 0b -v /etc/prometheus/alertmanager.yml:/etc/prometheus/alertmanager.yml \
-v /etc/prometheus/haproxy.rules:/etc/prometheus/haproxy.rules \
--name alertmanager \
docker.io/prom/alertmanager:master \
@jmoberly
jmoberly / web_app.conf
Created November 14, 2016 20:18
Basic upstart config to launch app on boot
#Web app upstart script
description "start and stop web app"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn
@jmoberly
jmoberly / reverse_proxy.conf
Last active May 6, 2016 16:14
Simple reverse proxy config for AWS
map $http_x_forwarded_proto $real_scheme {
default $http_x_forwarded_proto;
'' $scheme;
}
server {
listen 80;
listen 443 ssl;
@jmoberly
jmoberly / tf-pre-commit.sh
Last active April 29, 2016 17:23
Terraform git pre-commit hook
#!/bin/bash
#
# Validates terraform templates before commit
set -e
terraform validate stacks/vpc
terraform validate stacks/environment
terraform validate stacks/pod
@jmoberly
jmoberly / cleanup_old_containers.sh
Created March 15, 2016 13:21
Clean up all the exited docker containers.
sudo docker ps -a | grep 'Exited (' | awk '{print $1}' | xargs --no-run-if-empty sudo docker rm
@jmoberly
jmoberly / atom_setup.sh
Last active November 11, 2015 15:37
Script to install Atom packages that I use.
apm install slime
gem install puppet-lint
apm install language-puppet
apm install linter-puppet-lint
go get -u github.com/golang/lint/golint
apm install linter-golinter
go get -v golang.org/x/tools/cmd/goimports
apm install go-imports
@jmoberly
jmoberly / jmeter-test.jmx
Created October 20, 2015 21:11
sample jmx to test jmeter install
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13 r1665067">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Sample Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
@jmoberly
jmoberly / get_trusty_ubuntu.sh
Created July 9, 2015 19:05
Getting ID for latest Ubuntu AMI
ubuimagejson=$(curl 'https://cloud-images.ubuntu.com/releases/streams/v1/com.ubuntu.cloud:released:aws.json')
ubuversion=$(echo $ubuimagejson | jq -S '.products | ."com.ubuntu.cloud:server:14.04:amd64" | .versions | keys | .[length-1]')
echo $ubuimagejson | jq -S ".products | .\"com.ubuntu.cloud:server:14.04:amd64\" | .versions.${ubuversion}.items.usee1hs.id"
@jmoberly
jmoberly / GPG_CheatSheet.md
Created July 24, 2014 21:17
Cheatsheet of GPG commands.

to create a key: gpg --gen-key generally you can select the defaults. to export a public key into file public.key: gpg --export -a "User Name" > public.key This will create a file called public.key with the ascii representation of the public key for User Name. This is a variation on: gpg --export which by itself is basically going to print out a bunch of crap to your screen. I recommend against doing this. gpg --export -a "User Name" prints out the public key for User Name to the command line, which is only semi-useful