Skip to content

Instantly share code, notes, and snippets.

View NotYusta's full-sized avatar

Yusta NotYusta

View GitHub Profile
@NotYusta
NotYusta / rename_package_name.sh
Created April 7, 2025 13:09
Rename Package Name Go
#!/bin/sh
echo -n "Enter new Go package name: "
read pkg_name
# Get the previous package name from go.mod
prev_pkg_name=$(grep '^module ' go.mod | awk '{print $2}')
# Update go.mod
go mod edit -module $pkg_name
@NotYusta
NotYusta / ssh_strict_hardening.sh
Last active March 30, 2025 09:13
SSH Strict Authentication (MFA)
#!/bin/bash
# 🔹 Backup directory for rollback
BACKUP_DIR="/root/.ssh-security-backup"
SUDO_GROUP="sudo"
generate_password() {
local password length num_count special_count char_count
while true; do
# Random total length between 24 and 32
@NotYusta
NotYusta / database-backup.sh
Last active March 23, 2025 02:16
Start Database Backup
#!/bin/sh
DIR_PATH="$HOME/database-backup"
OUTDIR_PATH="$DIRPATH/out"
CLEAR_PERIOD="7"
cd $DIR_PATH
# Ensure the output directory exists
mkdir -p "$OUTDIR_PATH"
# Make sure the backup script is executable
@NotYusta
NotYusta / delete_jar.sh
Created October 22, 2024 09:54
Delete Jars
#!/bin/bash
# Check if the user provided a path argument
if [ -z "$1" ]; then
echo "Usage: $0 <path>"
exit 1
fi
# Set the PATH variable to the user-provided argument
SEARCH_PATH=$1
@NotYusta
NotYusta / proxmox_automatic_boot_order.sh
Last active October 5, 2024 09:43
Proxmox Automatic Boot Order - <vm-id>
#!/bin/bash
# Check if exactly one argument (vm-id) is provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <vm-id>"
exit 1
fi
VMID="$1"
@NotYusta
NotYusta / import_proxmox_vm_with_label.sh
Last active October 3, 2024 15:13
Proxmox Import VM Disk (Formatted) - <vm-id> <image-file> <storage> <label> <slot> (0-20, can be single or ranges)
#!/bin/bash
# Function to check the exit status of the last command
check_error() {
if [ $? -ne 0 ]; then
echo "Error: $1"
exit 1
fi
}
@NotYusta
NotYusta / windows_automatic_network_config.ps1
Last active September 30, 2024 15:27
Windows Automatic Network Configuration
function windows_automatic_network_config {
param (
[string]$IPv4,
[string]$CIDR,
[string]$Gateway,
[string]$DNS1,
[string]$DNS2
)
# Check if all arguments are provided
@NotYusta
NotYusta / linux_automatic_network_config.sh
Last active October 2, 2024 08:58
Linux Automatic Network Configuration
#!/bin/bash
# Check if all arguments are provided
if [ $# -ne 6 ]; then
echo "Usage: $0 <ipv4> <cidr/subnet-mask> <gateway> <dns1> <dns2> <mac-address>"
exit 1
fi
IPV4=$1
CIDR=$2
@NotYusta
NotYusta / test.sh
Created September 30, 2024 08:10
Test
#!/bin/sh
echo "test"
@NotYusta
NotYusta / reset_ssh_password.sh
Last active September 29, 2024 04:59
Reset SSH Password
#!/bin/bash
NEW_PASSWORD="$1"
# Check if a password argument is provided
if [ "$#" -ne 1 ]; then
echo "bash script.sh <new_password>"
exit 1
fi