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
#!/bin/bash | |
# Set up your environment variables | |
TFC_ORG_SOURCE="" | |
TFC_ORG_DEST="" | |
TFC_TOKEN_SOURCE="" | |
TFC_TOKEN_DEST="" | |
# Define the list of workspace names to exclude | |
EXCLUDE_WORKSPACES=("workspace_1" "workspace_2") |
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
#!/bin/bash | |
TOKEN="TFC_TOKEN" | |
ORG_NAME="ORG_NAME" | |
PAGE_SIZE=20 | |
# Function to fetch workspaces for a specific page number | |
function fetch_workspaces_page { | |
local page="$1" | |
curl -s -H "Authorization: Bearer $TOKEN" \ |
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
import os | |
import yaml | |
# Define the folder path containing the YAML files | |
folder_path = ( | |
"YOUR_BASE_YAML_FOLDER_PATH" | |
) | |
# Initialize variables to store the largest offset and access port | |
largest_offset = -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
import random | |
import struct | |
class SimpleRC5: | |
P32 = 0xB7E15163 | |
Q32 = 0x9E3779B9 | |
R = 12 | |
def __init__(self, key=None): |
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
#!/bin/bash | |
export AWS_REGION=ap-northeast-1 | |
check_profile() { | |
local profile=$1 | |
local specific_text=$2 | |
# Check if the profile contains the specific text | |
if [[ $profile == *"$specific_text"* ]]; then | |
return 0 # The string is found | |
else |
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
#!/bin/bash | |
export AWS_REGION=ap-northeast-1 | |
process_profile() { | |
local profile=$1 | |
echo -e "\n\n========== Processing profile: $profile ==========" | |
export AWS_PROFILE=$profile | |
# Get the ECR cost and usage for the current month | |
local start_date=$(date -v1d +%Y-%m-%d) |
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
kubecontext=$(kubectl config view -o jsonpath='{.contexts[*].name}') | |
oldIFS=$IFS | |
IFS=$' ' | |
choices=( $kubecontext ) | |
IFS=$oldIFS | |
PS3="Please select your kube context: " | |
select answer in "${choices[@]}"; do | |
for item in "${choices[@]}"; do | |
if [[ $item == $answer ]]; then | |
break 2 |
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
// ==UserScript== | |
// @name Base Checkin Color | |
// @namespace base | |
// @version 0.9 | |
// @description Color base on checkin time | |
// @author Anonymous | |
// @match https://checkin.base.vn/me* | |
// @icon https://static-gcdn.basecdn.net/checkin/image/fav.png | |
// @grant none | |
// ==/UserScript== |
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
#!/bin/bash | |
while getopts c:s: flag | |
do | |
case "${flag}" in | |
c) cluster_name=${OPTARG};; | |
s) service_name=${OPTARG};; | |
esac | |
done |
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
#!/bin/bash | |
# Docker CE Install | |
sudo yum update -y | |
sudo yum install -y jq | |
sudo amazon-linux-extras install -y docker | |
sudo service docker start | |
sudo usermod -a -G docker ec2-user | |
# Make docker auto-start |
NewerOlder