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
alias cd..="cd .." | |
alias cd...="cd ../.." | |
alias cd....="cd ../../.." | |
alias cd.....="cd ../../../.." | |
alias cd......="cd ../../../../.." | |
alias ..="cd .." | |
alias ...="cd ../.." | |
alias ....="cd ../../.." | |
alias สห="ls" | |
alias แก="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
install.packages("RNeo4j") | |
install.packages("igraph") | |
install.packages("jsonlite") | |
install.packages("devtools") | |
library(RNeo4j) | |
library(igraph) | |
library(jsonlite) | |
library(devtools) |
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
#http://stackoverflow.com/questions/19897743/exposing-a-port-on-a-live-docker-container | |
sudo docker ps | |
sudo docker commit <containerid> <foo/live> | |
sudo docker run -i -p 22 -p 8000:80 -m /data:/data -t <foo/live> /bin/bash |
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
# edit sources.list | |
sudo vi /etc/apt/sources.list | |
# remove last two lines | |
# add these two line to .bashr | |
sudo echo "export LC_ALL=en_US.utf8" >>~/.bashrc | |
sudo echo "export LANGUAGE=en_US.utf8" >>~/.bashrc | |
sudo apt-get install screen vim openjdk-7-jdk openjdk-7-jre | |
sudo chmod 777 /var/run/docker.sock |
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
# Export Docker Container | |
docker export graphdb | gzip > graphdb.tar.gz | |
docker export rstudio | gzip > rstudio.tar.gz | |
docker export php | gzip > php.tar.gz | |
# Download exported tar.gz | |
python -m SimpleHTTPServer | |
# Download in another machine with wget |
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
setwd("~/Dropbox/CPCU/CP-year4/LargeScale/data-analytics/data") | |
getwd() | |
traindekd<-read.csv('fav_story_train.txt') | |
save(traindekd) | |
#trainingtest | |
head(traindekd) | |
#traindekd | |
length(unique(traindekd$user_id)) | |
length(unique(traindekd$story_id)) |
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
# resolve apt-get problem | |
# remove last two lines from sources.list | |
sudo head -n -2 /etc/apt/sources.list | |
# add these two line to .bashrc to config locale | |
sudo echo "export LC_ALL=en_US.utf8" >>~/.bashrc | |
sudo echo "export LANGUAGE=en_US.utf8" >>~/.bashrc | |
# install necessary packages |
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
docker run --hostname=quickstart.cloudera --privileged=true -t -i -p 8888:18888 -p 80:180 -p 7180:17180 -d-name cloudera cloudera/quickstart /usr/bin/docker-quickstart |
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
spark-shell --driver-cores 2 --num-executors 3 --executor-cores 6 --executor-memory 5g --driver-memory 5g |
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
LC_ALL=C fgrep -n -f exclude.csv fav_story_test.csv > linenum.txt | |
comm -23 notlinenumber.txt exclude.csv | |
#get first column | |
cut -d : -f 1 linenum.txt > linenumber.txt | |
cut -d : -f 2 linenum.txt > notlinenumber.txt | |
//slow | |
cat linenumber.txt | while read line; do head -n $line random_pred.txt | tail -1; done >> random_diff.txt | |
//fast |
OlderNewer