Skip to content

Instantly share code, notes, and snippets.

View Laxman-SM's full-sized avatar

Laxman Singh Laxman-SM

  • Ex-Phenome, Ex-Intertrust, Ex-Wipro
  • US, Hyderabad (india)
View GitHub Profile
@Laxman-SM
Laxman-SM / measure.sh
Created June 17, 2022 04:43 — forked from njam/measure.sh
Measure bandwidth with tcpstat + gnuplot
# Measure traffic with tcpstat
tcpstat -i em1 -o "%r\t%b\n" -s 30 0.1 > traffic.txt
# Create plot using the below script
gnuplot traffic.script > traffic.png
# Display plot
qlmanage -p 2>/dev/null traffic.png
@Laxman-SM
Laxman-SM / mount-volume.sh
Created June 16, 2022 03:47 — forked from crestonbunch/mount-volume.sh
EC2 Mount EBS Volume
#!/bin/bash
set -e
REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/region)
INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
VOLUME_NAME=$1
VOLUME_DEVICE=$2
VOLUME_ID=$(aws ec2 describe-volumes --filters "Name=tag:Name,Values=${VOLUME_NAME}" --region "${REGION}" | jq -r .Volumes[0].VolumeId)
@Laxman-SM
Laxman-SM / README.md
Created April 1, 2022 19:27 — forked from takemikami/README.md
terraform for mwaa
@Laxman-SM
Laxman-SM / helmify-kustomize
Created April 1, 2022 04:03 — forked from mumoshu/helmify-kustomize
Run `helmify-kustomize build $chart $env` in order to generate a local helm chart at `$chart/`, from kustomize overlay at `${chart}-kustomize/overlays/$env`
#!/usr/bin/env bash
cmd=$1
chart=$2
env=$3
dir=${chart}-kustomize
chart=${chart/.\//}
build() {
#!/usr/bin/env bash
set -e
if eksctl get cluster -f $FILE >/dev/null 2>&1; then
# See https://github.com/weaveworks/eksctl/blob/33ec1ed967c1ad03c985bf18774ea970d85c86f1/site/content/usage/03-cluster-upgrade.md#L41
eksctl update cluster -f $FILE
eksctl utils update-kube-proxy
eksctl utils update-aws-node
eksctl utils update-coredns
@Laxman-SM
Laxman-SM / tmux.md
Created January 5, 2022 20:04 — forked from larribas/tmux.md
Tmux Cheat Sheet

Tmux Cheat Sheet

Sessions

Start a new session tmux || tmux new -s name || :new

Attach to last session tmux a || tmux a -t name

@Laxman-SM
Laxman-SM / credentials
Created December 7, 2021 00:25 — forked from bertrandmartel/credentials
Assume role with MFA for terraform/terragrunt (https://stackoverflow.com/a/66878739/2614364)
[prod]
aws_secret_access_key = redacted
aws_access_key_id = redacted
[tf_temp]
[tf]
credential_process = sh -c 'mfa.sh arn:aws:iam::{account_id}:role/{role} arn:aws:iam::{account_id}:mfa/{mfa_entry} prod 2> $(tty)'
def COLOR_MAP = [
'SUCCESS': 'good',
'FAILURE': 'danger',
]
properties([pipelineTriggers([githubPush()])])
pipeline {
agent any
environment {
//put your environment variables
@Laxman-SM
Laxman-SM / tfonly
Created August 15, 2020 05:39 — forked from immanuelpotter/tfonly
If you only want to perform actions on resources in one terraform file, this will do that for you
#!/bin/bash
COMMAND="$1"
TF_FILE="$2"
usage(){
echo "Usage: $0 (plan|apply|destroy) [tf-filename]"
}
@Laxman-SM
Laxman-SM / cluster.tf
Created August 7, 2020 17:46 — forked from cwoolum/cluster.tf
AKS Cluster with Managed Identity and an ACR
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West US 2"
}
data "azurerm_client_config" "current" {
}
resource "azurerm_kubernetes_cluster" "example" {
name = "example-aks1"