View jdk9_download.sh
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### | |
### 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. |
View toree_install.sh
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 |
View jdk8_download.sh
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### | |
### 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. |
View zeppelin_docker_image.sh
# 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 |
View Stopwatch.scala
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() |
View FizzBuzz.hs
-- FizzBuzz in Haskell | |
fizzbuzz :: Int -> String | |
fizzbuzz n = if fb /= "" | |
then fb | |
else show n | |
where fb = fizz n ++ buzz n | |
fizz:: Int -> String |
View FizzBuzz.scala
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 |
View week_number.py
import datetime | |
year,week_num,day_of_the_week = datetime.datetime.now().isocalendar() | |
print year,week_num,day_of_the_week |
View sed_log4j.sh
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