Skip to content

Instantly share code, notes, and snippets.

View jdorfman's full-sized avatar

Justin Dorfman jdorfman

View GitHub Profile
@jdorfman
jdorfman / es.sh
Created April 10, 2012 22:39 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 10.10-11.04
cd /tmp/
sudo apt-get update
sudo apt-get install unzip curl python-software-properties -y
#sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
@jdorfman
jdorfman / gist:2501118
Created April 26, 2012 17:26
nginx - return a 403 response for certain referers
#place this in nginx.conf or a vhosts
if ($http_referer ~* (keyword|domain.com|www.domain.com))
{ return 403; }
@jdorfman
jdorfman / gist:3668672
Created September 7, 2012 19:06 — forked from kazad/gist:3628157
Leftronic API Access
#!/bin/bash
#Which
Grep="`/usr/bin/which grep`"
Awk="`/usr/bin/which awk`"
Cat="`/usr/bin/which cat`"
Sed="`/usr/bin/which sed`"
Curl="`/usr/bin/which curl`"
# Scrape Nagios
<?php
//requires https://github.com/netdna/netdnarws-php
require_once('netdnarws-php/NetDNA.php');
//place your alias, key, secret into this constructor
$api = new NetDNA("{alias}","{consumer_key}","{consumer_secret}");
function purgeCacheFileFromCDN($id, $files = null) {