Skip to content

Instantly share code, notes, and snippets.

@teebu
teebu / logstash.conf
Last active February 6, 2019 10:08 — forked from maxkandler/logstash.conf
Grok filter for Cloudfront Logs to be used with Logstash & ElasticSearch
filter {
grok {
match => [
"message", "%{YEAR:year}-%{MONTHNUM:month}-%{MONTHDAY:day}[\t]%{TIME:time}[\t](?<x_edge_location>\b[\w\-]+\b)[\t](?:%{NUMBER:sc_bytes}|-)[\t]%{IPORHOST:clientip}[\t]%{WORD:cs_method}[\t]%{HOSTNAME:cs_host}[\t]%{NOTSPACE:cs_uri_stem}[\t]%{NUMBER:sc_status}[\t]%{GREEDYDATA:referrer}[\t]%{GREEDYDATA:agent}[\t]%{GREEDYDATA:cs_uri_query}[\t]%{GREEDYDATA:cookies}[\t]%{WORD:x_edge_result_type}[\t]%{NOTSPACE:x_edge_request_id}[\t]%{HOSTNAME:x_host_header}[\t]%{GREEDYDATA:cs_protocol}[\t]%{INT:cs_bytes}[\t]%{GREEDYDATA:time_taken}[\t]%{GREEDYDATA:x_forwarded_for}[\t]%{GREEDYDATA:ssl_protocol}[\t]%{GREEDYDATA:ssl_cipher}[\t]%{GREEDYDATA:x_edge_response_result_type}[\t]%{GREEDYDATA:cs_protocol_version}"
]
}
geoip {
source => "c_ip"
}
mutate {
@teebu
teebu / log.js
Created July 27, 2017 00:43 — forked from vikas5914/log.js
Custom Logger Library with winston
var winston = require('winston')
// set default log level.
var logLevel = 'info'
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'blue',
const configuration = {
db: {
name: 's3-db',
environment: 'dev',
pageSize : 10,
allowDrop: false
},
provider: {
name: 's3',
region: 'us-east-1'
@teebu
teebu / Create iOS Icons 2017 Sizes with 180.jsx
Last active July 16, 2017 03:15 — forked from colus001/Create iOS Icons 2016 Sizes with 180.jsx
Photoshop Script to Create iOS Icons from a source image
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
@teebu
teebu / default.vcl
Created June 23, 2017 19:23 — forked from mojodna/default.vcl
Resolve ELB IPs and create a dynamic Varnish backend list (intended to run out of cron).
# ...
include "dynamic_backends.vcl";
# ...
@teebu
teebu / gist:a763433d326a3023a758efbb3dba2671
Created June 15, 2017 21:26 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@teebu
teebu / README.md
Created June 14, 2017 18:31 — forked from jgoodall/README.md
This is a sample of how to send some information to logstash via the TCP input from node.js or python.

This is a sample of how to send some information to logstash via the TCP input in nodejs or python. It assumes the logstash host is on 10.10.10.100 and the TCP listening input is 9563.

The logstash.conf should look something like the sample file.

The log message should be a stringified JSON object with the log message in the @message field.

To use, run the node script node sendMessageToLogstash.js, or the python script python sendMessageToLogstash.js

@teebu
teebu / data.csv
Created May 27, 2017 21:48 — forked from grncdr/data.csv
Demo of importing a CSV file into a Contentful space
first name last name age
Stephen Sugden 31
Tom Reznik 29
Justin Thomas 30
@teebu
teebu / genre list
Created April 25, 2017 17:18
Apple genre id list
var genres_list = {
36: 'All',
6025: 'Stickers',
6018: 'Books',
6000: 'Business',
6022: 'Catalogs',
6017: 'Education',
6016: 'Entertainment',
6015: 'Finance',
6023: 'Food & Drink',
@teebu
teebu / aws-sns-example.js
Created March 30, 2017 19:15 — forked from tmarshall/aws-sns-example.js
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();