Skip to content

Instantly share code, notes, and snippets.

View gist:63f88360ed2cf5cc90b6af3db4cc245e
Question 1
scala> val line = "Hello, world"
line: String = Hello, world
scala> sc.parallelize(line).collect
res22: Array[Char] = Array(H, e, l, l, o, ,, , w, o, r, l,
Question 2
View packer.json
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"aws_region": "us-east-1",
"version": "1.7.1",
"revision": "0",
"instance_type": "t2.micro",
"image_name" : "{{ env `IMAGE_NAME` }}"
},
View packer.js
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"aws_region": "us-east-1",
"version": "1.7.1",
"revision": "0",
"instance_type": "t2.micro",
"image_name" : "{{ env `IMAGE_NAME` }}"
},
View build.sh
#!/usr/bin/env bash
echo "*** Deployment started"
usage() {
echo "(AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to be set"
exit 1
}
if [ ${#} -ne 2 ]; then
usage
fi
View terraform.sh
cd terraform
ssh-keygen -f mykey
terraform init
terraform plan\
-out out.terraform
terraform apply out.terraform
rm out.terraform KEY
View terraform
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = "name"
values = ["${var.image_name}"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
View vars
variable "AWS_ACCESS_KEY" {}
variable "AWS_SECRET_KEY" {}
variable "region" {
default="us-east-1"
}
variable "image_name" {
default = "ami_image_name"
}
View packer
#!/usr/bin/env bash
set -e
usage() {
echo "environment variable AWS_PROFILE or access keys (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to be set"
exit 1
}
if [ ${#} -ne 2 ]; then
View json
{
"voyageLines": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[
View password
package com.knoldus.user.annotation;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;