This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl x509 -noout -in <>.crt -dates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The output of both should match | |
openssl x509 -noout -modulus -in <>.crt | openssl md5 | |
openssl rsa -noout -modulus -in <>.key | openssl md5 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '{sub(/\r$/,""); printf "%s\\n", $0}' filename | |
This command reads a file line by line and converts it into a single, long string, using the literal characters \n as a separator. | |
It does two main things for every line it reads: | |
It Cleans: The sub(/\r$/,"") part finds and removes the invisible Windows "carriage return" character (\r) from the end of the line. If a line is already clean, this part does nothing. | |
It Joins: The printf "%s\\n", $0 part prints the cleaned line, followed immediately by the text \n. Because printf doesn't add a line break, all the lines get joined together into one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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="<>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" { |
NewerOlder