Skip to content

Instantly share code, notes, and snippets.

@akhoury6
akhoury6 / backup_script.rb
Last active March 25, 2024 21:44
Backup Script to RSync a local workstation to multiple locations. Pre-Configured for MacOS and Linux.
#!/usr/bin/env ruby
##################################################
############### Full Backup Script ###############
##################################################
## (C)opyright 2024 Andrew Khoury
## Email: akhoury@live.com
######
## README:
## This is easily configurable script that uses
@akhoury6
akhoury6 / do-ddns.sh
Created March 1, 2024 20:12
DigitalOcean DDNS Script
#!/usr/bin/env bash
##########################
## This script dynamically updates a DNS record on DigitalOcean DNS
## Make sure that the 'jq' utility is installed before using this script
## https://jqlang.github.io/jq/
##
## LICENSE: GPLv3
##
## (c) 2020 Andrew Khoury
@akhoury6
akhoury6 / Terraform BlueGreen Deployments.md
Last active April 20, 2022 18:58
Terraform Blue Green Deployments

Do we have a recommended blue/green deployment/design pattern on pTFE?

We do enable blue/green deployments, but there isn't a "one-size-fits-all" method to perform them; instead, we have a three-step process to come up with design patterns for any application. What we will do here is create a state machine for the deployments, with Terraform being the tool to move between states.

First, we break the blue-green deployment down into desired states. Second, we determine what mechanisms are needed to make the changes between the states. Third, we put it all into a single flow using a combination of terraform functions, cloud components, and/or scripts as needed.

So let's walk through a simple application deployment: a 2-tier web application, with a single instance, being routed to via a Load Balancer. Note that the site's DNS name is pointing to the Load Balancer.

@akhoury6
akhoury6 / mfatoken.applescript
Created May 19, 2016 15:23
Generate an MFA token with an OS X Keyboard Shortcut
-- Settings
set mfaSecret to "<token>"
-- Install oath-toolkit if not available
try
do shell script "which /usr/local/bin/oathtool"
on error
display dialog "This script needs to install oath-toolkit. Please ensure that brew is installed, then hit OK to continue."
do shell script "brew install oath-toolkit"
end try