Skip to content

Instantly share code, notes, and snippets.

View elijahchancey's full-sized avatar

Elijah Chancey elijahchancey

View GitHub Profile
@elijahchancey
elijahchancey / gist:98a40f5b033ac3b61f7c
Last active November 25, 2016 06:26
Relaying mail through AWS SES | Chef + Postfix Cookbook + Sasl
HOWTO: Use the Postfix Chef Cookbook to have your EC2 server relay all mail through AWS SES.
node.default['postfix']['mailtype'] = "master"
node.override['postfix']['main']['relayhost'] = "[email-smtp.us-west-2.amazonaws.com]:25"
node.default['postfix']['main']['smtp_sasl_auth_enable'] = "yes"
node.default['postfix']['main']['smtp_sasl_password_maps'] = "hash:/etc/postfix/sasl_passwd"
node.default['postfix']['main']['smtp_sasl_security_options'] = "noanonymous"
node.default['postfix']['main']['smtpd_use_tls'] = "yes"
node.default['postfix']['main']['mynetworks'] = "42.42.42.0/24, 127.0.0.1/32"
node.default['postfix']['main']['mydomain'] = "solongandthanksforallthefi.sh"

Keybase proof

I hereby claim:

  • I am elijahchancey on github.
  • I am elijahchancey (https://keybase.io/elijahchancey) on keybase.
  • I have a public key ASCxZtXYSWZCY4KlQGHj4OF3SA9ZJkoOoQBsvIsK5BKfeAo

To claim this, I am signing this object:

@elijahchancey
elijahchancey / elb-logs-sum.sh
Created May 26, 2021 20:21
Script to counts the number of requests, received bytes and sent bytes from an ELB log file.
#!/bin/bash
# This script parses a single ELB log file and counts the number of requests, received bytes and sent bytes.
# It expects this log format: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html
# 1. aws s3 sync s3://elb-log-bucket/environment-name/ .
# 2. cd into the directory that represents a day of logs
# 3. gunzip *.log
# 4. cat *.log > combined.log
# 5. ./elb-logs-sum.sh