Skip to content

Instantly share code, notes, and snippets.

View RScrafted's full-sized avatar

Rachit RScrafted

View GitHub Profile
@RScrafted
RScrafted / apt-maintenance.sh
Created August 7, 2026 06:34
Performs unattended Ubuntu package maintenance using systemd services and timers
#!/usr/bin/env bash
# ==============================================================================
# Ubuntu APT Maintenance Script
# ==============================================================================
#
# Purpose
# -------
# Performs scheduled operating system maintenance for Ubuntu servers.
#
@RScrafted
RScrafted / dnf-maintenance.sh
Created July 21, 2026 12:05
Fedora/RHEL DNF maintenance script that updates packages, cleans unused files, optionally refreshes Flatpak packages, and saves logs.
#!/bin/bash
# ============================================================
# DNF Maintenance Script
#
# Compatibility:
# - Fedora and RHEL-based systems
# - Desktop and headless/server installations
#
# Purpose:
@RScrafted
RScrafted / apt-maintenance-manual.sh
Last active August 7, 2026 06:32
Debian/Ubuntu APT maintenance script with cleanup, Snap support, and logging.
#!/bin/bash
# ============================================================
# APT Maintenance Script
#
# Compatibility:
# - Debian and Ubuntu based systems
# - Desktop and headless/server installations
#
# Purpose:
@RScrafted
RScrafted / disk-usage-alert.sh
Created July 15, 2026 23:05
Checks the root filesystem disk usage and displays a warning when usage goes above a defined threshold.
#!/bin/bash
THRESHOLD=80
USAGE=$(df / | awk 'NR==2 {print $5}' | sed 's/%//')
if [ "$USAGE" -gt "$THRESHOLD" ]; then
echo "Warning: Disk usage is ${USAGE}%"
fi