Skip to content

Instantly share code, notes, and snippets.

View saikatharryc's full-sized avatar
🏠
Helming from home

Saikat Chakrabortty saikatharryc

🏠
Helming from home
View GitHub Profile

Write a terraform module that creates an S3 bucket and a KMS key used to encrypt the contents of the s3 bucket. When running the module, the following inputs are mandatory:

  • bucket-name (used to name the s3 bucket created by this module)
  • region (the aws region in which to create the resources) The module should create by default the following 2 resources:
  1. a KMS key that the bucket will use for AWS-KMS encryption (by default the bucket created by this module must use Server-Side Encryption with AWS KMS-Managed Keys, also known as SSE-KMS); the creation of this KMS key must be triggerable (but enabled by default when running the module without passing the input which disables the creation of the key)
  2. the s3 bucket with the following configuration:

The csvserver assignment

The developer team of the csvserver was working hard to get it ready for production. The team decided to go for a trip before the launch, and has been missing since then. You have been given the responsibility to figure out how to get the csvserver running correctly with the help of the following document. You might need to understand why things are failing and try to fix them, and make it ready for a launch1.

Prerequisites

You don't need to know Docker or Prometheus beforehand to solve this assignment, take a look at the following docs and understand the basics about these tools.

Keybase proof

I hereby claim:

  • I am saikatharryc on github.
  • I am saikatharryc (https://keybase.io/saikatharryc) on keybase.
  • I have a public key ASCnCVmxdxUoJuJUSxoF1q3yXLpmAVVb1xjr-PKA3hULEwo

To claim this, I am signing this object:

apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: "2048-deployment"
namespace: "2048-game"
spec:
selector:
matchLabels:
app: "2048"
replicas: 5
const fs = require('fs');
const path = require('path');
//List all your folders you want to merge
// This will create One single merged JSON file named merged.json inside each folder.
// NOTE: this requires all the file must be having Array. incase not you can handle the cases in line 13 Here.
const folders = [
'/Users/saikatharryc/Documents/testing'
]
const init = (dirz)=> {
@saikatharryc
saikatharryc / delete-evicted-pods-all-namespaces.sh
Created March 2, 2020 02:47 — forked from psxvoid/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
CREATE TABLE "Ingredient" (
"name" TEXT NOT NULL,
PRIMARY KEY ("name" ASC)
);
INSERT INTO "Ingredient" VALUES ('Vodka');
INSERT INTO "Ingredient" VALUES ('Rum');
INSERT INTO "Ingredient" VALUES ('Sherry');
INSERT INTO "Ingredient" VALUES ('Whiskey');
@saikatharryc
saikatharryc / hyperpayPayments.js
Last active June 11, 2020 18:23
Hyperpay integration
const saveCardToHyperPay = data => {
var path = "/v1/registrations";
let cardBrand = Payment.fns.cardType(data.number);
if (cardBrand == "visa" || cardBrand == "master" || cardBrand == "mada") {
var cardData = querystring.stringify({
"authentication.userId": config.HYPERPAY.UserId,
"authentication.password": config.HYPERPAY.Password,
"authentication.entityId": config.HYPERPAY.EntityId,
paymentBrand: cardBrand.toUpperCase(),
"card.number": data.number || "",
@saikatharryc
saikatharryc / happy-new-year-css-only.markdown
Created December 31, 2016 15:37
Happy New Year! -- CSS Only