Skip to content

Instantly share code, notes, and snippets.

View IanVaughan's full-sized avatar
👯‍♀️
OMG

Ian Vaughan IanVaughan

👯‍♀️
OMG
View GitHub Profile
@IanVaughan
IanVaughan / reset.sh
Created February 29, 2016 11:08
Reset localhost db
sudo chown ${USER}:staff /usr/local/var/postgres
initdb /usr/local/var/postgres -E utf8
createdb
{:timestamp=>"2016-01-04T14:48:18.760000+0000", :level=>:warn, "INFLIGHT_EVENT_COUNT"=>{"input_to_filter"=>20, "total"=>20}, "STALLING_THREADS"=>{["LogStash::Filters::Grok", {"patterns_dir"=>["/opt/logstash/patterns/lograge"], "match"=>{"message"=>"%{LOGRAGE}"}}]=>[{"thread_id"=>20, "name"=>"|filterworker.0", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb:177:in `match'"}, {"thread_id"=>21, "name"=>"|filterworker.1", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb:177:in `match'"}, {"thread_id"=>22, "name"=>"|filterworker.2", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb:177:in `match'"}, {"thread_id"=>23, "name"=>"|filterworker.3", "current_call"=>"[...]/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.2/lib/grok-pure.rb:177:in `match'"}]}}
{:timestamp=>"2016-01-04T14:48:22.192000+0000", :level=>:warn, "INFLIGHT_EVENT_COUNT"=>{"input_to_filter"=>20, "total"=>20}, "STALLING_THREADS"=>{["LogStash::Filter
@IanVaughan
IanVaughan / logstash-test.conf
Created December 17, 2015 16:47
logstash-test.conf
input { stdin { } }
filter {
grok {
match => { "message" => "%{LOGRAGE}" }
}
}
output {
elasticsearch { hosts => ["localhost:9200"] }
@IanVaughan
IanVaughan / merged
Created December 14, 2015 12:16
Git scripts to make life easier. Put somewhere in your $PATH, and ensure they are executable `chmod +x`
#!/bin/sh -x
# Locally delete a upstream merged branch
# usage:
# merged
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0
CURRENT="${ref#refs/heads/}"
git checkout master
git pull origin master
@IanVaughan
IanVaughan / raise-custom-grape-error.rb
Created December 10, 2015 19:21
Raise custom grape error
error = OpenStruct.new(params: ["foo"], message: "bar")
raise Grape::Exceptions::ValidationErrors, errors: [error]
@IanVaughan
IanVaughan / debug
Last active December 19, 2015 16:52
/opt/logstash/bin/logstash -w 4 -f /etc/logstash/conf.d/logstash.conf
tail -f /var/log/logstash/logstash.log/.stdout
sudo /usr/bin/filebeat -e -v
@IanVaughan
IanVaughan / patron
Created November 21, 2015 14:46
patron gem fail
Installing patron 0.4.20 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/ubuntu/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20151121-13137-yck58r.rb extconf.rb
checking for curl-config... no
checking for main() in -lcurl... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
---
swagger: '2.0'
################################################################################
# API Information #
################################################################################
info:
version: v1
title: Instagram API
description: |
@IanVaughan
IanVaughan / curl.md
Last active August 29, 2015 14:28 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@IanVaughan
IanVaughan / after.sh
Last active September 11, 2018 05:18 — forked from justincampbell/after.sh
Jenkins + GitHub Commit Status API
if [[ $BUILD_STATUS == "success" ]]
then
export STATUS="success"
else
export STATUS="failure"
fi
curl "https://api.github.com/repos/justincampbell/my_repo/statuses/$GIT_COMMIT?access_token=abc123" \
-H "Content-Type: application/json" \
-X POST \