Skip to content

Instantly share code, notes, and snippets.

View cdgraff's full-sized avatar

AlejandroF cdgraff

View GitHub Profile
@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];
@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)
@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)
@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:
@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)
#
@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_"
}
@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
@mjc
mjc / README.md
Last active February 10, 2017 17:53 — forked from erikwennerberg/README.md

Setup

Add the following gems to your Gemfile:

gem 'activeresource'
gem 'newrelic_api'

Update your bundle:

@gboudreau
gboudreau / install-ffmpeg-amazon-linux.sh
Last active June 7, 2024 16:35
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@ePirat
ePirat / spec.md
Last active June 30, 2024 17:00
Icecast Protocol specification

Icecast protocol specification

What is the Icecast protocol?

When speaking of the Icecast protocol here, actually it's just the HTTP protocol, and this document will explain further how source clients need to send data to Icecast.

HTTP PUT based protocol

Since Icecast version 2.4.0 there is support for the standard HTTP PUT method. The mountpoint to which to send the data is specified by the URL path.