Skip to content

Instantly share code, notes, and snippets.

@avolochenko
avolochenko / 00-pyspark-setup.py
Last active September 22, 2015 05:26
ipython spark 1.4.1 bootstrap (OSX)
import os
import sys
spark_home = os.environ.get('SPARK_HOME', None)
#if not spark_home:
# raise ValueError('SPARK_HOME environment variable is not set')
sys.path.insert(0, os.path.join(spark_home, 'python'))
sys.path.insert(0, os.path.join(spark_home, 'python/lib/py4j-0.8.2.1-src.zip'))
execfile(os.path.join(spark_home, 'python/pyspark/shell.py'))

Keybase proof

I hereby claim:

  • I am sqlcook on github.
  • I am sqlcook (https://keybase.io/sqlcook) on keybase.
  • I have a public key whose fingerprint is 4237 CD89 D138 4A66 87C1 5E8B 15BE ADE8 D8EB 7A6A

To claim this, I am signing this object:

---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
curl -s -XPOST localhost:9200/_bulk?pretty=true --data-binary '
{ "index" : { "_index" : "parent_child", "_type" : "store", "_id" : "store1" } }
{ "name" : "auchan", "owner" : "chris" }
{ "index" : { "_index" : "parent_child", "_type" : "department", "_id" : "department1", "parent" : "store1" } }
{ "name" : "toys", "numberOfProducts" : 150 }
{ "index" : { "_index" : "parent_child", "_type" : "product", "_id" : "product1", "parent" : "department1", "routing" : "store1" } }
{ "name" : "gun", "trademark" : "tiger", "price" : 9, "store_id" : "store1" }
'