Skip to content

Instantly share code, notes, and snippets.

View kshep's full-sized avatar

Ken Sheppardson kshep

View GitHub Profile
{"_index":".kibana","_type":"visualization","_id":"API-Response-by-Access-Token-(429)","_score":1,"_source":{"title":"API Response by Access Token (429)","visState":"{\"title\":\"API Response by Access Token (429)\",\"type\":\"histogram\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"scale\":\"linear\",\"mode\":\"stacked\",\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false,\"yAxis\":{}},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}},{\"id\":\"3\",\"type\":\"significant_terms\",\"schema\":\"group\",\"params\":{\"field\":\"access_token.raw\",\"size\":5}}],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"a
{"_index":".kibana","_type":"visualization","_id":"API-Response-by-Access-Token-(429)","_score":1,"_source":{"title":"API Response by Access Token (429)","visState":"{\"title\":\"API Response by Access Token (429)\",\"type\":\"histogram\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"scale\":\"linear\",\"mode\":\"stacked\",\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false,\"yAxis\":{}},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}},{\"id\":\"3\",\"type\":\"significant_terms\",\"schema\":\"group\",\"params\":{\"field\":\"access_token.raw\",\"size\":5}}],\"listeners\":{}}","uiStateJSON":"{}","description":"","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"a
### Keybase proof
I hereby claim:
* I am kshep on github.
* I am kshep (https://keybase.io/kshep) on keybase.
* I have a public key whose fingerprint is 3D2C 1AB3 FF91 CC8F 3499 F060 59C9 F9A1 0DDE 798E
To claim this, I am signing this object:
@kshep
kshep / pull_gcp_billing_data.py
Last active May 25, 2018 19:15
Python example to retrieve GCP billing data (v1 schema)
#!/usr/bin/env python
# 1. pip install google-cloud-bigquery
# 2. set up your default credentials
# 3. profit
import uuid
from google.cloud import bigquery
client = bigquery.Client()
@kshep
kshep / gist:9516430cfc02ce8766be
Last active November 9, 2015 19:56
Sensu Redis Transport Setup
1) Add /etc/sensu/conf.d/transport.json on both your server and all client:
{
"transport": {
"name": "redis"
}
}
2) Restart server and client.
@kshep
kshep / gist:3503798
Last active October 3, 2023 15:48
Show the last commit to each branch in a repo, sorted by date
% cd (your git repo)
% for remote in `git branch -r | grep -v master | grep -v develop`; do git checkout --track $remote ; done
# Once you have all branches....
% git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short)%09 %(refname:short)%09 %(authorname)' | column -t
# ... or just show me the same info for all merged branches
1 = 0
9 = 1
8 = 2
@kshep
kshep / eyinfo
Created August 18, 2011 18:25
Script to dump EY app info
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
def dump(env, dna)
puts
puts env.upcase
puts
@kshep
kshep / gist:1119441
Created August 2, 2011 02:02
Ruby script to pull all "From:" addresses from every message in your "All Mail" Gmail folder
#!/usr/bin/env ruby
require 'net/imap'
imap = Net::IMAP.new('imap.gmail.com',993,true)
imap.login('USERNAME', 'PASSWORD')
imap.select('[Gmail]/All Mail')
imap.search(['ALL']).each do |message_id|
msg = imap.fetch(message_id,'ENVELOPE')[0].attr['ENVELOPE']
from = msg.from[0]
@kshep
kshep / gist:1080475
Created July 13, 2011 15:02
chromedriver test
First, changed the response_for method in lib/selenium/webdriver/remote/http/default.rb to
72 def response_for(request)
73 http.set_debug_output $stdout ### KSHEP
74 http.request request
75 end
Then...
---