Skip to content

Instantly share code, notes, and snippets.

View 100daysofdevops's full-sized avatar
🎯
Focusing

100daysofdevops

🎯
Focusing
View GitHub Profile
1. Create a Namespace
# Create a namespace named 'devops'
kubectl create ns devops
2. Create a Private Key for the User
# Generate a 2048-bit RSA private key for the user
openssl genrsa -out prashant.key 2048
3. Create a Certificate Signing Request (CSR) for the User
#Installation in mac or in different version https://github.com/k8sgpt-ai/k8sgpt
brew tap k8sgpt-ai/k8sgpt
brew install k8sgpt
# Verify the version
k8sgpt version
#Checking Help
k8sgpt --help
import boto3
s3 = boto3.client('s3')
paginator = s3.get_paginator('list_objects_v2')
page_size = 100
bucket_name = 'your-bucket-name'
prefix = 'your-prefix'
response_iterator = paginator.paginate(
#!/usr/bin/env python3
# Python script to convert EC2 instance from one type to another and read input from csv file with a format instance_id,instance_type
import argparse
import boto3
import sys
import csv
def convert_instance(instance_id, new_instance_type, csv_file=None):
# Create an EC2 client
sn0 fname lname age
1 john cena 40
2 micheal white 35
import csv
filename="test.csv"
with open(filename) as f:
read_csv = csv.reader(f)
for data in read_csv:
print(data)
def sum(num):
sum_val = 0
while num:
sum_val += num % 10
num //= 10
return sum_val
def solution(A):
sum_map = {}
class Stack(object):
def __init__(self):
self.items = []
def push(self,item):
self.items.append(item)
def pop(self):
return self.items.pop()
locals {
max_subnet_length = max(
length(var.private_subnets),
length(var.elasticache_subnets),
length(var.database_subnets),
length(var.redshift_subnets),
)
nat_gateway_count = var.single_nat_gateway ? 1 : var.one_nat_gateway_per_az ? length(var.azs) : local.max_subnet_length
# Use `local.vpc_id` to give a hint to Terraform that subnets should be deleted before secondary CIDR blocks can be free!
resource "aws_route53_record" "sdlc-scm-route53-record" {
count = "${length(var.hostname)}"
name = "${element(var.hostname,count.index )}"
type = "A"
zone_id = "${var.zone_id}"
records = ["${element(var.arecord, count.index)}"]
ttl = "300"
}