Skip to content

Instantly share code, notes, and snippets.

View jdorfman's full-sized avatar

Justin Dorfman jdorfman

View GitHub Profile
<?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) {
@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
@jdorfman
jdorfman / gist:2501118
Created April 26, 2012 17:26 — forked from netdna/gist:2501099
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 / 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