Skip to content

Instantly share code, notes, and snippets.

View NotYusta's full-sized avatar

Yusta NotYusta

View GitHub Profile
@NotYusta
NotYusta / hostname.sh
Last active July 11, 2025 07:29
Set Hostname
#!/bin/bash
# Ensure script is run as root
if [ "$(id -u)" -ne 0 ]; then
echo "❌ Please run this script as root (sudo)."
exit 1
fi
# Check for hostname argument
if [ -z "$1" ]; then
@NotYusta
NotYusta / generate_wings_config.sh
Last active July 11, 2025 08:05
Generate Wings Config
#!/bin/bash
# Example usage:
# ./generate_wings_config.sh \
# --uuid "1046d1d1-b8ef-4771-82b1-2b5946d33397" \ # Node UUID from panel
# --token_id "iAcosCn1KCAgVjVO" \ # Token ID from panel
# --token "FanPzLCptUxkGow3vi7Z" \ # Token secret from panel
# --ssl_cert "/etc/letsencrypt/live/pterodactyl.file.properties/fullchain.pem" \ # Path to SSL cert
# --ssl_key "/etc/letsencrypt/live/pterodactyl.file.properties/privkey.pem" \ # Path to SSL key
# --remote_url "https://pterodactyl.file.properties" \ # Panel URL
# --pid_limit 512 # PID limit (0 = unlimited)
@NotYusta
NotYusta / minio_download.sh
Last active July 10, 2025 08:34
MinIO Download
#!/bin/bash
# Usage:
# ./minio_download.sh <ACCESS_KEY> <SECRET_KEY> <BUCKET> <OBJECT_PATH> <DEST_FILE> <MINIO_URL>
# Or set via env vars:
# MINIO_ACCESS_KEY, MINIO_SECRET_KEY, MINIO_BUCKET, MINIO_OBJECT, MINIO_DEST, MINIO_URL
ACCESS_KEY="${1:-$MINIO_ACCESS_KEY}"
SECRET_KEY="${2:-$MINIO_SECRET_KEY}"
BUCKET="${3:-$MINIO_BUCKET}"
@NotYusta
NotYusta / enable_password_ssh.sh
Created June 3, 2025 12:44
Enable Password SSH
#!/bin/bash
# Update SSH configuration to allow root login and password authentication
# Ensure running as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root."
exit 1
fi
@NotYusta
NotYusta / import_vm_image_url.sh
Created May 20, 2025 08:55
Import Proxmox VM Image with URL
#!/bin/bash
VMID=$1
IMAGE_URL=$2
STORAGE_TARGET=$3
DISK_LABEL=$4
DISK_SLOT=${5:-""}
if [ $# -lt 4 ]; then
echo "Usage: $0 <vmid> <image_url> <storage_target> <disk_label> [<disk_slot>]"
@NotYusta
NotYusta / install_exporters_full.sh
Created May 18, 2025 13:21
Install full exporters
#!/bin/sh
set -e
TMP_DIR="/tmp/exporter_installers"
mkdir -p "$TMP_DIR"
NODE_EXPORTER_URL="https://gist.githubusercontent.com/NotYusta/7f0121db2fb01c60edb3d64ad1b9cd27/raw/3be376455f4ffce7e5e8018cd32254cef9595ff0/install_node_exporter.sh"
CADVISOR_URL="https://gist.githubusercontent.com/NotYusta/412c55b1d712bd717ccc310c7c48328b/raw/98e360718f1ad10bae158a60372a3ba1643949d0/install_cadvisor.sh"
SMARTCTL_URL="https://gist.githubusercontent.com/NotYusta/5ab4a72e28957575b4ed75a17f111699/raw/cf3bd3b0fc5d89c73a2e040e99afed4866a0ebc1/install_smartctl.sh"
FIREWALL_URL="https://gist.githubusercontent.com/NotYusta/af31c51a86be5b20575ecc1514f50d28/raw/3a4ef2cf15bc6a61a4d0a2b705bb619aee6e0aed/install_exporters_firewall"
@NotYusta
NotYusta / install_node_smartctl_fw.sh
Last active May 18, 2025 13:16
Node & Smartctl exporter - Full
#!/bin/sh
set -e
TMP_DIR="/tmp/exporter_installers"
mkdir -p "$TMP_DIR"
NODE_EXPORTER_URL="https://gist.githubusercontent.com/NotYusta/7f0121db2fb01c60edb3d64ad1b9cd27/raw/3be376455f4ffce7e5e8018cd32254cef9595ff0/install_node_exporter.sh"
SMARTCTL_URL="https://gist.githubusercontent.com/NotYusta/5ab4a72e28957575b4ed75a17f111699/raw/cf3bd3b0fc5d89c73a2e040e99afed4866a0ebc1/install_smartctl.sh"
FIREWALL_URL="https://gist.githubusercontent.com/NotYusta/af31c51a86be5b20575ecc1514f50d28/raw/3a4ef2cf15bc6a61a4d0a2b705bb619aee6e0aed/install_exporters_firewall"
#!/bin/sh
EXPORTER_PORT_RANGE="9100:9200"
IPSET_NAME=exporters_whitelist
CHAIN_NAME=exporters_firewall
# Function to install necessary packages
install_packages() {
if command -v apt-get >/dev/null 2>&1; then
apt-get update -y
apt-get install -y ipset iptables
@NotYusta
NotYusta / install_smartctl.sh
Created May 18, 2025 12:57
Install Smartctl Exporter
#!/bin/sh
PORT=9102
BIN_DIR="/usr/local/bin"
SERVICE_NAME="smartctl-exporter"
BINARY_NAME="smartctl-exporter"
VERSION="0.14.0"
DOWNLOAD_URL="https://github.com/prometheus-community/smartctl_exporter/releases/download/v${VERSION}/smartctl_exporter-${VERSION}.linux-amd64.tar.gz"
# Function to download and extract smartctl_exporter
install_smartctl_exporter() {
@NotYusta
NotYusta / install_cadvisor.sh
Last active May 18, 2025 12:55
Install CAdvisor
#!/bin/sh
PORT=9101
BIN_DIR="/usr/local/bin"
SERVICE_NAME="cadvisor"
BINARY_NAME="cadvisor"
VERSION="0.52.1"
DOWNLOAD_URL="https://github.com/google/cadvisor/releases/download/v${VERSION}/cadvisor-v${VERSION}-linux-amd64"
# Function to download and place cadvisor binary
install_cadvisor() {