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 | |
set -x | |
# Script to send email via AWS SES using SigV4 authentication and curl | |
# Usage: ./send_ses_email.sh [from_email] [to_email] [subject] [message] | |
# Check if required parameters are provided | |
if [ "$#" -lt 4 ]; then | |
echo "Usage: $0 from_email to_email subject message" | |
echo "Example: $0 [email protected] [email protected] \"Test Subject\" \"This is a test message\"" | |
exit 1 |
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 | |
# | |
# Script to send emails via AWS SES SMTP endpoint using curl | |
# Usage: ./send-ses-email.sh -f [email protected] -t [email protected] -s "Subject" -b "Body text" [-a attachment.pdf] | |
# Default AWS SES SMTP settings | |
AWS_REGION="us-east-1" | |
SES_SMTP_HOST="email-smtp.us-east-1.amazonaws.com" | |
SES_SMTP_PORT="587" | |
SES_SMTP_USERNAME="" |
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
import json | |
import base64 | |
import boto3 | |
import os | |
tools = [ | |
{ | |
"toolSpec": { | |
"name": "analysis_product_review", | |
"description": "Analysis the product reviews, determine its category, sentiment.", |
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
sudo yum install -y docker | |
sudo service docker start | |
sudo usermod -a -G docker ec2-user | |
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
docker-compose version |
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
# Amazon Linux 2023 | |
# pgsql 15 | |
sudo yum install readline-devel lz4-devel postgresql15-static postgresql15-server-devel -y | |
sudo yum groupinstall "Development Tools" -y | |
wget --no-check-certificate 'https://api.pgxn.org/dist/pg_repack/1.4.8/pg_repack-1.4.8.zip' | |
unzip pg_repack-1.4.8.zip | |
cd pg_repack-1.4.8 | |
make |
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
import smtplib, ssl | |
port = 465 # For SSL | |
smtp_server = "smtp.gmail.com" | |
sender_email = "[email protected]" # Enter your address | |
receiver_email = "[email protected]" # Enter receiver address | |
password = input("Type your password and press enter: ") | |
message = """\ | |
Subject: Hi there |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": "s3:*", | |
"Resource": "*" | |
}, | |
{ |
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
import sys | |
from opensearchpy import OpenSearch, helpers | |
host = 'vpc-xxxx-cyz5i7xdfs3dffsdgerwerw.ap-northeast-1.es.amazonaws.com' | |
port = 443 | |
auth = ('admin', 'password?') # For testing only. Don't store credentials in code. | |
# Create the client with SSL/TLS enabled, but hostname verification disabled. | |
client = OpenSearch( |
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
import { Cluster } from "ioredis"; | |
const host = "clustercfg.test.xxxxxx.memorydb.ap-northeast-1.amazonaws.com"; | |
const port = 6379; | |
export const redis = new Cluster([{ host, port }], { | |
dnsLookup: (address, callback) => callback(null, address), | |
redisOptions: { | |
tls: {}, | |
}, |
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
import json | |
import sagemaker | |
import boto3 | |
from sagemaker.huggingface import HuggingFaceModel, get_huggingface_llm_image_uri | |
try: | |
role = sagemaker.get_execution_role() | |
except ValueError: | |
iam = boto3.client('iam') | |
role = iam.get_role(RoleName='sagemaker_execution_role')['Role']['Arn'] |
NewerOlder