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
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
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
#!/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
#!/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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"cloudformation:*" | |
], | |
"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
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` | |
MAC_ADDRESS=`curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/network/interfaces/macs/` | |
IPv6_ADDRESS=`curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MAC_ADDRESS}/ipv6s` | |
sudo ip -6 addr add ${IPv6_ADDRESS}/128 dev eth0 |
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 urllib3 | |
import re | |
def lambda_handler(event, context): | |
request = event['Records'][0]['cf']['request'] | |
response = event['Records'][0]['cf']['response'] | |
# Extract token from query string | |
token = None | |
for param in request['querystring'].split('&'): |
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 | |
BUCKET_NAME="sample_bucket" | |
PROFILE="" | |
# Parse arguments | |
while [[ $# -gt 0 ]]; do | |
case $1 in | |
--profile) | |
PROFILE="$2" |
OlderNewer