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
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### | |
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget. | |
### You can download all the binaries one-shot by just giving the BASE_URL. | |
### Script might be useful if you need Oracle JDK on Amazon EC2 env. | |
### Script is updated for every JDK release. | |
### Features:- | |
# 1. Resumes a broken / interrupted [previous] download, if any. | |
# 2. Renames the file to a proper name with including platform info. |
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
sudo apt install screen htop ncdu multitail | |
conda install jupyterlab pyspark | |
conda install -c conda-forge jupyter_contrib_nbextensions altair vega_datasets vega3 | |
pip install https://dist.apache.org/repos/dist/dev/incubator/toree/0.2.0/snapshots/dev1/toree-pip/toree-0.2.0.dev1.tar.gz | |
jupyter toree install --spark_home=~/spark-2.3.0 --user | |
jupyter toree install --interpreters=Scala,PySpark,SQL --user | |
jupyter kernelspec list |
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
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### | |
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget / curl. | |
### You can download all the binaries one-shot by just providing one BASE_URL. | |
### Script might be useful if you need Oracle JDK on Amazon EC2 env. | |
### Script is updated for every JDK release. | |
### Features:- | |
# 1. Resumes a broken / interrupted [previous] download, if any. | |
# 2. Renames the file to a proper name with including platform info. |
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 mounts the user's home directory. | |
# We will download the course notebooks and data into a folder in the home directory and mount it with out Docker image. | |
mkdir ~/zepp; cd ~/zepp | |
mkdir -p notebooks logs data | |
wget -c https://codeload.github.com/adbreind/spark-zeppelin-17-1/zip/master -O spark-zeppelin-17-1-master.zip | |
unzip spark-zeppelin-17-1-master.zip | |
mv spark-zeppelin-17-1-master/data/* data/ | |
mv spark-zeppelin-17-1-master/notebooks/* notebooks/ | |
rm -rf spark-zeppelin-17-1-master.zip spark-zeppelin-17-1-master |
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 java.time.LocalDateTime | |
import scala.annotation.tailrec | |
object Stopwatch { | |
def main(args: Array[String]): Unit = { | |
val from = LocalDateTime.of(2001, 9, 11, 8, 46, 40, 250) | |
val to = LocalDateTime.now() |
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
-- FizzBuzz in Haskell | |
fizzbuzz :: Int -> String | |
fizzbuzz n = if fb /= "" | |
then fb | |
else show n | |
where fb = fizz n ++ buzz n | |
fizz:: Int -> String |
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 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 |
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 datetime | |
year,week_num,day_of_the_week = datetime.datetime.now().isocalendar() | |
print year,week_num,day_of_the_week |
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
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' {} + |
NewerOlder