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
Deployment | |
Ingress | |
CronJob | |
Service | |
ServiceMonitor | |
ConfigMap | |
Secret |
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 | |
declare -r MONTH="${1:-"$(date +'%m')"}" | |
declare -r MY_TOGGL_TOKEN="${MY_TOGGL_TOKEN?"Variable MY_TOGGL_TOKEN not declared"}" | |
declare -r UTC_NEW="$(TZ=UTC date +'%I')" | |
declare -ri MY_TIME=$(date +'%H') | |
declare -ri TZ_DIFF="$(( ${MY_TIME/0} - ${UTC_NEW/0} ))" | |
## How-to get the Project ID (wid): https://github.com/toggl/toggl_api_docs/blob/master/chapters/projects.md | |
declare -r PROJECT_ID="${PROJECT_ID?"Variable PROJECT_ID not declared"}" |
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 | |
RELATIVE_PATH="${0}" | |
RELATIVE_DIR_PATH="$(dirname "${0}")" | |
FULL_DIR_PATH="$(realpath "${0}" | xargs dirname)" | |
FULL_PATH="$(realpath "${0}")" | |
echo "RELATIVE_PATH->${RELATIVE_PATH}<-" | |
echo "RELATIVE_DIR_PATH->${RELATIVE_DIR_PATH}<-" | |
echo "FULL_DIR_PATH->${FULL_DIR_PATH}<-" |
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 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 |
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 +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 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 | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
NewerOlder