Skip to content

Instantly share code, notes, and snippets.

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

UniCode deepak7093

💭
Building...
View GitHub Profile
@deepak7093
deepak7093 / cidrsubnet.txt
Created June 5, 2019 18:15
Terraform function cidrsubnet
> cidrsubnet("172.16.0.0/12", 4, 2)
172.18.0.0/16
> cidrsubnet("10.1.2.0/24", 4, 15)
10.1.2.240/28
> cidrsubnet("fd00:fd12:3456:7890::/56", 16, 162)
fd00:fd12:3456:7800:a200::/72
@deepak7093
deepak7093 / terraform-data-source.tf
Created June 5, 2019 18:13
Terraform Data Source
# Data source for state file
data "terraform_remote_state" "state" {
backend = "local"
}
# Data source for google subnetwork
data "google_compute_network" "subnetworks" {
project = "${var.project}"
name = "${var.name}"
@deepak7093
deepak7093 / awless-non-matching-tag.sh
Created May 20, 2019 04:05
Awless find instances with non matching tag
1) Download and install awless :
# https://github.com/wallix/awless/releases/download/v0.1.11/awless-windows-amd64.zip
2) Configure aws cli
#aws configure
you need to add AWS_ACCESS_KEY and AWS_SECRET_KEY
@deepak7093
deepak7093 / yaml-bash.sh
Created May 19, 2019 15:52
YAML in place replace in bash
#!/usr/bin/env bash
## Print usage
usage () {
echo "Usage: <script_name> <yaml_file_path> <doc_number> <key> <value>"
echo """
Description:
script_name: Name of you scirpt file
yaml_file_path: YAML file location path
doc_number: Number of doc in multipline doc file. Deafult is 0
@deepak7093
deepak7093 / gcr-pull-push-images.sh
Created May 19, 2019 15:50
Docker image pull and push to Google Container Registry
#!/usr/bin/env bash
## Print usage
usage () {
echo "Usage: <script_name> <project_id> <src_gcr_url> <src_image_name_tag> <dest_gcr_url> <dest_image_name_tag>"
echo """
Description:
project_id: Project ID for GCR repo
src_gcr_url: Source GCR URL e.g gcr.io, asia.gcr.io
src_image_name_tag: Source image name and tag to pull e.g python:2.7.0
@deepak7093
deepak7093 / arangodb-agent.conf
Created August 14, 2018 13:52
Arangodb 3 agent configuration file
# ArangoDB configuration file
#
# Documentation:
# https://docs.arangodb.com/latest/Manual/Administration/Configuration/
#
[database]
directory = /var/lib/arangodb3
# maximal-journal-size = 33554432
@deepak7093
deepak7093 / arangodb-coordinator.conf
Created August 14, 2018 13:50
Arangodb 3 Coordinator configuration file
# ArangoDB configuration file
#
# Documentation:
# https://docs.arangodb.com/latest/Manual/Administration/Configuration/
#https://gist.github.com/normanuber/9472203fea5a6254db994e70e20b02d0
[database]
directory = /var/lib/arangodb3
# maximal-journal-size = 33554432
@deepak7093
deepak7093 / arangodb-primary.conf
Created August 14, 2018 13:48
Arangodb 3 primary node configuration file
# ArangoDB configuration file
#
# Documentation:
# https://docs.arangodb.com/latest/Manual/Administration/Configuration/
#
[database]
directory = /var/lib/arangodb3
# maximal-journal-size = 33554432
@deepak7093
deepak7093 / s3_sync.ps1
Created June 28, 2018 13:20
PowerShellScript to sync local file to AWS S3 bucket
Import-Module AWSPowerShell
Set-ExecutionPolicy RemoteSigned
Initialize-AWSDefaults
$config=New-Object Amazon.S3.AmazonS3Config
$config.RegionEndpoint=[Amazon.RegionEndpoint]::"ap-southeast-1"
$config.ServiceURL = "https://ap-southeast-1.amazonaws.com/"
$BucketName = ""
$Now = Get-Date
@deepak7093
deepak7093 / Dockerfile NVM
Created April 20, 2018 09:10
Docker file with ubuntu 16.04 + nvm
FROM ubuntu:16.04
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
&& apt-get install -y curl git python make g++ \
&& apt-get -y autoclean