This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://dagobah.ftphosting.net/yum/smartfile.repo -O /etc/yum.repos.d/smartfile.repo | |
mv smartfile.repo /etc/yum.repos.d/ | |
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm | |
sudo rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm | |
yum install -y libffi python26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git clone, build, and copy the necessary MongoDB jars to your worker node $HADOOP_HOME/lib directories | |
cd ~/ | |
git clone https://github.com/mongodb/mongo-hadoop | |
cd mongo-hadoop | |
./gradlew jar | |
sudo cp build/libs/* /usr/lib/hadoop/lib | |
sudo cp core/build/libs/* /usr/lib/hadoop/lib | |
sudo cp hive/build/libs/* /usr/lib/hadoop/lib | |
cd ~/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set number | |
set autoindent | |
set smartindent | |
set expandtab | |
set shiftwidth=2 | |
set tabstop=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -eu | |
FILE=$1 | |
HEADER_LINE_NUM=$2 | |
DELIM=$3 | |
TABLE_NAME=$4 | |
LOCATION=$5 | |
# This script assumes columns are all strings. Edit the DDL file after running the script and change column types at will. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIR=$1 | |
cd $DIR | |
for file in * | |
do | |
tar -czvf $file.tgz $file/ | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys, pyproj, shapefile | |
input_file = sys.argv[1] | |
output_file = sys.argv[2] | |
source_spatialref = sys.argv[3] | |
target_spatialref = sys.argv[4] | |
sf = shapefile.Reader(input_file) | |
shapes = sf.shapes() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%angular | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" /> | |
<div id="map" style="height: 500px; width: 100%"></div> | |
<script type="text/javascript"> | |
function initMap() { | |
var map = L.map('map').setView([30.00, -30.00], 3); | |
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map); | |
var geoMarkers = L.layerGroup().addTo(map); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%angular | |
<div id='testDiv'> | |
</div> | |
<script> | |
var el = angular.element($('#testDiv').parent('.ng-scope')); | |
angular.element(el).ready(function() { | |
window.locationWatcher = el.scope().compiledScope.$watch('dummy', function(newValue, oldValue) { | |
$('#testDiv').append(newValue); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def list(table: String, col: String) : Array[(String, String)] = { | |
sqlContext.sql("select distinct " + col + " from " + table + " order by " + col).collect.map(x => (x(0).asInstanceOf[String], x(0).asInstanceOf[String])) | |
} | |
def tables(): Array[(String, String)] = { | |
sqlContext.sql("show tables").collect.map(x => (x(0).asInstanceOf[String], x(0).asInstanceOf[String])) | |
} | |
def columns(table: String) : Array[(String, String)] = { | |
sqlContext.sql("select * from " + table + " limit 0").columns.map(x => (x, x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get list of distinct values on a column for given table | |
def distinctValues(table: String, col: String) : Array[(String, String)] = { | |
sqlContext.sql("select distinct " + col + " from " + table + " order by " + col).collect.map(x => (x(0).asInstanceOf[String], x(0).asInstanceOf[String])) | |
} | |
//Get list of tables | |
def tables(): Array[(String, String)] = { | |
sqlContext.sql("show tables").collect.map(x => (x(0).asInstanceOf[String], x(0).asInstanceOf[String])) | |
} |
OlderNewer