Skip to content

Instantly share code, notes, and snippets.

View edtshuma's full-sized avatar

Ed Tshuma edtshuma

View GitHub Profile
@edtshuma
edtshuma / workspaces_ec2_s3_deploy.tf
Created September 10, 2022 11:04 — forked from si3mshady/workspaces_ec2_s3_deploy.tf
Terraform workspaces and variables practice - deploy ec2 and s3
terraform {
backend "s3" {
bucket = "elliott-arnold-dev-bucket"
region = "us-east-1"
key= "tfstate"
}
}
@edtshuma
edtshuma / ssh-password.md
Created October 17, 2022 06:37 — forked from cmbaughman/ssh-password.md
SSH Passwords

How to set up passwordless ssh,scp, and rsync

Setup

  1. Install the application sshpass:
sudo apt install sshpass
  1. Make sure to set in your ~/.ssh/config file the following options to prevent ssh from using your pubkey:
@edtshuma
edtshuma / config.tf
Created April 8, 2023 16:49 — forked from kerr-bighealth/config.tf
iam-user module
terraform {
required_version = ">=0.12, <0.13"
}
@edtshuma
edtshuma / http_requests.py
Created May 22, 2023 06:32 — forked from bpgould/http_requests.py
async python http requests using exponential backoff, jitter, and event logging
"""
This module provides functionality for making HTTP requests. It leverages the `aiohttp`
library for asynchronous HTTP requests, and the `backoff` library to implement exponential
backoff in case of failed requests.
The module defines a child logger for logging purposes and implements two methods, `on_backoff`
and `on_giveup`, which log information about the retry attempts and when the retry attempts are
given up respectively.
The `http_request` function is the primary function of the module, making an HTTP request with the
@edtshuma
edtshuma / monitor_ec2_instance.py
Created June 9, 2023 12:44 — forked from si3mshady/monitor_ec2_instance.py
Setting Up CloudWatch Alarms with Boto3 to Monitor EC2 Instance Performance
import boto3
# Specify the region where the EC2 instances reside
region = 'us-east-1'
# Specify the tag key and value to filter the EC2 instances
tag_key = 'env'
tag_value = 'prod'
@edtshuma
edtshuma / HOWTO_mailx.sh
Created August 22, 2023 06:42 — forked from ppdeassis/HOWTO_mailx.sh
Setting up mailx to send mail from command line using external server
# ref: https://coderwall.com/p/ez1x2w/send-mail-like-a-boss
# install mailx
yum -y install mailx
# create a directory with a certificate, to send mail using TLS
mkdir ~/.certs
certutil -N -d ~/.cert
# create a user ~/.mailrc, to use custom settings