Skip to content

Instantly share code, notes, and snippets.

View david-martin's full-sized avatar

David Martin david-martin

View GitHub Profile
@david-martin
david-martin / grafana_2017_12_12.txt
Last active December 12, 2017 11:49
Metrics sample responses
# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 3.3101e-05
go_gc_duration_seconds{quantile="0.25"} 5.1319e-05
go_gc_duration_seconds{quantile="0.5"} 8.5327e-05
go_gc_duration_seconds{quantile="0.75"} 0.000127416
go_gc_duration_seconds{quantile="1"} 0.00034064
go_gc_duration_seconds_sum 0.001493969
go_gc_duration_seconds_count 14
# HELP go_goroutines Number of goroutines that currently exist.
@david-martin
david-martin / dashboard.json
Created December 8, 2017 12:05
grafana dashboard for prometheus
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@david-martin
david-martin / make.log
Created December 7, 2017 09:46
make DOCKERORG=davidmartin
[dmartin@rollins-tp prometheus-apb]$ make DOCKERORG=davidmartin
docker run --rm --privileged -v /home/dmartin/work/prometheus-apb:/mnt:z -v /home/dmartin/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u 1000 docker.io/ansibleplaybookbundle/apb-base:latest prepare
Unable to find image 'ansibleplaybookbundle/apb-base:latest' locally
latest: Pulling from ansibleplaybookbundle/apb-base
74f0853ba93b: Already exists
c5c78713ec7b: Pull complete
6d24f0f7338e: Pull complete
d9d11bda6a0e: Pull complete
Digest: sha256:302794ef86bd945e4af26385f49b695b450bac05417da34ec654d0b17691318d
Status: Downloaded newer image for ansibleplaybookbundle/apb-base:latest
@david-martin
david-martin / .bash_aliases
Created October 24, 2017 12:01
Unmount all volumes that have a mount path that contains the current directory
mcpclean_umount() {
for i in $(df -a | grep $PWD | awk 'NF>1{print $NF}'); do
sudo umount $i;
done
}
@david-martin
david-martin / configure_3scale_service.sh
Last active October 12, 2017 21:46
Usage: `./3scale_integration.sh <3scale_token> <3scale_url> <service_id> <apicast_url> <service_url> <service_name> <api_key_value>` Example Usage: `./3scale_integration.sh abcd1234 https://mydomain-admin.3scale.net 12345678 https://apicast.example.com:443 https://my.backend.service.example.com:443 "My Awesome Service" secret_key_value`
#!/bin/sh
THREESCALE_ACCESS_TOKEN=$1
THREESCALE_DOMAIN=$2
THREESCALE_SERVICE_ID=$3
APICAST_URL=$4
SERVICE_URL=$5
SERVICE_NAME=$6
APP_KEY=$7
diff --git a/ui/public/views/mobileapp.html b/ui/public/views/mobileapp.html
index 63bb2dc..e847686 100644
--- a/ui/public/views/mobileapp.html
+++ b/ui/public/views/mobileapp.html
@@ -21,7 +21,7 @@
<div class="row">
<div class="col-md-12">
<uib-tabset active=activeTab>
- <uib-tab index=0 active="selectedTab.sdk" ng-if="app">
+ <uib-tab index=0 active="selectedTab.sdk">
@david-martin
david-martin / gen.sh
Created October 2, 2017 12:10
generate p12
#!/bin/sh
KEYNAME=a4
openssl genrsa -out $KEYNAME.key 2048
openssl req -new -key $KEYNAME.key -out $KEYNAME.csr
openssl x509 -req -days 3650 -in $KEYNAME.csr -signkey $KEYNAME.key -out $KEYNAME.crt
@david-martin
david-martin / build.yml
Last active October 4, 2017 15:14
ansible-playbook -i inventory sample-build-playbook.yml --tags=deploy -e "skip_tls=true" -e "jenkins_route_protocol=http" -e "project_name=localmcp" -e "android_slave_image=docker.io/feedhenry/digger-node6-android-slave-image" --flush-cache
apiVersion: v1
kind: Build
metadata:
annotations:
openshift.io/build-config.name: test-job
openshift.io/build.number: '2'
openshift.io/jenkins-blueocean-log-url: >-
http://jenkins-localmcp.192.168.37.1.nip.io/blue/organizations/jenkins/localmcp-test-job/detail/localmcp%2Ftest-job/2/
openshift.io/jenkins-build-uri: 'http://jenkins-localmcp.192.168.37.1.nip.io/job/localmcp-test-job/2/'
openshift.io/jenkins-console-log-url: >-
@david-martin
david-martin / err.stack
Created July 12, 2017 14:34
fhdb local stack
[TypeError: Cannot read property 'split' of undefined] 'TypeError: Cannot read property \'split\' of undefined
at exports.parseMongoConnectionURL (/home/dmartin/work/testing-cloud-app/node_modules/fh-mbaas-api/node_modules/fh-db/lib/utils.js:23:38)
at getDitchHandle (/home/dmartin/work/testing-cloud-app/node_modules/fh-mbaas-api/node_modules/fh-db/lib/localdb.js:30:22)
at Object.local_db (/home/dmartin/work/testing-cloud-app/node_modules/fh-mbaas-api/node_modules/fh-db/lib/localdb.js:64:3)
at processMongoAction (/home/dmartin/work/testing-cloud-app/node_modules/fh-mbaas-api/lib/db.js:125:19)
at /home/dmartin/work/testing-cloud-app/node_modules/fh-mbaas-api/node_modules/async/dist/async.js:359:16
at nextTask (/home/dmartin/work/testing-cloud-app/node_modules/fh-mbaas-api/node_modules/async/dist/async.js:5057:29)
at /home/dmartin/work/testing-cloud-app/node_modules/fh-mbaas-api/node_modules/async/dist/async.js:5064:13
at apply (/home/dmartin/wo
@david-martin
david-martin / jmeter.log
Created July 12, 2017 11:25
jmeter ping log output
2017-07-12 11:24:14,357 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-07-12 11:24:14,358 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-07-12 11:24:14,359 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-07-12 11:24:14,446 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2017-07-12 11:24:14,446 INFO o.a.j.e.StandardJMeterEngine: Starting 10 threads for group Thread Group.
2017-07-12 11:24:14,446 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-07-12 11:24:14,446 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=10 ramp-up=1 perThread=100.0 delayedStart=false
2017-07-12 11:24:14,448 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2017-07-12 11:24:14,449 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
2017-07-12 11:24:14,449 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1