Generate Certificates for Hyperledger Fabric with Fabric CA

#/bin/bash

export ORG_NAME=org1
export ORG_NAME_2=org2

export WORK_DIR=/tmp/contoz-generate-certs
export TYPE=msp
export FABRIC_CA_CLIENT_HOME=$WORK_DIR/fabric-ca/clients/admin
export ADMIN_USER=admin
export ADMIN_PASSWORD=adminpw
export CA_HOST=localhost:444
export ORDERER_USER=orderer
export ORDERER_PASSWORD=ordererpw
export CRS_NAMES=”–csr.names C=DE,ST=BW,L=Stuttgart,O=Hyperledger,OU=Contoz”

rm -rf crypto-config
mkdir -p $FABRIC_CA_CLIENT_HOME

openssl s_client -showcerts -connect $CA_HOST /dev/null|openssl x509 -outform PEM > $FABRIC_CA_CLIENT_HOME/client.pem

fabric-ca-client enroll -u https://$ADMIN_USER:$ADMIN_PASSWORD@$CA_HOST –tls.certfiles $FABRIC_CA_CLIENT_HOME/client.pem

function register() {
ID_TYPE=$1
AFFFI=””
ATTR=””

if [ -z “$3” ]
then
echo “\$ATTR is empty”
else
ATTR= “–id.attrs “$3
fi

if [ -z “$2” ]
then
echo “\$AFFFI is empty”
else
AFFFI= “–id.affiliation “$2
fi

fabric-ca-client register –id.name $USER –id.type $ID_TYPE –id.secret $PASSWORD $AFFFI $ATTR –tls.certfiles $FABRIC_CA_CLIENT_HOME/client.pem
}

function enroll_adminuser (){

ADMIN_PATH=$1
rm -rf $ADMIN_PATH
mkdir -p $ADMIN_PATH/signcerts
mkdir -p $ADMIN_PATH/admincerts
mkdir -p $ADMIN_PATH/cacerts
mkdir -p $ADMIN_PATH/keystore

fabric-ca-client enroll -u https://$USER:$PASSWORD@$CA_HOST -M enroll_admin –tls.certfiles $FABRIC_CA_CLIENT_HOME/client.pem –csr.hosts $HOST #–enrollment.attrs $ATTR
cp $FABRIC_CA_CLIENT_HOME/enroll_admin/signcerts/* $ADMIN_PATH/signcerts/
cp $FABRIC_CA_CLIENT_HOME/enroll_admin/signcerts/* $ADMIN_PATH/admincerts/
cp $FABRIC_CA_CLIENT_HOME/enroll_admin/cacerts/* $ADMIN_PATH/cacerts/
cp $FABRIC_CA_CLIENT_HOME/enroll_admin/keystore/* $ADMIN_PATH/keystore/
rm -rf $FABRIC_CA_CLIENT_HOME/enroll_admin
}

function enroll_admincert (){

SRC_ADMINCERT_PATH=$1
DEST_ADMINCERT_PATH=$2
rm -rf $DEST_ADMINCERT_PATH
mkdir -p $DEST_ADMINCERT_PATH
cp $SRC_ADMINCERT_PATH/* $DEST_ADMINCERT_PATH/
}

function enroll_cacert (){
CACERT_PATH=$1
rm -rf $CACERT_PATH
mkdir -p $CACERT_PATH
fabric-ca-client enroll -u https://$USER:$PASSWORD@$CA_HOST -M enroll_cacert –tls.certfiles $FABRIC_CA_CLIENT_HOME/client.pem –csr.hosts $HOST
cp $FABRIC_CA_CLIENT_HOME/enroll_cacert/cacerts/* $CACERT_PATH/
rm -rf $FABRIC_CA_CLIENT_HOME/enroll_cacert
}

function enroll_tlscacert (){
TSLCACERT_PATH=$1
rm -rf $TSLCACERT_PATH
mkdir -p $TSLCACERT_PATH
fabric-ca-client enroll -u https://$USER:$PASSWORD@$CA_HOST -M enroll_ca_tls –enrollment.profile tls –tls.certfiles $FABRIC_CA_CLIENT_HOME/client.pem –csr.hosts $HOST
cp $FABRIC_CA_CLIENT_HOME/enroll_ca_tls/tlscacerts/* $TSLCACERT_PATH/
rm -rf $FABRIC_CA_CLIENT_HOME/enroll_ca_tls
}

function copy (){
SRC_PATH=$1
DEST_PATH=$2
rm -rf $DEST_PATH
mkdir -p $DEST_PATH
cp $SRC_PATH/* $DEST_PATH/

}

function enroll_signcerts (){
SIGNCERT_PATH=$1
rm -rf $SIGNCERT_PATH
mkdir -p $SIGNCERT_PATH/signcerts
mkdir -p $SIGNCERT_PATH/keystore
fabric-ca-client enroll -u https://$USER:$PASSWORD@$CA_HOST -M enroll_signcerts –tls.certfiles $FABRIC_CA_CLIENT_HOME/client.pem –csr.hosts $HOST
cp $FABRIC_CA_CLIENT_HOME/enroll_signcerts/signcerts/* $SIGNCERT_PATH/signcerts
cp $FABRIC_CA_CLIENT_HOME/enroll_signcerts/keystore/* $SIGNCERT_PATH/keystore/
rm -rf $FABRIC_CA_CLIENT_HOME/enroll_signcerts
}

function enroll_orderer (){

ORDERER=$1
USER=$ORDERER.contoz.com
PASSWORD=contoz_pw
HOST=cli,$ORDERER,$ORDERER.$ORG_NAME
register peer
enroll_signcerts crypto-config/ordererOrganizations/contoz.com/orderers/$ORDERER.contoz.com/msp
enroll_tls crypto-config/ordererOrganizations/contoz.com/orderers/$ORDERER.contoz.com/tls
copy crypto-config/ordererOrganizations/contoz.com/msp/admincerts crypto-config/ordererOrganizations/contoz.com/orderers/$ORDERER.contoz.com/msp/admincerts
copy crypto-config/ordererOrganizations/contoz.com/msp/cacerts crypto-config/ordererOrganizations/contoz.com/orderers/$ORDERER.contoz.com/msp/cacerts
copy crypto-config/ordererOrganizations/contoz.com/msp/tlscacerts crypto-config/ordererOrganizations/contoz.com/orderers/$ORDERER.contoz.com/msp/tlscacerts
}

function enroll_tls (){

export MSP_PATH=$1

rm -rf $MSP_PATH
mkdir -p $MSP_PATH
fabric-ca-client enroll -u https://$USER:$PASSWORD@$CA_HOST -M enroll_tls –enrollment.profile tls –tls.certfiles $FABRIC_CA_CLIENT_HOME/client.pem –csr.hosts $HOST

PRIV_KEY=$(ls $FABRIC_CA_CLIENT_HOME/enroll_tls/keystore/*_sk)
CA_PEM=$(ls $FABRIC_CA_CLIENT_HOME/enroll_tls/tlscacerts/*.pem)

cp $PRIV_KEY $MSP_PATH/server.key
cp $CA_PEM $MSP_PATH/ca.crt
cp $FABRIC_CA_CLIENT_HOME/enroll_tls/signcerts/cert.pem $MSP_PATH/server.crt

#openssl x509 -outform der -in $FABRIC_CA_CLIENT_HOME/enroll_tls/signcerts/cert.pem -out $MSP_PATH/server.crt
#openssl x509 -outform der -in $FABRIC_CA_CLIENT_HOME/enroll_tls/tlscacerts/ca.crt -out $MSP_PATH/ca.crt
rm -rf $FABRIC_CA_CLIENT_HOME/enroll_tls

}

create_config_yaml (){
CY_PATH=$1
echo “NodeOUs:
Enable: true
ClientOUIdentifier:
Certificate: cacerts/localhost-444.pem
OrganizationalUnitIdentifier: client
PeerOUIdentifier:
Certificate: cacerts/localhost-444.pem
OrganizationalUnitIdentifier: peer” >> $CY_PATH
}

function enroll_peer (){

PEER=$1
ORG=$2
USER=$PEER.$ORG.contoz.com
PASSWORD=contoz_pw
HOST=cli,$PEER,$PEER.$ORG
register peer
enroll_signcerts crypto-config/peerOrganizations/$ORG.contoz.com/peers/$PEER.$ORG.contoz.com/msp
enroll_tls crypto-config/peerOrganizations/$ORG.contoz.com/peers/$PEER.$ORG.contoz.com/tls
copy crypto-config/peerOrganizations/$ORG.contoz.com/msp/admincerts crypto-config/peerOrganizations/$ORG.contoz.com/peers/$PEER.$ORG.contoz.com/msp/admincerts
copy crypto-config/peerOrganizations/$ORG.contoz.com/msp/cacerts crypto-config/peerOrganizations/$ORG.contoz.com/peers/$PEER.$ORG.contoz.com/msp/cacerts
copy crypto-config/peerOrganizations/$ORG.contoz.com/msp/tlscacerts crypto-config/peerOrganizations/$ORG.contoz.com/peers/$PEER.$ORG.contoz.com/msp/tlscacerts
create_config_yaml crypto-config/peerOrganizations/$ORG.contoz.com/peers/$PEER.$ORG.contoz.com/msp/config.yaml
}

enroll_user (){
USER=$1@$ORG_NAME.contoz.com
PASSWORD=$1_contoz_pw
register $4
HOST=$2
enroll_adminuser $3/$1@$ORG_NAME.contoz.com/msp
enroll_tlscacert $3/$1@$ORG_NAME.contoz.com/msp/tlscacerts
enroll_tls $3/$1@$ORG_NAME.contoz.com/tls
create_config_yaml $3/$1@$ORG_NAME.contoz.com/msp/config.yaml

}

USER=Admin@contoz.com
PASSWORD=admin_contoz_pw
HOST=cli,orderer1,orderer1.$ORG_NAME,orderer2,orderer2.$ORG_NAME,orderer3,orderer3.$ORG_NAME,orderer4,orderer4.$ORG_NAME,orderer5,orderer4.$ORG_NAME
register client
enroll_adminuser crypto-config/ordererOrganizations/contoz.com/users/Admin@contoz.com/msp
enroll_tlscacert crypto-config/ordererOrganizations/contoz.com/users/Admin@contoz.com/msp/tlscacerts
enroll_tls crypto-config/ordererOrganizations/contoz.com/users/Admin@contoz.com/tls

enroll_admincert crypto-config/ordererOrganizations/contoz.com/users/Admin@contoz.com/msp/admincerts crypto-config/ordererOrganizations/contoz.com/msp/admincerts
enroll_cacert crypto-config/ordererOrganizations/contoz.com/msp/cacerts
enroll_tlscacert crypto-config/ordererOrganizations/contoz.com/msp/tlscacerts

enroll_orderer orderer1
enroll_orderer orderer2
enroll_orderer orderer3
enroll_orderer orderer4
enroll_orderer orderer5

USER=Admin@$ORG_NAME.contoz.com
PASSWORD=admin_contoz_pw
register client
HOST=cli,peer1,peer1.$ORG_NAME,peer2,peer2.$ORG_NAME,peer3,peer3.$ORG_NAME,peer4,peer4.$ORG_NAME,peer5,peer4.$ORG_NAME
enroll_adminuser crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users/Admin@$ORG_NAME.contoz.com/msp
enroll_tlscacert crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users/Admin@$ORG_NAME.contoz.com/msp/tlscacerts
enroll_tls crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users/Admin@$ORG_NAME.contoz.com/tls

enroll_admincert crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users/Admin@$ORG_NAME.contoz.com/msp/admincerts crypto-config/peerOrganizations/$ORG_NAME.contoz.com/msp/admincerts
enroll_cacert crypto-config/peerOrganizations/$ORG_NAME.contoz.com/msp/cacerts
enroll_tlscacert crypto-config/peerOrganizations/$ORG_NAME.contoz.com/msp/tlscacerts
create_config_yaml crypto-config/peerOrganizations/$ORG_NAME.contoz.com/msp/config.yaml

enroll_peer peer0 $ORG_NAME
enroll_peer peer1 $ORG_NAME
enroll_peer peer2 $ORG_NAME
enroll_peer peer3 $ORG_NAME
enroll_peer peer4 $ORG_NAME

enroll_user User1 mwc1,mwc1.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users client
enroll_user User2 mwc2,mwc2.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users client
enroll_user User3 mwc3,mwc3.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users client
enroll_user User4 mwc4,mwc4.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users client
enroll_user User5 mwc5,mwc5.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users client

enroll_user User6 mwa1,mwa1.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users user
enroll_user User7 mwa2,mwa2.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users user
enroll_user User8 mwa3,mwa3.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users user
enroll_user User9 mwa4.mwa4.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users user
enroll_user User10 mwa5,mwa5.$ORG_NAME crypto-config/peerOrganizations/$ORG_NAME.contoz.com/users user

USER=Admin@$ORG_NAME_2.contoz.com
PASSWORD=admin_contoz_pw
register client
HOST=cli,peer1,peer1.$ORG_NAME_2,peer2,peer2.$ORG_NAME_2,peer3,peer3.$ORG_NAME_2,peer4,peer4.$ORG_NAME_2,peer5,peer4.$ORG_NAME
enroll_adminuser crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users/Admin@$ORG_NAME_2.contoz.com/msp
enroll_tlscacert crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users/Admin@$ORG_NAME_2.contoz.com/msp/tlscacerts
enroll_tls crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users/Admin@$ORG_NAME_2.contoz.com/tls

enroll_admincert crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users/Admin@$ORG_NAME_2.contoz.com/msp/admincerts crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/msp/admincerts
enroll_cacert crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/msp/cacerts
enroll_tlscacert crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/msp/tlscacerts
create_config_yaml crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/msp/config.yaml

enroll_peer peer0 $ORG_NAME_2
enroll_peer peer1 $ORG_NAME_2
enroll_peer peer2 $ORG_NAME_2
enroll_peer peer3 $ORG_NAME_2
enroll_peer peer4 $ORG_NAME_2

enroll_user User1 mwc1,mwc1.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users client
enroll_user User2 mwc2,mwc2.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users client
enroll_user User3 mwc3,mwc3.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users client
enroll_user User4 mwc4,mwc4.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users client
enroll_user User5 mwc5,mwc5.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users client

enroll_user User6 mwa1,mwa1.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users user
enroll_user User7 mwa2,mwa2.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users user
enroll_user User8 mwa3,mwa3.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users user
enroll_user User9 mwa4.mwa4.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users user
enroll_user User10 mwa5,mwa5.$ORG_NAME_2 crypto-config/peerOrganizations/$ORG_NAME_2.contoz.com/users user

tree crypto-config
#tree $FABRIC_CA_CLIENT_HOME

rm -rf $FABRIC_CA_CLIENT_HOME

Advertisements

Scala + Spring Boot (Actuator RESTful API)


build.sbt

import sbt.internal.IvyConsole.Dependencies._

lazy val springVersion = "1.5.3.RELEASE"
lazy val thymeleafVersion = "2.1.5.RELEASE"

lazy val root = (project in file(".")).
settings(
inThisBuild(List(
organization := "org.bk",
scalaVersion := "2.11.0",
version := "1.0"
)),
name := "immosis-scheduler-immobilienscout24",
libraryDependencies += "org.springframework.boot" % "spring-boot-starter-web" % springVersion,
libraryDependencies += "org.springframework.boot" % "spring-boot-starter-actuator" % springVersion
)
mainClass in (Compile, run) := Some("HelloWorldApplication")

HelloWorldApplication.scala

import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication

object HelloWorldApplication extends App {
SpringApplication.run(classOf[HelloWorldApplication]);
}

@SpringBootApplication
class HelloWorldApplication

HelloWorldController.scala

import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.{GetMapping, RequestParam, ResponseBody}

@Controller
class HelloWorldController {

@GetMapping(Array("/hello-world"))
@ResponseBody
def sayHello(@RequestParam(name="name", required=false, defaultValue="Stranger") name: String): Greeting = {
new Greeting("Hello, "+name)
}
}

Greeting.scala
class Greeting(content: String){
def getContent():String = content
}

sbt run

curl localhost:8080/hello-world
{"content":"Hello, Stranger"}

VCode Debug Mocha


{
"version": "0.2.0",
"configurations": [

{
"name": "Run Mocha",
"request": "launch",
"type": "node",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": ["--opts", "${workspaceFolder}/mocha.opts"],
"cwd": "${workspaceFolder}",
"runtimeExecutable": null,
"env": { },

}
]
}

mocha.opts :

--timeout 60000
--exit
--recursive test
--debug-brk

Landing Page Loader For React

loader.css:

.loader {
border: 16px solid #f3f3f3; /* Light grey */
border-top: 16px solid #3498db; /* Blue */
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;

display: inline-block;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;

}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

index.html:

< div id=”root” >
<div class=”loader”&lt >/div>
< /div >

index.js:

import React from ‘react’;
import ReactDOM from ‘react-dom’;
import App from ‘./App’;

ReactDOM.render(<App />, document.getElementById(‘root’));
registerServiceWorker();

Scala Parser for YAML File


import java.io.{File, FileInputStream}
import java.text.SimpleDateFormat
import org.yaml.snakeyaml.Yaml
import org.yaml.snakeyaml.constructor.Constructor

object Main {
def main(args: Array[String]): Unit = {
val text = scala.io.Source.fromInputStream(getClass.getResourceAsStream(
"codes.yaml")).mkString
val yaml = new Yaml
val obj = yaml.load(text)
val codes = obj.asInstanceOf[java.util.LinkedHashMap[String,java.util.Map[String, Any]]]
var values = codes.get("duration").get("values").asInstanceOf[java.util.ArrayList
[java.util.Map[String,Any]]]
values.toArray.foreach(c=> println(c.asInstanceOf[java.util.LinkedHashMap[String,Any]]
.get("code")))
}
}

codes.yaml:

duration:
values:
-
code: 1
from: 0
to: 1
-
code: 2
from: 1
to: 3

build.sbt

libraryDependencies += "org.yaml" % "snakeyaml" % "1.8"

Install oozie 4.3.0

Install oozie 4.3.0

wget http://www-us.apache.org/dist/hadoop/common/hadoop-2.7.3/hadoop-2.7.3.tar.gz

tar -xvf hadoop-2.7.3.tar.gz

cd hadoop-2.7.3/
vim etc/hadoop/core-site.xml

fs.defaultFS
hdfs://localhost:9000

vim etc/hadoop/hdfs-site.xml

dfs.replication
1

dfs.namenode.name.dir
file:///home/your_user_name/data/hadoop/

sudo apt-get install openssh-server
ssh-keygen -t rsa -P ” -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys

vim etc/hadoop/hadoop-env.sh
export JAVA_HOME=/opt/jdk

bin/hdfs namenode -forma
sbin/start-dfs.sh

wget http://www-eu.apache.org/dist/oozie/4.3.0/oozie-4.3.0.tar.gz

tar -xvf oozie-4.3.0.tar.gz

cd oozie-4.3.0

./bin/mkdistro.sh -P hadoop-2 -DskipTests

cp -R distro/target/oozie-4.3.0-distro/oozie-4.3.0/ ../oozie

cd ../oozie

mkdir libext
cd libext
wget http://extjs.com/deploy/ext-2.2.zip
cd ..

cp $HADOOP_HOME/share/hadoop/**/*.jar libext/
cp $HADOOP_HOME/share/hadoop/common/*.jar libext/
cp $HADOOP_HOME/share/hadoop/common/lib/*.jar libext/
cp $HADOOP_HOME/share/hadoop/hdfs/lib/*.jar libext/
cp $HADOOP_HOME/share/hadoop/hdfs/*.jar libext/
cp $HADOOP_HOME/share/hadoop/mapreduce/*.jar libext/
cp $HADOOP_HOME/share/hadoop/mapreduce/lib/*.jar libext/
cp $HADOOP_HOME/share/hadoop/yarn/lib/*.jar libext/
cp $HADOOP_HOME/share/hadoop/yarn/*.jar libext/

./bin/oozie-setup.sh prepare-war

vim $HADOOP_HOME/etc/hadoop/core-site.xml

hadoop.proxyuser.your_user_name.hosts
*

hadoop.proxyuser.your_user_name.groups
*

$HADOOP_HOME/sbin/stop-dfs.sh
$HADOOP_HOME/sbin/start-dfs.sh

./bin/oozie-setup.sh sharelib create -fs hdfs://localhost:9000

./bin/ooziedb.sh create -sqlfile oozie.sql -run

vim conf/oozie-site.xml

oozie.service.WorkflowAppService.system.libpath
/user/your_user_name/share/lib/

oozie.service.HadoopAccessorService.hadoop.configurations
*=$HAOOP_HOME/etc/hadoop/

./bin/oozied.sh start

tar -xvf oozie-examples.tar.gz

vim examples/apps/map-reduce/job.properties
nameNode=hdfs://localhost:9000
jobTracker=localhost:10020
oozie.use.system.libpath=true

hadoop fs -put examples hdfs://localhost:9000/user/your_username/examples

$HADOOP_HOME/sbin/mr-jobhistory-daemon.sh –config $HADOOP_CONF_DIR start historyserver

jps

./bin/oozie job -oozie http://localhost:11000/oozie -config examples/apps/map-reduce/job.properties -run

./bin/oozie job -oozie http://localhost:11000/oozie -info 0000000-170408113318091-oozie-fars-W
./bin/oozie job -oozie http://localhost:11000/oozie -log 0000000-170408113318091-oozie-fars-W

WrodCount MapReduce with Scalding

git clone https://github.com/scalding-io/ProgrammingWithScalding

cd ProgrammingWithScalding/chapter2/

mvn clean install

hadoop fs -mkdir -p /data/input

hadoop fs -mkdir -p /data/output

echo “This is a happy day. A day to remember” > /tmp/input.txt

hadoop fs -put /tmp/input.txt /data/input

hadoop jar /root/repo/ProgrammingWithScalding/chapter2/target/chapter2-0-jar-with-dependencies.jar com.twitter.scalding.Tool WordCountJob –local –input /data/input/input.txt –output /data/output/output.txt

cat /data/output/output.txt
a 2
day 1
day. 1
happy 1
is 1
remember 1
this 1
to 1