cat /etc/*release
sudo apt-get update -yqq
sudo apt-get install -yqq p7zip-full
Picked these from here
Command | Note |
---|---|
Ctrl + a | go to the start of the command line |
Ctrl + e | go to the end of the command line |
Ctrl + k | delete from cursor to the end of the command line |
This file contains hidden or 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 ubuntu | |
MAINTAINER Prashanth Babu <[email protected]> | |
RUN apt-get update && \ | |
apt-get install -yqq software-properties-common screen vim && \ | |
add-apt-repository -y ppa:hvr/ghc && \ | |
apt-get update && \ | |
apt-get install -yqq cabal-install-1.24 ghc-8.0.1 && \ | |
apt-get clean && \ |
I hereby claim:
- I am P7h on github.
- I am p7h (https://keybase.io/p7h) on keybase.
- I have a public key whose fingerprint is A775 C217 20FF C0CE E9D1 E60C EFB3 9713 80D4 F9CD
To claim this, I am signing this object:
This file contains hidden or 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
### This script downloads and sets up the following binaries. | |
## Java: 8u91 | |
## Scala: 2.11.8 | |
## SBT: 0.13.11 | |
## Spark: 1.6.1 | |
sudo usermod -a -G sudo hduser | |
## Install the essential packages. | |
sudo apt-get install ssh zip p7zip p7zip-full multitail htop screen tmux -y # subversion git python-pip |
This file contains hidden or 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 java.time._ | |
import java.time.format.DateTimeFormatter | |
val date = "Sun Apr 03 05:40:58 +0200 2016" | |
val formatter = DateTimeFormatter.ofPattern("EE MMM dd HH:mm:ss ZZ yyyy") | |
val parsedDate = LocalDateTime.parse(date, formatter) | |
// parsedDate: java.time.LocalDateTime = 2016-04-03T05:40:58 | |
val parsedDateTZ = ZonedDateTime.parse(date, formatter) | |
// parsedDateTZ: java.time.ZonedDateTime = 2016-04-03T05:40:58+02:00 |
in a nutshell: fit trainingData (train a model), transform testData (predict with model)
- Transformer: DataFrame => DataFrame
- Estimator: DataFrame => Transformer
#Transformers
- Tokenizer: sentence => words
- RegexTokenizer: sentence => words - setPattern
- HashingTF: terms => feature vectors based on frequency - setNumFeatures
This file contains hidden or 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
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### | |
#### Command line download script for JDK7 from Oracle website. | |
#### For JDK8, please check: https://gist.github.com/P7h/9741922 | |
#### Oracle does not release JDK 7 public updates effective April, 2015; for more info: http://www.oracle.com/technetwork/java/javase/documentation/eol-135779.html. | |
## Last JDK7 version: JDK7u79 | |
BASE_URL_7=http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79 | |
## Previous versions |
This file contains hidden or 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
========================================== ========================================== | |
TMUX COMMAND WINDOW (TAB) | |
========================================== ========================================== | |
List tmux ls List ^b w | |
New -s <session> Create ^b c | |
Attach att -t <session> Rename ^b , <name> | |
Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
Kill kill-session -t <session> Close ^b & |
This file contains hidden or 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
###### CPU Info of a Linux machine. | |
### Picked from: http://echorand.me/site/notes/articles/python_linux/article.html | |
from __future__ import print_function | |
from collections import OrderedDict | |
import pprint | |
def cpuinfo(): | |
cpuinfo=OrderedDict() | |
procinfo=OrderedDict() | |
nprocs = 0 |