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 / federated-role-trust-policy-eks-console-access.json
Created July 26, 2023 02:09
federated-role-trust-policy-eks-console-access
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::<account-number>:user/<username>"
]
},
@ashishjullia
ashishjullia / eks-kubernetes-resources-permissions.json
Last active July 26, 2023 02:12
eks-kubernetes-resources-permissions
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"eks:AccessKubernetesApi",
"eks:DescribeCluster",
"eks:ListClusters",
@ashishjullia
ashishjullia / Convert_a_private_key_to_a_single_line_using_sed_command_line_tool.md
Last active August 26, 2023 21:46
Convert a private key to a single line using sed command line tool.
sed ':a;N;$!ba;s/\n/\\n/g' certificate_file_name_or_key_file_name | sed 's/^[ \t]*//;s/[ \t]*$//'

Let's break it down step by step.

1. sed ':a;N;$!ba;s/\n/\\n/g' certificate_file_name_or_key_file_name:

  • :a: Define a label called 'a'.
  • N: Append the next line of input to the current pattern space (with an embedded newline).
@ashishjullia
ashishjullia / visual-studio-code-remove-blank-lines-from-code.md
Last active September 1, 2023 17:15
visual-studio-code-remove-blank-lines-from-code

You can use regular expressions.

  1. Open your code in Visual Studio Code
  2. From Edit Menu, select Replace or use a short cut key (command + Option + F on Mac or Ctrl + H on Windows)
  3. In the find box type ^(\s)*$\n
  4. Leave the replace box empty
  5. Make sure the 'Use Regular Expression' is selected
  6. Select the 'Replace All' button

image

$ dig screego.ashishjullia.com +short
172.67.199.112
104.21.76.188
$ nc -vzw 1 172.64.80.1 3478
172.64.80.1 3478 (stun): Connection timed out
$ nc -vzw 1 104.21.76.188 3478
104.21.76.188 3478 (stun): Connection timed out
$ nc -vzw 1 172.64.80.1 80
172.64.80.1 80 (http) open

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:

@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
@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"
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 / 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>'