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
#!/bin/sh | |
test_document="{ | |
\"text\": \"HEAR the sledges with the bells, / Silver bells! / What a world of merriment their melody foretells! / How they tinkle, tinkle, tinkle, / In the icy air of night! / While the stars, that oversprinkle / All the heavens, seem to twinkle / With a crystalline delight; / Keeping time, time, time, / In a sort of Runic rhyme, / To the tintinnabulation that so musically wells / From the bells, bells, bells, bells, / Bells, bells, bells— / From the jingling and the tinkling of the bells.\" | |
}" | |
if curl -fs -X HEAD localhost:9200/top-terms; then | |
echo "Clear the old test index" | |
curl -X DELETE localhost:9200/top-terms; echo "\n" | |
fi |
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
########## | |
# For verification, you can display the OS release. | |
########## | |
$ cat /etc/lsb-release | |
DISTRIB_ID=Ubuntu | |
DISTRIB_RELEASE=11.10 | |
DISTRIB_CODENAME=oneiric | |
DISTRIB_DESCRIPTION="Ubuntu 11.10" | |
########## |
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
<project> | |
<modelVersion>4.0.0</modelVersion> | |
<name>Maven Default Project</name> | |
<repositories> | |
<repository> | |
<id>central</id> | |
<name>Maven Repository Switchboard</name> | |
<layout>default</layout> | |
<url>http://repo1.maven.org/maven2</url> |
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
<project> | |
<modelVersion>4.0.0</modelVersion> | |
<name>Maven Default Project</name> | |
<repositories> | |
<repository> | |
<id>central</id> | |
<name>Maven Repository Switchboard</name> | |
<layout>default</layout> | |
<url>http://repo1.maven.org/maven2</url> |
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
<!-- In: conf/core-site.xml --> | |
<property> | |
<name>fs.default.name</name> | |
<value>hdfs://master:54310</value> | |
<description>...</description> | |
</property> | |
<!-- In: conf/mapred-site.xml --> | |
<property> |
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
#Add to the end of the ~/.bashrc | |
# Set Hadoop-related environment variables | |
export HADOOP_HOME=/usr/local/hadoop | |
# Set JAVA_HOME (we will also configure JAVA_HOME directly for Hadoop later on) | |
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386 | |
# Some convenient aliases and functions for running Hadoop-related commands | |
unalias fs &> /dev/null | |
alias fs="hadoop fs" | |
unalias hls &> /dev/null | |
alias hls="fs -ls" |
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
import sqlite3 | |
import pymssql | |
db1Conn = ['127.0.0.1', 'sa', 'sa','AuditDataCenter'] | |
db2Conn = ['127.0.0.1', 'sa', 'sa','AuditDataCenter1'] | |
sql = "SELECT * from INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'" | |
def MssqlTables(dbConn): | |
conn = pymssql.connect(host=dbConn[0], user=dbConn[1], password=dbConn[2], database=dbConn[3]) |
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
import os, sys | |
import Image | |
ppmDir = "ppm/" | |
jpfDir = "jpg/" | |
for filename in os.listdir(ppmDir): | |
(name, ext) = os.path.splitext(filename) | |
if ".ppm" != ext: | |
continue |
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
import re | |
import os | |
from lxml import etree | |
from copy import deepcopy | |
fileInput = "Input.xml" | |
fileOutput = "Output.xml" | |
def Indent(elem, level=0): | |
i = "\n" + level * " " |