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 | |
# Automation Scripting Essential Skills: https://github.com/dgoade/ase | |
# Bash | |
# Input: Getting command line paramaters | |
echo "=======================" | |
logMsg="Third technique -- combine positional args and emulate getoptslong" | |
echo "${logMsg}" | |
echo "args: ${@}" |
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
#!/usr/bin/python | |
# Automation Scripting Essential Skills https://github.com/dgoade/ase | |
# Python | |
# Input: Parsing command-line parameters | |
# Technique1 -- Use getopt | |
import getopt | |
import sys |
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
#!/usr/bin/env python | |
""" | |
Automation Scripting Essential Skills (https://github.com/dgoade/ase) | |
Python | |
Execution: Execute an external command or script | |
Technique1 -- Use python2.7's core logging and configDict with yaml, | |
and fabric to execute an external command or shell script and |
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 | |
# The declare builtin allows you to limit the scope of variables in bash | |
BAZ="OTHER" | |
foo () | |
{ | |
declare BAZ="THIS" | |
echo "Inside foo(), BAZ=${BAZ}" |
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 | |
# From: https://github.com/dgoade/bat/blob/master/lib/utils.sh | |
##== FUNCTION ========================================================================== | |
: <<='cut' | |
=head2 B<utils_trace_on()> | |
Debugging tool. Toggle-on Bash x-trace with a special prompt that shows | |
the script name, function name and line number along with the output. |
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
#!/usr/bin/perl | |
use strict; | |
# Automation Scripting Essential Skills (https://github.com/dgoade/ase) | |
# Perl | |
# Input: Parsing command-line parameters | |
# Technique #1 -- Use getopt or getoptlong | |
use Getopt::Long; |
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
# cool git aliases from Larry Defauw | |
[user] | |
name = David Goade | |
email = [email protected] | |
[core] | |
autocrlf = false | |
[alias] | |
co = checkout | |
ci = commit | |
st = status |
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
resource "aws_ecr_repository" "repo" { | |
name = "mycompany" | |
} | |
resource "aws_ecr_lifecycle_policy" "expire_policy" { | |
repository = aws_ecr_repository.repo.name | |
policy = <<EOF | |
{ | |
"rules": [ |
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
#!/usr/bin/env bash | |
##================================== | |
## Common K8s Functions and Aliases | |
##================================== | |
##--------------------------------- | |
## Recommended usage | |
##--------------------------------- | |
# Add the following to your zsh aliases: | |
# source "${THIS_REPO}/k8s_aliases.zsh" |