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 / 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 / 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))
#!/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="<>"
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:
@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