Skip to content

Instantly share code, notes, and snippets.

View ashishjullia's full-sized avatar
💻
Exploring

Ashish Jullia ashishjullia

💻
Exploring
View GitHub Profile
@ashishjullia
ashishjullia / aws-mfa-access.sh
Last active September 21, 2024 09:01 — forked from geekgunda/aws-mfa-access.sh
aws-cli MFA access via assume role
#!/bin/bash
if [ "$1" == "" ]; then
echo "Usage: $(basename "$0") <MFA-TOKEN>"
exit 1
fi
session_duration=129600 # 36 hours
mfa_device_code=$(aws iam list-mfa-devices | jq -r .MFADevices[0].SerialNumber)
if [ -z "$mfa_device_code" ]; then
apiVersion: 2019-12-01
location: <your_location> # Replace with your Azure region, e.g., eastus
name: <your_container_group_name> # Replace with your container group name
properties:
containers:
- name: <>
properties:
image: <>
resources:
requests:
#!/bin/bash
# Define variables
REPO_URL="[email protected]:<org>/<repo-name>.git"
PRIVATE_KEY_FILE="<>"
HOST_REPO_PATH="./<local-dir-name>"
DOCKER_IMAGE="ubuntu"
GIT_USER_NAME="<>"
GIT_USER_EMAIL="<>"
@ashishjullia
ashishjullia / command.sh
Created November 7, 2023 15:20
auto_set_temporary_credentials_after_assuming_a_new_role_using_aws_cli
$ export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" \
$(aws sts assume-role \
--role-arn arn:aws:iam::<aws-account-id>:role/<role-name> \
--role-session-name <Test-Session-Name> \
--query "Credentials.[AccessKeyId,SecretAccessKey,SessionToken]" \
--output text))
@ashishjullia
ashishjullia / send-message-to-discord.sh
Created October 28, 2023 19:58
Shell script to send message to a discord channel using discord channel webhook
#!/bin/bash
# Replace with your Discord webhook URL
DISCORD_WEBHOOK_URL="<DISCORD_WEBHOOK_URL>"
# Fixed values
USERNAME="qbitorrent-pi4"
# AVATAR_URL="https://example.com/avatar.png"
MENTION_USER_ID="<MENTION_USER_ID>"
@ashishjullia
ashishjullia / use-nvm.yml
Created October 28, 2023 06:09
Use nvm in github actions direct install
- run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
cat ~/.bashrc
source $HOME/.nvm/nvm.sh
nvm install && nvm use
npm ci
#working-directory: './<if-specific-sub-dir>'
provider "aws" {
region = var.aws_region
}
variable "aws_region" {
description = "The AWS region to deploy resources in."
default = "us-west-2"
}
variable "vpc_a_id" {
@ashishjullia
ashishjullia / script.sh
Last active September 25, 2023 20:05
docker-build-and-ecs-task-sript
#!/bin/bash
# Set your AWS region and ECR repository name
AWS_REGION="<region>"
ECR_REPOSITORY="<repo-name>"
MYSQL_HOST="dummy-value"
MYSQL_PORT="dummy-value"
MYSQL_USER="dummy-value"
MYSQL_DATABASE="dummy-value"
MYSQL_PASSWORD="dummy-value"
@ashishjullia
ashishjullia / Dockerfile
Created September 23, 2023 11:13
nodejs-dockerfile
# Specify the base image
FROM node:16-alpine
ARG MYSQL_HOST \
MYSQL_PORT
ENV MYSQL_HOST=$MYSQL_HOST \
MYSQL_PORT=$MYSQL_PORT
# Set the working directory in the container

Certainly! Let's dive into the details for MessageDeduplicationId, MessageGroupId, and MessageId in the context of Amazon SQS:

  1. MessageId:

    • Purpose: This is a unique identifier for each message that is generated by SQS once a message is successfully added to the queue.
    • Usage:
      • Standard Queue: Every message that is sent to a standard queue gets a unique MessageId.
      • FIFO Queue: Similar to standard queues, every message that's sent to a FIFO queue gets a unique MessageId.
    • Set By: Amazon SQS (not user-settable).
  2. MessageDeduplicationId: