Skip to content

Instantly share code, notes, and snippets.

View codrcodz's full-sized avatar

Cody Lee Cochran codrcodz

View GitHub Profile
@codrcodz
codrcodz / metadata_parser.sh
Last active April 29, 2021 18:06
Metadata Parser v0.2.0
#!/usr/bin/env bash
# Note: This script requires Bash v4.3+ due to use of `local -n`
# Function ensures all deps are in $PATH before continuing
dependency_check() {
local deps=( \
"git" \
"go" \
"yq" \
@codrcodz
codrcodz / metadata_parser.sh
Last active April 29, 2021 12:51
tflint Metadata Parser
#!/usr/bin/env bash
metadata_format="v0.1.0";
releases_metadata_file_prefix="releases_metadata";
# Function ensures all deps are in $PATH before continuing
dependency_check() {
deps="git go yq";
for dep in ${deps}; do
hash "${dep}" &>/dev/null \
@codrcodz
codrcodz / dev-net-ref-arch-excerpt.md
Created December 12, 2020 05:12
Development Network Reference Architecture Excerpts

Network Enclaves

In order to facilitate a development network with room for various types of development activities, activities must be partitioned into network enclaves that are appropriate for those activities. These enclaves include:

  • The Trusted Enclave
  • The Development Enclave

The Trusted Enclave

Description

@codrcodz
codrcodz / keybase.md
Created May 17, 2019 02:20
keybase.io

Keybase proof

I hereby claim:

  • I am codrcodz on github.
  • I am codrcodz (https://keybase.io/codrcodz) on keybase.
  • I have a public key ASBiwn7rsk-pfW1bZm1mHxRqjfZgpNll64VWoTRlHBxbYgo

To claim this, I am signing this object:

@codrcodz
codrcodz / deps_finder.sh
Last active April 3, 2018 18:28
Finds all the dependencies of a packages, and its deps' deps, and those deps' deps...
#!/usr/bin/env bash
main_pkg="${1}";
arch="$(uname -i)"
deps_list=( ${main_pkg} );
declare -a master_pkg_list;
declare -a deps_list_additions;
echo "[INFO] Finding deps for main_pkg: ${main_pkg}";
while true; do
for dep in ${deps_list[@]}; do
if [[ "${dep}" != "${main_pkg}" ]]; then
#!/usr/bin/env bash
curl -s https://pypi.python.org/simple/ \
| grep -oP "(?<=('>)).*(?=(</a>))" \
| while read package_name; do
curl -s https://pypi.python.org/simple/${package_name}/ \
| grep -oP "(?<=(\">${package_name}-))([[:digit:]]+.*?)(?=((\-py2\.|\-py3\.|\.tar|\.whl|\.zip).*</a>))" \
| while read package_version; do
echo -e "\n\nPackage: ${package_name} Version: ${package_version}";
curl -s --connect-timeout 1 -I https://pypi.python.org/pypi/${package_name}/${package_version} \
kernel_version="$(uname -r 2>/dev/null)"; \
os_release="$(grep -oP "(?<=(el))." <<<${kernel_version} )"; \
header(){ \
printf "\n\n----------\n"; \
printf "%s" "${1}"; \
printf "\n----------\n\n"; \
}; \
printf "\n=============================\n"; \
printf "Reboot Checks for:\n"; \
hostname; \
@codrcodz
codrcodz / find_big_dirs_fast
Last active June 20, 2017 17:43
Shell script for generic Linux systems. Used to quickly find large files on the file system based on common large file extensions.
nlvl=-20; \
printf "MB\tDirectory Name\n"; \
nice -n ${nlvl} \
find / \
-type f \
-regextype egrep \
-regex ".*\.(gz$|iso$|sql$|bak$|zip$|log$|tar$|csv$|tgz$|mp4$|png$|xz$)" \
-exec dirname '{}' \; \
| sort -u \
| while read dir; do \