Friday, December 13, 2019

Pre-1917 Fasting in the USA

I stumbled on this blog post and to help me find it again thought I would share. https://www.liturgicalartsjournal.com/2019/12/the-traditional-pre-1917-advent-fast-in.html

In short:

To sum up, before the changes of 1917, the Fridays in Advent were kept as days of abstinence and fast—there was only one full meal allowed, and no meat could be eaten at all during the whole day. 

And:

  • Only one full meal allowed, to be taken at noon or later
  • An additional collation of 8 ounces is also allowed: in the evening if the full meal is at noon, or at noon if the main meal is in the evening
  • General custom allows 2 ounces of bread (without butter) in the morning,  with a cup of warm liquid (coffee or tea).

Wednesday, October 16, 2019

Run Bitnami Wordpress Behind Load Balancer


This is mostly a note for myself after finally figuring out how to do this. The rest of the internet looks like they'd rather terminate the SSL on their own instances.









define('WP_SITEURL', 'https://xyz.com/');
define('WP_HOME', 'https://xyz.com/');
if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){

$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = 443;
}




Then wordpress and the plugins and forcing everybody to use https all works like it's supposed to.


Tuesday, January 29, 2019

Figure Out which EC2 Instance failed ELB Health Check on AWS


I have been using AWS for years and finally got around to wanting the ability to figure out exactly which EC2 instance failed the health check when the Alarm I had setup on the Load Balancer went off. The interwebs were lacking in a clear and easy to follow example on how to make this happen so I thought I might take a few minutes to explain how to set this up.




My preferred setup is to get emailed with the information about which instance(s) were unhealthy right away so I can troubleshoot the issue as soon as possible.  Kudos to this StackOverflow article for pointing me in the right direction.




Step 1: Create a new Topic to get triggered Alarm on your Load Balancer that triggers off Health Checks





Go to the monitoring tab on the ELB that you want to troubleshoot. There's an option to "Create Alarm" on the right hand side. Select that, create a topic if you don't have one already that gets notified anytime the Unhealth Hosts threshold is greater than zero.






ELB create Alarm and Topic









Step 2: Create a IAM role with the Permissions





The lamda function is going to need permissions to read the state of the ELB instances and send an email using SES. The only part of this which is a little bit tricky is that adding the second type of permissions requires finding the additional link.




















Step 3: Create the Lambda













Step 4: Add the Code & Test







import boto3
 import json
 import datetime
 from time import mktime
 class MyEncoder(json.JSONEncoder):
     def default(self, obj):
         if isinstance(obj, datetime.datetime):
             return int(mktime(obj.timetuple()))
         return json.JSONEncoder.default(self, obj)
 def lambda_handler(event, context):
     elb = boto3.client('elb')
     client = boto3.client('ses') 
     response = elb.describe_instance_health(LoadBalancerName='') 
     client.send_email(     Source='fromemail',     
           Destination={'ToAddresses': [         'samplemeail',      ] }, 
           Message={     'Subject': {         
                            'Data': 'AWS Notify MeEvent'},
                          'Body': { 'Text': { 'Data': json.dumps(response, cls = MyEncoder)}}} ) 
     return json.dumps(response, cls = MyEncoder)