This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # function Extract for tar or zip file formats | |
| # Inspired by this Source: https://github.com/xvoland/Extract/blob/master/extract.sh | |
| function extract { | |
| if [ -z "$1" ]; then | |
| # display usage if no parameters given | |
| echo "Usage: extract <path/file_name>.<zip|gz|tar|tbz2|tgz|tar.bz2|tar.gz|tar.xz>" | |
| echo " extract <path/file_name_1.ext> [path/file_name_2.ext] [path/file_name_3.ext]" | |
| return 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Tag snapshots based on their associated AMI and volumes based on attached instance. | |
| # format: | |
| # (AMI:db5|db5) /dev/sda1 (1/4) | |
| # (AMI:db5|db5) /dev/sdb (2/4) | |
| # Best practice: create IAM user | |
| # Simplest privilege to get it to work with reasonable security: use predefined policy "ReadOnlyAccess" | |
| # and add your own custom policy that grants "ec2:CreateTags" | |