Skip to content

Instantly share code, notes, and snippets.

@drewr
drewr / psci-error.txt
Created January 2, 2015 15:12
psci can't find symbol
% cat src/Data/PhoneBook.purs
module Data.PhoneBook where
import Data.List
import Data.Maybe
import Control.Plus (empty)
type Entry = { firstName :: String
, lastName :: String
@drewr
drewr / md0.sh
Created December 9, 2014 19:56
`./md0 /mnt /dev/xvdb /dev/xvdc /dev/xvdd`
#!/bin/bash
mount=$1; shift
devices=$*
if [[ -z $devices ]]; then
echo $0 /dev/DEV [/dev/DEV]
exit 99
fi
@drewr
drewr / keybase.md
Created November 24, 2014 21:17
Greetings crypto!

Keybase proof

I hereby claim:

  • I am drewr on github.
  • I am drewr (https://keybase.io/drewr) on keybase.
  • I have a public key whose fingerprint is AE1A BF3D 484C 40E5 CB1C DC9F 57B1 9548 7560 12ED

To claim this, I am signing this object:

@drewr
drewr / .gitignore
Last active August 29, 2015 14:08
SSL vhosts in nginx (type `make && make run`)
/root.*
/*.log
#!/bin/sh
curl -XDELETE localhost:9200/foo >/dev/null
curl -XPUT localhost:9200/foo -d '
{
"mappings": {
"completions": {
"properties": {
"bank": {
"payloads": true,
@drewr
drewr / gist:5cd21898c9c8571a7009
Last active August 29, 2015 14:06
Haskell runtime on OS X

Install GHC

D=~/tmp/hs
mkdir -p $D/build
cd $D/build
curl -O http://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-x86_64-apple-darwin.tar.bz2
bzip2 -cd ghc-7.8.3-x86_64-apple-darwin.tar.bz2 | tar xf -
( cd ghc-7.8.3; ./configure --prefix=$D/ghc-7.8.3 && make install )
curl -XPUT localhost:9200/foo -d'---
mappings:
t:
properties:
f:
type: string
analyzer: whitespace
'
curl -XPOST localhost:9200/foo/t\?refresh -d'---
@drewr
drewr / damjan.sh
Last active August 29, 2015 14:02
Bool filter with whitespace analyzer
curl -s -XDELETE localhost:9200/damjan >/dev/null
curl -s -XPUT localhost:9200/damjan -d'---
settings:
index.number_of_shards: 1
index.number_of_replicas: 0
mappings:
t:
properties:
appname:
{
"Statement": [
{
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::snaps.example.com"
]

First node (24 cores):

sudo sh -c "ulimit -n 1000000; setuidgid $USER env JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 ES_HEAP_SIZE=2g bin/elasticsearch -Des.network.bind_host=0.0.0.0 -Des.network.publish_host=_eth0:ipv4_ -Des.discovery.zen.ping.unicast.hosts=bigstep003 -Des.discovery.zen.ping.multicast.enabled=false -Des.cluster.name=drewr -Des.logger.level=DEBUG"

Second node (8 cores):

sudo sh -c "ulimit -n 1000000; setuidgid $USER env JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 ES_HEAP_SIZE=2g bin/elasticsearch -Des.network.bind_host=0.0.0.0 -Des.network.publish_host=_eth3:ipv4_ -Des.discovery.zen.ping.unicast.hosts=bigstep001 -Des.discovery.zen.ping.multicast.enabled=false -Des.cluster.name=drewr -Des.logger.level=DEBUG"

Logstash running on the first node: