Skip to content

Instantly share code, notes, and snippets.

View ar45's full-sized avatar

Aron Podrigal ar45

  • AronTel
  • Chicago, IL
View GitHub Profile
@ar45
ar45 / instance-types.sh
Created July 13, 2018 21:56 — forked from trestletech/instance-types.sh
Get all EC2 Instance Types in All Availability Zones
#!/bin/bash
echo "Getting list of Availability Zones"
all_regions=$(aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' | sort)
all_az=()
while read -r region; do
az_per_region=$(aws ec2 describe-availability-zones --region $region --query 'AvailabilityZones[*].[ZoneName]' --output text | sort)
while read -r az; do
@ar45
ar45 / LambdaEfsBackup.py
Created July 12, 2018 16:28 — forked from eduardcloud/LambdaEfsBackup.py
Backup EFS file-system to S3 with lambda function
import boto3
import time
region = 'eu-west-1'
user_data_script = """#!/bin/bash
instanceid=$(curl http://169.254.169.254/latest/meta-data/instance-id)
cd /
mkdir moodledata
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 fs-xxxxxxxxxxc.efs.eu-west-1.amazonaws.com:/ moodledata
tar czf mooodledata-backup-$(date +%d-%m-%Y_%H-%M).tar.gz /moodledata
aws s3 mv mooodledata-backup-*.tar.gz s3://xxxxxxxxx/
@ar45
ar45 / angularjs_directive_attribute_explanation.md
Created February 25, 2016 02:35 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@ar45
ar45 / useful_bash_features.md
Created February 25, 2016 02:31 — forked from CMCDragonkai/useful_bash_features.md
Bash: Useful Bash Features

Useful Bash Features

  • Ctrl + r - search through command history
  • Alt + * - expand the * before running
  • Ctrl + Alt + e - expand the variables and aliases before running
  • Alt + # - turn current command into a comment and put it into history