Skip to content

Instantly share code, notes, and snippets.

View srajasimman's full-sized avatar
👨‍💻
focus mode

Rajasimman S srajasimman

👨‍💻
focus mode
View GitHub Profile
#!/bin/bash
# Generate filename with timestamp
filename="UsageAcct$(date +%Y%m%d%H%M).csv"
# Create CSV header
echo "AccountID,UsageDate,DataUsageMB,Status" > "$filename"
# Generate 10MB of CSV data (approximately)
for i in {1..5000}; do
@srajasimman
srajasimman / README.md
Created April 18, 2025 16:52
Complete CI/CD pipeline for a Node.js Express.js application

This CI/CD pipeline includes all the essential steps for a Node.js Express.js application:

  1. Checkout Code & Setup: The pipeline starts by checking out the code and installing dependencies.
  2. Quality Checks (run in parallel):
  • Code linting to enforce coding standards
  • Unit tests to verify functionality
  • Security scanning for vulnerabilities
  1. Build Process:
  • If initial checks pass, the application is built
  • Integration tests are run against the built application
@srajasimman
srajasimman / Readme.md
Created April 9, 2025 17:29
Enterprise DevOps CI/CD Pipeline
flowchart TD
    A[Developer Push Code] --> B[Git Repository]
    B --> C[CI Pipeline]
    
    subgraph CI Pipeline
        C1[Code Linting]
        C2[Unit Tests]
        C3[SAST - CodeQL/SonarQube]
        C4[Build Docker Image]
@srajasimman
srajasimman / ssl_generator.md
Last active April 4, 2025 04:56
Self-Signed SSL Certificate Generator

Self-Signed SSL Certificate Generator

This CLI tool uses Python's cryptography library to generate self-signed SSL certificates. Here's how to use it:

Installation Requirements

pip install cryptography
@srajasimman
srajasimman / ai-instructions.md
Last active March 6, 2025 21:29
"Godlike" prompt designed to supercharge a Terraform and GitHub Actions AI assistant.

You are an omniscient, expert-level AI assistant specializing in Terraform and GitHub Actions, built to provide godlike precision, clarity, and creativity in managing infrastructure as code (IaC) and CI/CD workflows. Your knowledge encompasses the latest Terraform practices, GitHub Actions capabilities, cloud provider integrations (AWS, Azure, GCP, etc.), and DevOps best practices. You are a master of crafting Terraform configurations, optimizing GitHub Actions workflows, troubleshooting errors, and delivering secure, scalable, and efficient solutions.

Your mission is to:

  • Interpret natural language requests with flawless accuracy, even when vague, and ask clarifying questions if needed.
  • Provide step-by-step, production-ready solutions with code examples (Terraform HCL, YAML for GitHub Actions, etc.) tailored to the user's specific cloud provider, use case, or constraints.
  • Anticipate edge cases, security concerns, and optimization opportunities, offering proactive advice to prevent pitfalls.
  • Explain
@srajasimman
srajasimman / README.md
Last active February 20, 2025 12:40
Bash Script to Delete GitHub Actions Runs

Bash Script to Delete GitHub Actions Runs

Steps to Use the CLI Tool

Install Dependencies:

  1. Install the required packages (@octokit/rest, luxon, and yargs):
npm install @octokit/rest luxon yargs
  1. Set Environment Variables: Create a GitHub personal access token with the repo scope from GitHub Developer Settings. Set the token as an environment variable:
@srajasimman
srajasimman / azure_app.tf
Created January 30, 2025 10:05
Azure App Service Terraform
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rg" {
name = "myResourceGroup"
location = "East US"
}
resource "azurerm_app_service_plan" "asp" {
@srajasimman
srajasimman / microbit_morse_code.py
Created December 18, 2024 18:46
morse:bit - A micro:bit Morse code transmitter and receiver.
# morse:bit - A micro:bit Morse code transmitter and receiver.
# This program allows you to send and receive Morse code messages using the micro:bit.
# It uses the radio to send and receive messages, and the display to show the Morse code
# as it's being entered and the translated message.
# The MIT License (MIT)
# Copyright (c) 2023 Rajasimman
from microbit import *
@srajasimman
srajasimman / microbit_mimic_parrot.py
Created December 17, 2024 10:33
Mimic - the micro:bit parrot
# mi:mic (C) 2020 Micro:bit Educational Foundation
# MIT https://spdx.org/licenses/MIT.html
# Original Author D.J.Whale. Updated to latest API by J Austin
# Sonic function written by D.J.Whale in 2017
from microbit import *
import music
MOUTH_CLOSED = Image("09090:00000:00000:99999:00000")
MOUTH_OPENED = Image("09090:00000:09990:90009:09990")
@srajasimman
srajasimman / check_eks_addon_upgrades.sh
Last active November 12, 2024 19:06
Check if EKS addons are compatible with the target EKS version
#!/bin/bash
# Author: Rajasimman S <github.com/srajasimman>
# Description: Script to check if EKS addons are compatible with the target EKS version
# Usage: ./check_eks_addon_upgrades.sh <cluster-name> <target-eks-version>
# The script takes the EKS cluster name and target EKS version as an argument.
# It lists all installed addons using aws eks list-addons.
# For each addon, it retrieves the current version.
# It checks for compatible versions of the addon for EKS 1.29 using aws eks describe-addon-versions.