Skip to content

xi-Rick/sys-admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ› οΈ Sys Admin

SysAdmin Version License Shell

Linux Configuration & Installation Suite

From fresh install to fully optimized workstation in minutes β€” supporting 20+ distributions!


🌟 What Makes Sys Admin Special?

This isn't just another dotfiles script β€” it's your personal system configuration engineer that transforms any Linux distribution into a hardened, optimized, and privacy-respecting workstation. Whether you're running Arch, Debian, Fedora, or any derivative, this script delivers a perfectly tuned environment.

✨ Key Features

  • 🎯 Universal Linux Support: Auto-detects and supports 20+ distributions across 8 families
  • πŸ” Intelligent Detection: Auto-detects distro, package manager, init system, and available tools
  • ⚑ Power Optimization: TLP, auto-cpufreq, and zram for maximum battery life and performance
  • πŸ”’ Privacy-First: Mullvad VPN, USBGuard, mat2 metadata stripping, and more
  • 🐚 Shell Enhancement: One-command Oh My Zsh setup with fzf-tab, auto-suggestions, and fastfetch
  • πŸ›‘οΈ Safe & Reliable: Comprehensive error handling, automatic backups, and detailed logging

🎯 Supported Distributions


Arch Linux
& derivatives

Debian
& Ubuntu family

Fedora
& RHEL family

openSUSE
& SUSE family

Gentoo
Source-based

Void Linux
Independent

Alpine
Lightweight

NixOS
Declarative

Full distribution support includes:

  • Arch Family: Arch, Manjaro, CachyOS, EndeavourOS, Garuda, Artix
  • Debian Family: Debian, Ubuntu, Linux Mint, Pop!_OS, Elementary, Zorin, Deepin
  • Fedora Family: Fedora, RHEL, CentOS, Rocky, AlmaLinux, Nobara
  • SUSE Family: openSUSE Leap, openSUSE Tumbleweed, SLES
  • Others: Gentoo, Funtoo, Void, Alpine, NixOS

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/xi-Rick/sys-admin.git
cd sys-admin

# Make it executable
chmod +x sys-admin.sh

# Run with sudo access
./sys-admin.sh

Options

# Enable debug output
./sys-admin.sh --debug

# Show help
./sys-admin.sh --help

πŸŽ›οΈ Interactive Menu

When you run the script, you'll see a beautiful, distribution-aware interface:

================================================================================
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ    β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆ    β–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆ    β–ˆβ–ˆ
β–ˆβ–ˆ       β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ          β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ  β–ˆβ–ˆ
     β–ˆβ–ˆ    β–ˆβ–ˆ         β–ˆβ–ˆ     β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ  β–ˆβ–ˆ β–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ    β–ˆβ–ˆ    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ     β–ˆβ–ˆ   β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆ      β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ   β–ˆβ–ˆβ–ˆβ–ˆ

            Linux Configuration & Installation Suite
================================================================================

System: arch | Family: arch | Package Manager: pacman

MAIN MENU

  Installation & Configuration
    1) Essential Tools (TLP, Mullvad, Bluetooth)
    2) Privacy & Optimization Tools

  System & Information
    3) System Update
    4) View System Information
    5) View Logs

  Help
    6) About
    0) Exit

Select option:

Example Usage Scenarios

Laptop Power Optimization:

Select option: 1
Select option: 2  (Install & Configure TLP)

Installs TLP with USB blacklist, Bluetooth auto-enable, and optional TLPUI

Privacy-Focused Setup:

Select option: 2
Select option: 3  (usbguard)
Select option: 7  (mat2)

Hardens USB security and adds metadata stripping for files

Shell Environment:

Select option: 1
Select option: 1  (Oh My Zsh Setup)

Full Zsh environment with fzf-tab completions, auto-suggestions, syntax highlighting, and fastfetch

Complete Workstation:

Select option: 3  (System Update)
Select option: 1  (Essential Tools β†’ all)
Select option: 2  (Privacy & Optimization β†’ all)

Everything you need for a secure, optimized Linux workstation


πŸ”§ What Gets Installed

⚑ Essential Tools

Oh My Zsh + fzf-tab + Fastfetch:

# Shell environment
zsh fzf git fastfetch
# Oh My Zsh with plugins
fzf-tab                    # Fuzzy tab completions
zsh-autosuggestions        # Fish-like auto-suggestions
zsh-syntax-highlighting    # Command syntax highlighting

TLP Power Management:

# Power optimization
tlp tlp-rdw               # Advanced power management + radio device wizard
# Removes conflicting packages
power-profiles-daemon      # Automatically removed if present
# Optional GUI
tlpui                      # Graphical TLP configuration (AUR)

Mullvad VPN:

# Headless VPN setup
mullvad-vpn                # Installed from official repos
# Auto-configured with:
#   β€’ Auto-connect on boot
#   β€’ Daemon auto-start
#   β€’ Account login

πŸ”’ Privacy & Optimization Tools

System Protection:

nohang                     # Intelligent OOM prevention (smarter than earlyoom)
usbguard                   # USB device authorization (BadUSB protection)
mat2                       # Metadata sanitizer for files (EXIF, author info)

Performance Tuning:

auto-cpufreq               # Dynamic CPU governor switching
zram-generator             # Compressed swap in RAM (zstd compression)

Desktop Enhancement:

kanshi                     # Dynamic display profiles for Wayland
interception-tools         # Kernel-level keyboard remapping (X11 + Wayland)

βš™οΈ Advanced Configuration

TLP USB Blacklist

The script provides an interactive USB device selector to prevent TLP from suspending critical devices:

# Automatically detects and lists all USB devices
# Highlights Bluetooth adapters for easy selection
# Updates /etc/tlp.conf with USB_BLACKLIST entries
# Creates timestamped backups before modifying configs

Bluetooth Auto-Enable

Ensures Bluetooth powers on at boot regardless of previous state:

# Modifies /etc/bluetooth/main.conf
# Adds AutoEnable=true under [Policy] section
# Creates backup before modification
# Restarts bluetooth service to apply

zram Compressed Swap

Optimized swap configuration using RAM compression:

# /etc/systemd/zram-generator.conf.d/swap.conf
[zram0]
zram-size = min(ram / 2, 4096)    # Half RAM or 4GB max
compression-algorithm = zstd       # Best speed/ratio balance
swap-priority = 100                 # Prefer over disk swap

Oh My Zsh Plugin Order

The script enforces correct plugin load order for compatibility:

plugins=(git fzf-tab zsh-autosuggestions zsh-syntax-highlighting)
# 1. compinit        β€” handled by Oh My Zsh
# 2. fzf-tab         β€” must load after compinit, before widget plugins
# 3. autosuggestions β€” after fzf-tab
# 4. syntax-highlighting β€” always last

Key Bindings

Tab     β€” fzf-tab fuzzy completion menu
Ctrl+R  β€” fzf fuzzy history search
Ctrl+T  β€” fzf fuzzy file search
β†’ / End β€” Accept auto-suggestion

πŸ“Š System Detection

The script automatically gathers system information at startup:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                          SYSTEM DETECTION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[INFO] Detecting Linux distribution...
  [βœ“] Detected: Arch Linux
  [βœ“] Family: arch
  [βœ“] Package Manager: pacman
[INFO] Kernel: 6.12.8-arch1-1
[INFO] Architecture: x86_64
[INFO] Hostname: workstation
  [βœ“] Init system: systemd

πŸ“ Logging

Every action is logged with timestamps for audit and troubleshooting:

# Log location
~/.local/state/sys-admin/sys-admin-YYYYMMDD-HHMMSS.txt

# View logs from the menu
Select option: 5  (View Logs)

# Or directly
cat ~/.local/state/sys-admin/sys-admin-*.txt

Log entries include severity levels: [INFO], [OK], [WARN], [ERR]


πŸ›‘οΈ Troubleshooting & Support

Common Issues & Solutions

TLP conflicts with power-profiles-daemon:

# The script handles this automatically, but if needed:
sudo systemctl stop power-profiles-daemon
sudo systemctl mask power-profiles-daemon
sudo systemctl enable --now tlp.service

Mullvad daemon not starting:

# Check daemon status
sudo systemctl status mullvad-daemon
# Restart daemon
sudo systemctl restart mullvad-daemon
# Verify connection
mullvad status

Oh My Zsh not loading after install:

# Shell change requires logout/login
# Verify default shell
echo $SHELL
# Manually set if needed
chsh -s $(which zsh)

zram not activating:

# Load kernel module
sudo modprobe zram
# Check status
zramctl
# Restart systemd unit
sudo systemctl daemon-reload
sudo systemctl start /dev/zram0

USBGuard blocking devices:

# List blocked devices
sudo usbguard list-devices --blocked
# Allow a device
sudo usbguard allow-device <id>
# Regenerate policy from current devices
sudo usbguard generate-policy | sudo tee /etc/usbguard/rules.conf

🀝 Contributing

Help make Sys Admin even better! Here's how:

Development Setup

git clone https://github.com/xi-Rick/sys-admin.git
cd sys-admin

# Test in a virtual machine
qemu-system-x86_64 -enable-kvm -m 4G linux.qcow2
# Or use containers
docker run -it archlinux:latest /bin/bash
docker run -it ubuntu:latest /bin/bash
docker run -it fedora:latest /bin/bash

Testing Checklist

  • Test on Arch-based distributions
  • Test on Debian/Ubuntu-based distributions
  • Test on Fedora/RHEL-based distributions
  • Verify TLP installation and USB blacklist
  • Verify Mullvad headless setup
  • Verify Oh My Zsh + plugin installation
  • Test privacy tools (nohang, usbguard, mat2)
  • Test performance tools (auto-cpufreq, zram-generator)
  • Verify system update across package managers
  • Check logging output

πŸ“š Resources & Community

Official Documentation

Tool References


πŸ› οΈ Ready to optimize your Linux system? ⭐ Star this repo and get started! ⭐

Transform any Linux distribution into a secure, optimized workstation today!

Made with 🐧 by Dana Davis

About

πŸ› οΈ Sys Admin - Universal Linux configuration & installation suite with auto-distro detection, 20+ distro support, and interactive TUI for TLP, Mullvad, Zsh/OMZ, and privacy tools. One script to rule them all.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages