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:
| 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 |
| ### 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 |
I hereby claim:
To claim this, I am signing this object:
| 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 && \ |
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 |
| sudo find / -type f -name "log4j.properties" -exec sed -i 's/TRACE/ERROR/g' {} + | |
| sudo find / -type f -name "log4j.properties" -exec sed -i 's/DEBUG/ERROR/g' {} + | |
| sudo find / -type f -name "log4j.properties" -exec sed -i 's/INFO/ERROR/g' {} + | |
| sudo find / -type f -name "log4j.properties" -exec sed -i 's/WARN/ERROR/g' {} + |
| import datetime | |
| year,week_num,day_of_the_week = datetime.datetime.now().isocalendar() | |
| print year,week_num,day_of_the_week |
| object FizzBuzz { | |
| def main(args: Array[String]) { | |
| (1 to 30) map fizzbuzz map println | |
| } | |
| case class MultipleOf(n: Int) { | |
| def unapply(x: Int): Option[Int] = { | |
| if(x % n == 0) { | |
| Some(x/n) | |
| } else { | |
| None |
| -- FizzBuzz in Haskell | |
| fizzbuzz :: Int -> String | |
| fizzbuzz n = if fb /= "" | |
| then fb | |
| else show n | |
| where fb = fizz n ++ buzz n | |
| fizz:: Int -> String |