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 | |
# On Feb 27, 2023, Amazon ECS supports deletion of inactive task definition revisions: | |
# | |
# Announcement: | |
# - https://aws.amazon.com/about-aws/whats-new/2023/02/amazon-ecs-deletion-inactive-task-definition-revisions/ | |
# | |
# Blog Post: | |
# - https://aws.amazon.com/blogs/containers/announcing-amazon-ecs-task-definition-deletion/ | |
# |
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: | |
# | |
# ./find-unused-security-groups.sh [us-east-1] | |
# | |
REGION=${1:-us-east-1} | |
SECURITY_GROUPS=($(aws ec2 describe-security-groups --no-paginate --region ${REGION} --output json | jq -r '.SecurityGroups[].GroupId')) |
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 | |
# simple script for dumping elastic log from one to another | |
ES_SRC_ENDPOINT="192.168.0.100:9200" | |
ES_DST_ENDPOINT="192.168.0.200:9200" | |
ES_INDEX_NAME="logstash-2018.09.25" | |
INPUT="http://${ES_SRC_ENDPOINT}/${ES_INDEX_NAME}" | |
OUTPUT="http://${ES_DST_ENDPOINT}/${ES_INDEX_NAME}" |
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 python3 | |
import argparse | |
from math import ceil | |
from prettytable import PrettyTable | |
def resultTable(coresPerReplica, nodesPerReplica, m, M, s=10): | |
pretty_table = PrettyTable() | |
pretty_table.field_names = ["Node", "replicas"] |
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 python3 | |
import re | |
from bs4 import BeautifulSoup | |
from requests import get | |
from sys import stdin | |
scanned_urls = [] |
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 | |
# | |
# original edition: | |
# - https://gist.github.com/sechiro/8561684 | |
# | |
now=`date -u "+%Y-%m-%dT%H:%M:%SZ"` | |
if [ $(uname) = "Darwin" ]; then | |
yesterday=`date -u -v-3d "+%Y-%m-%dT%H:%M:%SZ"` |
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
# for Windows Server 2016 (or above) | |
# reference: | |
# - https://github.com/docker/labs/blob/master/windows/windows-containers/Setup-Server2016.md | |
# - https://docs.docker.com/engine/installation/linux/docker-ce/binaries/ | |
# - https://docs.docker.com/docker-for-windows/install/ | |
# setup basic requirement | |
Install-Module -Name PowerShellGet -MinimumVersion 1.1.3.2 -Force | |
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.208 -Force |
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 | |
for pod in $(etcdctl ls /registry/pods/default); do | |
printf "%-16s ==> %s\n" "$(etcdctl get ${pod} | jq -r '.status.podIP')" "$(basename ${pod})" | |
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 | |
# prerequisite: | |
# - ec2 instance should attached proper iam role | |
# - awscli | |
# - kubectl | |
# Usage: | |
# | |
# define the following variales in your environment (root account) |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] | |
"LongPathsEnabled"=dword:00000001 |
NewerOlder