Skip to content

Instantly share code, notes, and snippets.

@jazzl0ver
jazzl0ver / opensearch_cpu_graph.sh
Created April 21, 2025 15:47
Opensearch/Elasticsearch CPU load per node ascii chart
#!/bin/bash
ENDPOINTS=(
"https://wi-node-1:9200"
"https://wi-node-2:9200"
"https://wi-node-3:9200"
)
INTERVAL=1
MIN_PANEL_HEIGHT=10
LOG_FILE="/tmp/opensearch_cpu_log.txt"
@jazzl0ver
jazzl0ver / shrink_reindex.sh
Created April 24, 2025 16:47
Reduce number of shards for Opensearch/Elasticsearch indices in a loop
#!/bin/bash
# OpenSearch endpoint
HOST="https://localhost:9200"
username=admin
read -s -p "Password: " password
echo
# Опционально: если нужна basic auth
@jazzl0ver
jazzl0ver / check_disk_spike.sh
Last active April 30, 2025 09:28
Nagios plugin for monitoring all mounted filesystems and detecting abnormal spikes in disk usage
#!/bin/bash
#
# This script monitors all mounted filesystems and detects abnormal spikes
# in disk usage based on historical percentage growth. It calculates the
# median and standard deviation of usage changes over time and reports a
# warning or critical alert if the latest change deviates significantly
# (Z-score based) from typical behavior.
#
@jazzl0ver
jazzl0ver / ussd_ucs2.sh
Created June 25, 2025 11:22
send ussd command
#!/bin/bash
#
# Посылает USSD-запрос, переданный первым параметром командной строки и выводит ответ
#
DEVICE="/dev/ttyS0"
BAUD=115200
TMPLOG="/tmp/ussd.log"
USSD_HEX=$(echo -n "$1" | iconv -f utf-8 -t utf-16be | xxd -p)