Summary of info I got from this post on 2022-09-11
Shell script:
#!/bin/bash
#Variable Declaration - Change These
HOSTED_ZONE_ID="XXXXXXXXXXXX"
NAME="example.com."| #!/usr/bin/python | |
| import smtplib | |
| import os | |
| SMTP_SERVER = os.getenv('SMTP_SERVER', 'localhost') | |
| SMTP_PORT = os.getenv('SMTP_PORT', '25') | |
| SENDER_EMAIL_ADDR = os.getenv('SENDER_EMAIL_ADDR', 'no-reply@example.tld') | |
| SENDER_NAME = os.getenv('SENDER_NAME', 'NO-REPLY') | |
| RECEIVER_EMAIL_ADDR = os.getenv('RECEIVER_EMAIL_ADDR', 'root@localhost') | |
| RECEIVER_NAME = os.getenv('RECEIVER_NAME', 'Root') |
Summary of info I got from this post on 2022-09-11
Shell script:
#!/bin/bash
#Variable Declaration - Change These
HOSTED_ZONE_ID="XXXXXXXXXXXX"
NAME="example.com."The function is for a SAM template that looks something like the following:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Example Template for AWS HTTP API to Python Lambda Function
Parameters:
StageNameParameter:
Type: StringAssuming you have LOG_GROUP_NAME and STREAM_NAME as environment variables, you can run the following:
aws logs get-log-events --log-group-name "$LOG_GROUP_NAME" --log-stream-name "$STREAM_NAME" | yq -o=json | jq '.events[] | .timestamp, .message' > stream.logThe log entries with timestamp and message will now be in the file stream.log
Another way to format the output (prevent splitting lines for timestamp and message fields):
Command:
pip3 install git+https://github.com/aws/aws-cli.git@v2These steps demonstrate how to get the JavaScript library for AWS Cognito integration when using simple HTML and JavaScript - no frameworks like ReactJS, or other Node type projects.
Even though you may not want to use a framework, you still require a relatively new stable version of nodejs
My approach:
| #!/bin/bash | |
| for node in node1 node2 node3 ;do | |
| multipass exec $node -- sudo DEBIAN_FRONTEND=noninteractive apt update | |
| multipass exec $node -- sudo DEBIAN_FRONTEND=noninteractive apt install -yq software-properties-common | |
| multipass exec $node -- sudo DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:gluster/glusterfs-7 | |
| multipass exec $node -- sudo DEBIAN_FRONTEND=noninteractive apt update | |
| multipass exec $node -- sudo DEBIAN_FRONTEND=noninteractive apt install -y glusterfs-client | |
| multipass exec $node -- sudo mkdir -p /opt/local-path-provisioner | |
| multipass exec $node -- sudo chmod 777 /opt/local-path-provisioner |
| #!/bin/sh | |
| HF=/etc/hosts | |
| MP=/glusterfs-data | |
| echo "Updating /etc/hosts" | |
| IP1=$(multipass info glusterfs1 | grep IPv4 | awk '{print $2}') | |
| IP2=$(multipass info glusterfs2 | grep IPv4 | awk '{print $2}') | |
| sudo sed -i '/glusterfs1/d' $HF | |
| sudo sed -i '/glusterfs2/d' $HF |
| import java.net.InetAddress; | |
| import java.net.UnknownHostException; | |
| void displayStuff(String whichHost, InetAddress inetAddress) { | |
| print("--------------------------" + "\n"); | |
| print("Which Host:" + whichHost + "\n"); | |
| print("Canonical Host Name:" + inetAddress.getCanonicalHostName() + "\n"); | |
| print("Host Name:" + inetAddress.getHostName() + "\n"); | |
| print("Host Address:" + inetAddress.getHostAddress() + "\n"); | |
| } |