Skip to content

Instantly share code, notes, and snippets.

View toast38coza's full-sized avatar

Christo Crampton toast38coza

View GitHub Profile
@toast38coza
toast38coza / logstash_nginx_filter.conf
Last active March 15, 2016 16:49
Logstash config for parsing incoming nginx logs
input {
stdin { }
beats {
port => 5044
type => nginx
}
}
filter {
input {
tcp {
port => 5000
}
http {
port => 8201
type => webhooks
}
beats {
port => 5044
@toast38coza
toast38coza / logstash_outputs_example.conf
Created March 15, 2016 17:52
Push outputs to elasticsearch and hipchat
input {
stdin { }
}
output {
elasticsearch {
hosts => "elasticsearch:9200"
}
hipchat {
@toast38coza
toast38coza / filebeat.yml
Created March 16, 2016 06:26
Sending filebeats to logstash
# this goes on the server with the logs
filebeat:
prospectors:
-
paths:
- "/var/log/nginx/*"
document_type: nginx-logs
registry_file: "/var/log/beat.log"
output:
logstash:
@toast38coza
toast38coza / trigger_jenkins_parameterized_build
Created March 21, 2016 20:36
Curl to trigger a parameterized build
curl -X POST -u username:password \
-d "foo=bar&baz=bus&etc=etc" \
http://jenkinsserver:8080/job/JobName/buildWithParameters
## replace JobName with the name of your job
version: "2"
services:
cache:
image: redis
registry:
image: registry
ports:
- '5000:5000'
@toast38coza
toast38coza / docker-compose-postgres.yml
Last active January 6, 2018 21:44
Docker-compose files for Kong
version: "2"
services:
postgres:
image: postgres:9.4
container_name: kong-database
ports:
- "5432:5432"
environment:
- POSTGRES_USER=kong
@toast38coza
toast38coza / README.md
Last active November 4, 2019 08:26
Take a large file and cache it in memcached

Installation

pip install -r requirements.txt

Run

python chunker.py
@toast38coza
toast38coza / README.md
Created September 14, 2016 09:38
vuex-counter-plain-old-javascript

A Simple Vuex example in old-skool JavaScript

Because learning all the things: new framework (Vue), new Architecture (Flux), new JavaScript (ES6), new build tools (Browserify, WebPack) all in one can be a little daunting ...

I've kept the below example as simple and bare-bones as possible. One html file with everything you need. You can simply open index.html in your favorite browser to see it in action.

Or, if you want to run it with a server:

@toast38coza
toast38coza / getting_your_token.sh
Last active November 11, 2016 12:20
Using the Google natural language API with python
# install gcoud SDK https://cloud.google.com/sdk/downloads
gcloud auth activate-service-account --key-file=/path/to/project/application-key.json
gcloud auth print-access-token