Skip to content

Instantly share code, notes, and snippets.

View cdgraff's full-sized avatar

AlejandroF cdgraff

View GitHub Profile
@bonobo78
bonobo78 / cmd
Last active December 27, 2015 23:29
Set default mapping for a single field
$ curl -XPUT http://127.0.0.1:9200/_template/logstash_per_index -d @file.json
@untergeek
untergeek / ls-es-mapping.json
Last active March 16, 2019 12:38
Logstash v1.2+ Elasticsearch Mapping Template
{
"template" : "logstash-*",
"settings" : {
"index.refresh_interval" : "5s",
"analysis" : {
"analyzer" : {
"default" : {
"type" : "standard",
"stopwords" : "_none_"
}
@joemiller
joemiller / check-rackspace-bandwidth-limits.rb
Created August 26, 2013 21:54
check the outbound bandwidth on a host and compare against a table of rackspace cloud quotas. alert if near the limit
#!/usr/bin/env ruby
#
# check-rackspace-bandwidth-limits
# ================================
#
# Check the bandwidth usage of a network device on a Rackspace Cloud server
# and alert if it is nearing the threshold allowed for the image size.
#
# Requires sar(1) and sadf(1) to be installed (sysstat package, usually)
#
@joerayme
joerayme / LICENSE
Created July 5, 2013 13:33
Very simple Graphite widget for Dashing
Copyright (c) 2013 Couller Ltd. and Joseph Ray
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@timsavery
timsavery / Ruby Download Parse JSON
Created January 22, 2012 15:19
Example For Downloading and Parsing JSON (Ruby)
require "rubygems"
require "json"
require "net/http"
require "uri"
uri = URI.parse("http://api.sejmometr.pl/posiedzenia/BZfWZ/projekty")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
@vvuksan
vvuksan / gist:992206
Created May 25, 2011 23:03
URL Metrics
# Based on https://github.com/ripienaar/mcollective-plugins/blob/master/agent/urltest/urltest.rb
require 'net/http'
require 'socket'
req_url = "http://www.google.com"
url = URI.parse(req_url)
@jelder
jelder / newrelic.h
Created July 28, 2010 12:10
Add X-Request-Start header so we can track queue times in New Relic RPM beginning at Varnish.
/*
* Add X-Request-Start header so we can track queue times in New Relic RPM beginning at Varnish.
*
*/
#include <sys/time.h>
struct timeval detail_time;
gettimeofday(&detail_time,NULL);
char start[20];