This file contains 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 | |
## Get the primary and secundary IPs | |
awk '/\|--/ && !/\.0$|\.255$/ {print $2}' /proc/net/fib_trie | |
## Get only the primary IPs | |
awk '/32 host/ { print i } {i=$2}' /proc/net/fib_trie |
This file contains 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 +x | |
## Do you need to test your exposed app but you don't have curl/wget/* installed? | |
## The ":" is a built-in command and it works similar to true. Let's say, ":" is more portable than "true" | |
## Simple and easy | |
:> /dev/tcp/localhost/22 | |
## Why using timeout? If any side has a firewall and it's dropping the packages, the request will take ~80 seconds to get the timeout. |
This file contains 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
Deployment | |
Ingress | |
CronJob | |
Service | |
ServiceMonitor | |
ConfigMap | |
Secret |
This file contains 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 | |
set -E | |
function log() { | |
local msg_args=("${@}") | |
local timestamp="$(date +'%Y-%m-%d %T')" | |
declare -u log_level="${msg_args[0]}" | |
local message="${msg_args[@]:1}" |
This file contains 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
## Install | |
asdf plugin add terraform | |
asdf install terraform 0.13.0 | |
asdf install terraform 0.14.7 | |
asdf install terraform 0.12.29 | |
## | |
## Command | |
terraform version | |
## |
This file contains 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
## Add the awscli plugin | |
asdf plugin add awscli | |
## List the awscli version | |
asdf list-all awscli | |
## Install awscli version 2.1.27 | |
asdf install awscli 2.1.27 | |
## or to install the latest of awscli | |
asdf install awscli latest |
This file contains 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 | |
function test_vars(){ | |
declare -g declare_g="declare_g_output" | |
declare -x declare_x="declare_x_output" | |
declare declare_only="declare_only_output" | |
export export_only="export_only_output" | |
local local_only="local_only_output" |
This file contains 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 | |
function print_vars(){ | |
echo "func_declare_g->${declare_g}<-" | |
echo "func_declare_x->${declare_x}<-" | |
echo "func_declare_only->${declare_only}<-" | |
echo "func_export_only->${export_only}<-" | |
# echo "func_local_only->${local_only}<-" |
This file contains 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
## First of all, check if you already have an OpenID Connect | |
### List your EKS cluster OIDC URL | |
aws eks describe-cluster --name <CLUSTER_NAME> --query "cluster.identity.oidc.issuer" | |
#### Output | |
https://oidc.eks.<REGION>.amazonaws.com/id/<OIDC_ID> | |
### List your | |
aws iam list-open-id-connect-providers |
This file contains 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 sh | |
LINUX_DISTRO="$(. /etc/os-release ; echo ${ID})" | |
BASH_VERSION="bash-5.0" | |
SOURCE_DIR="/var/opt/" | |
prereqs_centos(){ | |
install_bash | |
yum install -y -q gcc make &> /dev/null | |
yum clean all &> /dev/null |
NewerOlder