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 a proper Maven | |
wget http://xenia.sote.hu/ftp/mirrors/www.apache.org/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz | |
tar xzf apache-maven-3.0.5-bin.tar.gz | |
export PATH=/home/hadoop/apache-maven-3.0.5/bin:$PATH | |
echo 'export PATH=/home/hadoop/apache-maven-3.0.5/bin:$PATH' >> ~/.bash_profile | |
# Install a supported version of protobuf | |
sudo apt-get remove protobuf-compiler | |
wget https://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz | |
tar xzf protobuf-2.4.1.tar.gz |
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
package com.prezi.hadoop; | |
import org.apache.hadoop.fs.FileAlreadyExistsException; | |
import org.apache.hadoop.fs.FileSystem; | |
import org.apache.hadoop.mapreduce.JobContext; | |
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; | |
import java.io.IOException; | |
/* |
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
library(ggplot2) | |
# Take a look at our example dataset | |
head(diamonds) | |
# Make a chart from scratch | |
x = ggplot() + | |
layer( | |
data = diamonds, mapping = aes(x=carat,y=price), | |
stat='identity', position="identity", geom="point" |
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
# Install Spark and SparkR | |
SPARK_INSTALL_DIR="/tmp/spark-1.5" | |
SNAPSHOT_NAME="spark-1.5.0-SNAPSHOT-bin-hadoop2.6" | |
if (Sys.getenv("SPARK_HOME") == ""){ | |
if(!dir.exists(SPARK_INSTALL_DIR)){ | |
dir.create(SPARK_INSTALL_DIR) | |
download.file(paste("http://people.apache.org/~pwendell/spark-nightly/spark-master-bin/latest/",SNAPSHOT_NAME,".tgz",sep=""), | |
paste(SPARK_INSTALL_DIR,"/",SNAPSHOT_NAME,".tgz",sep="")) | |
wd = getwd() | |
setwd(SPARK_INSTALL_DIR) |
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
from pyspark.sql.types import StringType | |
from pyspark.sql.functions import udf | |
maturity_udf = udf(lambda age: "adult" if age >=18 else "child", StringType()) | |
df = spark.createDataFrame([{'name': 'Alice', 'age': 1}]) | |
df.withColumn("maturity", maturity_udf(df.age)) | |
df.show() |
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/bash -xeu | |
# This script moves your wordrpress page under a different domain | |
# Zoltan C. Toth | |
export HISTCONTROL=ignorespace | |
ORIGIN_DOMAIN=teszt2.gyulahus.hu | |
TARGET_DOMAIN=teszt.gyulahus.hu | |
ORIGIN_DIR=/home/gyulahus/public_html/$ORIGIN_DOMAIN | |
TARGET_DIR=/home/gyulahus/public_html/$TARGET_DOMAIN | |
TARGET_DB=teszt2_gyh |
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 org.apache.spark.{SparkConf, SparkContext} | |
import org.apache.spark.h2o.{H2OContext, H2OFrame} | |
import org.apache.spark.sql.DataFrame | |
import hex.deeplearning.DeepLearning | |
import water.app.SparkContextSupport | |
import hex.deeplearning.DeepLearningParameters | |
import hex.deeplearning.DeepLearningParameters.Activation | |
import org.apache.spark.h2o.{DoubleHolder, H2OContext, H2OFrame} |
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
object Anomymizer extends App { | |
val spark = SparkSession.builder | |
.master("local[3]") | |
.appName("Anonimizer") | |
.getOrCreate() | |
val salt = "SAALT" | |
def anonimizeStr(a:Any) = { | |
a match { |
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
object Anomymizer extends App { | |
val spark = SparkSession.builder | |
.master("local[3]") | |
.appName("Anonimizer") | |
.getOrCreate() | |
val salt = "SAALT" | |
def anonimizeStr(a:Any) = { | |
a match { |
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
object Anomymizer extends App { | |
val spark = SparkSession.builder | |
.master("local[3]") | |
.appName("Anonimizer") | |
.getOrCreate() | |
val salt = "SAALT" | |
def anonimizeStr(a:Any) = { | |
a match { |
OlderNewer