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
// How to use this script? | |
// | |
// 1. Go to your profile page | |
// 2. Go to "Friend" tab | |
// 3. Keep scrolling down, until all friends data loaded | |
// 4. Open browser's "Console" (short cut on macOS: Cmd + F12) | |
// 5. Execute the script below | |
// | |
// Last Modified: Feb 22, 2025 | |
// |
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 | |
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls | |
REPO_URL="https://github.com/guessi/cloudtrail-cli" | |
curl -fsSL ${REPO_URL} | \ | |
sed -n '/<script .*>/,/<\/script>/p' | \ | |
grep -oE 'https?://camo.githubusercontent.com/[a-f0-9]+/[a-f0-9]+' | \ | |
xargs -n 1 curl -X PURGE |
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
# https://pyjwt.readthedocs.io/en/stable/ | |
python3 -m pip install PyJwt | |
# https://pyjwt.readthedocs.io/en/stable/usage.html#reading-the-claimset-without-validation | |
echo token_file_name | python3 -c 'import sys,jwt; f = open(sys.stdin.read().strip()); decoded_jwt = jwt.decode(f.readline(), options={"verify_signature": False}); print(decoded_jwt); f.close();' |
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 | |
INPUT="${1}" | |
OUTPUT="${2}" | |
SIZE="1920:1080" # horizontal | |
# SIZE="1080:1920" # vertical | |
BITRATE_V="4800k" | |
# https://trac.ffmpeg.org/wiki/Encode/H.265 |
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 | |
# 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 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 | |
# 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 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 | |
# 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 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 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 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 python3 | |
import re | |
from bs4 import BeautifulSoup | |
from requests import get | |
from sys import stdin | |
scanned_urls = [] |
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 | |
# | |
# 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"` |
NewerOlder