Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
Working from home

Hemanth B hemanth22

😀
Working from home
View GitHub Profile
@hemanth22
hemanth22 / .gitconfig
Created Oct 19, 2020 — forked from rab/.gitconfig
A good starting point for ~/.gitconfig
View .gitconfig
# -*- Conf -*-
[color]
branch = auto
diff = auto
status = auto
showbranch = auto
ui = true
# color.branch
# A boolean to enable/disable color in the output of git-branch(1). May be set to always, false (or
@hemanth22
hemanth22 / subjenkins.md
Created Oct 11, 2020
subdirectory jenkins pipeline
View subjenkins.md

node { stage("Verification"){ dir("${env.WORKSPACE}"){ sh "pwd" } } }

View provider.tf
provider "aws" {
region = "${var.region}"
profile = "${var.profile}"
}
View outputs.tf
output "url-jenkins" {
value = "http://${aws_instance.jenkins-ci.0.public_ip}:8080"
}
output "url-gitLab" {
value = "http://${aws_instance.gitLab.0.public_ip}"
}
View variables.tf
variable "profile" {
default = "terraform_iam_user"
}
variable "region" {
default = "ap-southeast-1"
}
variable "instance" {
default = "t2.nano"
View resources.tf
resource "aws_key_pair" "demo_key" {
key_name = "MyKeyPair"
public_key = "${file(var.public_key)}"
}
/*
resource "aws_vpc" "my-vpc" {
cidr_block = "10.0.0.0/16" # Defines overall VPC address space
enable_dns_hostnames = true # Enable DNS hostnames for this VPC
enable_dns_support = true # Enable DNS resolving support for this VPC
@hemanth22
hemanth22 / ipv4.md
Last active Oct 4, 2020
ipv4 subnet mask cheatsheet
View ipv4.md

IPv4 Subnet Mask Cheat Sheet

Subnet Mask Addresses Hosts Netmask Amount of a Class C
/30 4 2 255.255.255.252 1/64
/29 8 6 255.255.255.248 1/32
/28 16 14 255.255.255.240 1/16
/27 32 30 255.255.255.224 1/8
/26 64 62 255.255.255.192 1/4
@hemanth22
hemanth22 / log_rotate.sh
Created Oct 3, 2020 — forked from jkanclerz/log_rotate.sh
Simple bash log rotate script
View log_rotate.sh
#!/bin/bash
checkSizeOver() {
typeset -i LFSB LFSM LOG_SIZE=10
LF=$1
LOG_SIZE=$2
LFSB=$(stat -c "%s" $LF)
# This is bytes - turn into MB, base 2}
LFSM=${LFSB}/1048576
# This is bytes - turn into MB, base 2
if [ $LFSM -gt $LOG_SIZE ]
View cluster.tf
provider "aws" {
region = "ap-south-1"
profile = "EKS"
}
resource "aws_iam_role" "eks_cluster" {
name = "ViRocluster"
assume_role_policy = <<POLICY
@hemanth22
hemanth22 / docker.tf
Last active Aug 16, 2020 — forked from darkn3rd/docker.tf
Terraform Docker Solution
View docker.tf
provider "docker" {}
variable wordpress_port {
default = "8080"
}
resource "docker_volume" "db_data" {}
resource "docker_network" "wordpress_net" {
name = "wordpress_net"
You can’t perform that action at this time.