Skip to content

Instantly share code, notes, and snippets.

View sathiyarajanm's full-sized avatar

sathiyarajanm

View GitHub Profile
@sathiyarajanm
sathiyarajanm / EstimatePiSparkApp.scala
Created June 14, 2018 14:15 — forked from kevduggan/EstimatePiSparkApp.scala
An example Ansible playbook that validates a Spark cluster (including source for test Spark App)
package com.newsweaver.spark.test
import org.apache.spark.{SparkConf, SparkContext}
/**
* simple Spark app to calculate Pi
*/
object EstimatePiSparkApp {
def main(args: Array[String]) {
@sathiyarajanm
sathiyarajanm / kafka-producer-file.py
Created June 7, 2018 13:37
kafka-producer python from a file
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers=['localhost:9092'])
with open('/home/sathya/Documents/example.txt') as f:
lines = f.readlines()
for line in lines:
producer.send('topic-name',line)
print("done")
@sathiyarajanm
sathiyarajanm / sshuttle.sh
Created November 23, 2017 06:01 — forked from Davor111/sshuttle.sh
How to use sshuttle with .key, .csr or .pem files for authentication
#It's not directly mentioned in the documentation on how to do this, so here you go. This command will tunnel everything including DNS:
sshuttle --dns -vr user@yourserver.com 0/0 --ssh-cmd 'ssh -i /your/key/path.pem'
curl -L https://github.com/docker/machine/releases/download/v0.8.2/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
chmod +x /usr/local/bin/docker-machine
docker-machine version


docker-machine ls
docker-machine create --driver virtualbox default
docker-machine ls
docker-machine env default

Notes while learning Docker

These notes are derived from my efforts in working through The Docker Book: Containerization is the new virtualization written by James Turnbull. I highly recommend getting a copy of Jame's book which is an $8 dollar e-book on Amazon.

The following notes are my own and simply an interpretation of what James has written. Caveat lector.

Ensuring Docker is ready

$ docker info