Skip to content

Instantly share code, notes, and snippets.

View LearningJournal's full-sized avatar
🎯
Focusing

Prashant Kumar Pandey LearningJournal

🎯
Focusing
View GitHub Profile
ssh-keygen -t rsa -f ~/.ssh/tanya-gcp-ssh-key -C tanya
<p>
Let me take you to <a href="https://www.google.com">Google</a>.
<p>
import java.util.Scanner
//load a text file from current directory
val flistRDD = sc.textFile("flist.txt")
//Check number of defaults partitions
flistRDD.getNumPartitions
//Reload with five partitions
val flistRDD = sc.textFile("flist.txt", 5)
//Count the number of elements in each partition
flistRDD.foreachPartition(
p => println("Items in partition-" + p.count(y => true))
)
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm
yum localinstall jdk-8u121-linux-x64.rpm
def doubler(i: Int) = { i * 2 }
(i: Int) => { i * 2 }
#!/bin/bash
SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled"
java $SBT_OPTS -jar `dirname $0`/sbt-launch.jar "$@"
sudo yum -y install java-1.8.0-openjdk
@LearningJournal
LearningJournal / KT01.sh
Last active January 8, 2022 15:21
Kafka Tutorial Code Samples for Learning Journal Website
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
spark.range(100).repartition(1).write.mode("overwrite").csv("/tmp/test-1")