Skip to content

Instantly share code, notes, and snippets.

View deepak7093's full-sized avatar
💭
Building...

UniCode deepak7093

💭
Building...
View GitHub Profile
@deepak7093
deepak7093 / mantis-arch-docs.md
Last active March 11, 2023 11:11
Mantis Architecture Docs

Mantis Architecture

Introduction

Mantis is the platform built for Dev & Ops for seamless developer experience with simplified end to end operations work such as intergated CICD, Monitoring, Logging, Secuirty and much more.

Architecture

How to guide

User guide

Developer guide

@deepak7093
deepak7093 / aws-cloud-front-invalidatie.py
Created October 2, 2022 06:13
AWS Lambda Cloud Front Invalidation
import json
import boto3
code_pipeline = boto3.client("codepipeline")
cloud_front = boto3.client("cloudfront")
def lambda_handler(event, context):
job_id = event["CodePipeline.job"]["id"]
try:
user_params = json.loads(
@deepak7093
deepak7093 / check_docker_image.sh
Created July 19, 2022 10:37
GKE Image streaming pre-requisistes check
#!/bin/bash
# Limitations of GKE image streaming
# 1. You can't use a Secret to pull container images on GKE versions prior to 1.23.5-gke.1900.
# 2. Container images that use the V2 Image Manifest, schema version 1 are not eligible.
# 3. Container images encrypted with customer-managed encryption keys (CMEK) are not eligible for Image streaming. GKE downloads these images without streaming the data. You can still use CMEK to protect attached persistent disks and custom boot disks in clusters that use Image streaming.
# 4. Container images with empty layers or duplicate layers are not eligible for Image streaming. GKE downloads these images without streaming the data. Check your container image for empty layers or duplicate layers.
# 5. The Artifact Registry repository must be in the same region as your GKE nodes, or in a multi-region that corresponds with the region where your nodes are running. For example:
# If your nodes are in us-east1, Image streaming is available for repositories in the us-east1 r
@deepak7093
deepak7093 / bigquery-copy-datasets.py
Created May 5, 2020 03:37
BigQuery Copy Datasets
from google.cloud import bigquery
client = bigquery.Client()
projectFrom = ''
datasetFrom = ''
projectTo = ''
datasetTo = ''
@deepak7093
deepak7093 / lambda-egde-deploy-guide.md
Last active October 20, 2019 16:19
Lambda Edge Sample Deployment Guide

Deploy Lambda@edge

Before deploy functions to lambda@edge, we have to meet some prerequisites as below:

  1. S3 bucket with public website hosting and set index.html as base path.
  2. Cloudfront distribution to server content for lambda@edge.
  3. Setup webserver on EC2 instance.
  4. Create lambda function.
  5. Setup lambda@edge trigger.
  6. Validation.

Create S3 Bucket with public website hosting

nameserver 175.100.191.221
domain domain.name
{
"version": 3,
"serial": 1,
"lineage": "574453ba-774e-b2f2-3403-8e6c62c6c1b1",
"backend": {
"type": "s3",
"config": {
"access_key": null,
"acl": null,
"assume_role_policy": null,
@deepak7093
deepak7093 / netdata_file_integrity_checker.md
Last active July 29, 2019 17:01
Netdata host file intergrity checker plugin

Netdata host file integrity check with statsd

  1. Check statsd plugin status Statsd is enabled by default, if not enable it inside, /etc/netdata/netdata.conf under [statsd] section. Default port is 8125.

  2. Create config file /etc/netdata/statsd.d/file.conf with below content Run # mkdir -p /etc/netdata/statsd.d/

Run # vi /etc/netdata/statsd.d/file.conf

@deepak7093
deepak7093 / hosts
Created July 29, 2019 12:17
sample hosts file
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2 9930cf889e1f
@deepak7093
deepak7093 / subnets.tf
Created June 5, 2019 18:30
Dynamic subnets creation
resource "google_compute_subnetwork" "subnet" {
count = 2
name = "${var.name}-${count.index}"
project = "${var.project}"
network = local.vpc_network_self_link # https://github.com/terraform-providers/terraform-provider-google/issues/1792
region = "{$var.region}"
description = "This is dynamic n/w"
ip_cidr_range = cidrsubnet(var.base_cidr, 2, "${count.index}")
private_ip_google_access = true
}