Skip to content

Instantly share code, notes, and snippets.

@andrewdmcleod
andrewdmcleod / jujukill
Last active December 18, 2015 14:11
kills juju services and resolves associated units until the service goes away completely
#!/bin/bash
set -x
usage="Usage: $0 juju_service_name"
status=`juju status $1|grep machine|grep {}`
status_exit=$?
if [ "$1" == "" ] || [ "$status_exit" == "0" ] ; then
echo "Specify valid service name as first and only argument."
echo $usage
exit
fi
@andrewdmcleod
andrewdmcleod / spark-class
Created October 27, 2015 14:03
spark config for running jobs in spark-shell manually
# append to /usr/lib/spark/bin/spark-class
export SPARK_LIBRARY_PATH=$SPARK_LIBRARY_PATH:/usr/lib/hadoop/lib/native/
@andrewdmcleod
andrewdmcleod / compute-classpath.sh
Last active October 28, 2015 14:43
spark config for running jobs in spark-shell manually
# append to /usr/lib/spark/bin/compute-classpath.sh
export CLASSPATH=$CLASSPATH:/usr/lib/hadoop/share/hadoop/common/lib/hadoop-lzo-0.4.20-SNAPSHOT.jar
export SPARK_LIBRARY_PATH=$SPARK_LIBRARY_PATH:/usr/lib/hadoop/lib/native/
export SPARK_CLASSPATH=$SPARK_CLASSPATH:/usr/lib/hadoop/share/hadoop/common/lib/
echo "$CLASSPATH"
@andrewdmcleod
andrewdmcleod / spark-env.sh
Created October 27, 2015 12:07
configure spark for lzo compression
# ... append to file ...
SPARK_LIBRARY_PATH=$SPARK_LIBRARY_PATH:/usr/lib/hadoop/lib/native/
SPARK_CLASSPATH=$SPARK_CLASSPATH:/usr/lib/hadoop/share/hadoop/common/lib/
# from http://xiaming.me/posts/2014/05/03/enable-lzo-compression-on-hadoop-pig-and-spark/#sthash.QVWU1s7F.dpuf
#!/usr/bin/env python
import yaml
import os
from subprocess import call
watchdict = {}
watchstr = ""
homedir = os.environ['HOME']