Skip to content

Instantly share code, notes, and snippets.

@qafro1
qafro1 / snippet.tf
Created November 28, 2019 13:30 — forked from kainlite/snippet.tf
lambda terraform
# Set the region where the lambda function will be created
variable "aws_region" {
default = "us-east-1"
}
# Assign the region to the provider in this case AWS
provider "aws" {
region = "${var.aws_region}"
}
@TomLous
TomLous / BasicSparkJob.scala
Last active April 5, 2021 19:41
Basic Spark Job for Medium Article
import org.apache.spark.sql._
import org.apache.spark.sql.functions._
import xyz.graphiq.model._
object BasicSparkJob extends App {
val spark: SparkSession = SparkSession
.builder()
.config(
new SparkConf().setIfMissing("master", "local[*]")
@Thakurvaibhav
Thakurvaibhav / es-client.yml
Last active September 28, 2019 19:47
Elasticsearch Client Node Deployment and External Service
apiVersion: v1
kind: Namespace
metadata:
name: elasticsearch
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: es-client
namespace: elasticsearch
@mlapida
mlapida / FlowLogs-to-S3-Lambda.py
Last active April 15, 2021 05:39
A Lambda Function for streaming and translating flow logs on the fly. This example was used for HP ArcSight. A full writeup can be found on my site http://mlapida.com/thoughts/exporting-cloudwatch-logs-to-s3-lambda
import boto3
import logging
import json
import gzip
import urllib
import time
from StringIO import StringIO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
@solarce
solarce / ec2.tf
Last active February 4, 2022 04:04
terraform.io example template for ec2 instance with tags
# The various ${var.foo} come from variables.tf
# Specify the provider and access details
provider "aws" {
region = "${var.aws_region}"
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
}
package ca.uwo.csd.cs2212.USERNAME;
public class BankAccount {
private double balance;
public BankAccount(double balance) {
this.balance = balance;
}
@dreikanter
dreikanter / gzip-demo.py
Created May 30, 2012 10:01
Create tar.gz archive with Python, unpack files back and check the result
# Python gzip demo: create and unpack archive
import os
import random
import string
import glob
import tarfile
import shutil
import filecmp