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 Advanced Color | |
// @namespace base | |
// @version 0.6 | |
// @description Color base on checkin time | |
// @author Jonny | |
// @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 |
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 | |
# Usage: ./get_kubeconfig_custom_cluster_rancher2.sh cluster_name | |
# Needs to be run on the server running `rancher/rancher` container | |
# Check if jq exists | |
command -v jq >/dev/null 2>&1 || { echo "jq is not installed. Exiting." >&2; exit 1; } | |
# Check if clustername is given | |
if [ -z "$1" ]; then | |
echo "Usage: $0 [clustername]" |
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
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: tiller | |
namespace: kube-system | |
--- | |
kind: ClusterRoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
metadata: | |
name: tiller |
NewerOlder