Skip to content

My personal linux related stuff. Experimental and only meant for fun and for myself

Notifications You must be signed in to change notification settings

Ven0m0/Linux-OS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Linux-OS

Production-grade shell scripts for Arch Linux, CachyOS, and Raspberry Pi systems

A curated collection of battle-tested automation scripts for system setup, optimization, maintenance, and customization. Designed for power users who value performance, reproducibility, and minimal bloat.


🎯 Target Systems

Primary Secondary Tertiary
Arch Linux Debian Termux
CachyOS Raspbian EndeavourOS
Wayland Raspberry Pi OS Gentoo
Nobara
SteamOS
Bazzite

πŸ“‚ Repository Structure

Linux-OS/
β”œβ”€β”€ Cachyos/              # Arch/CachyOS system scripts
β”‚   β”œβ”€β”€ Scripts/          # Curlable AIO installers
β”‚   β”‚   β”œβ”€β”€ bench.sh      # System benchmarking
β”‚   β”‚   └── Android/      # Android/Termux optimizers
β”‚   β”œβ”€β”€ setup.sh          # Automated system configuration
β”‚   β”œβ”€β”€ up.sh             # Comprehensive update orchestrator
β”‚   β”œβ”€β”€ clean.sh          # System cleanup & privacy hardening
β”‚   β”œβ”€β”€ Rank.sh           # Mirror ranking & keyring updates
β”‚   β”œβ”€β”€ debloat.sh        # System debloating
β”‚   └── rustbuild.sh      # Rust compilation helpers
β”œβ”€β”€ RaspberryPi/          # Raspberry Pi specific scripts
β”‚   β”œβ”€β”€ Scripts/          # Pi automation tooling
β”‚   β”‚   β”œβ”€β”€ setup.sh      # Initial Pi setup & optimization
β”‚   β”‚   β”œβ”€β”€ Kbuild.sh     # Kernel building automation
β”‚   β”‚   └── apkg.sh       # TUI package manager (fzf/skim)
β”‚   β”œβ”€β”€ raspi-f2fs.sh     # F2FS imaging orchestrator
β”‚   β”œβ”€β”€ update.sh         # Pi update script
β”‚   β”œβ”€β”€ PiClean.sh        # Pi cleanup automation
β”‚   └── dots/             # Dotfiles and configurations
β”œβ”€β”€ docs/                 # Documentation
β”œβ”€β”€ Shell-book.md         # Bash patterns & helpers
β”œβ”€β”€ USEFUL.MD             # Curated resources & snippets
└── CLAUDE.md             # Development guidelines (AI context)

πŸš€ Quick Start

Arch Linux / CachyOS

System Update (packages, flatpak, rust, python, npm, etc.)

curl -fsSL https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/Cachyos/up.sh | bash

System Cleanup (package cache, orphans, logs, privacy hardening)

curl -fsSL https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/Cachyos/clean.sh | bash

Mirror Ranking (optimize download speeds)

curl -fsSL https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/Cachyos/Rank.sh | bash

Raspberry Pi

System Update

curl -fsSL https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/RaspberryPi/update.sh | bash

System Cleanup

curl -fsSL https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/RaspberryPi/PiClean.sh | bash

F2FS Image Creation (convert Raspbian/DietPi images to F2FS)

wget https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/RaspberryPi/raspi-f2fs.sh
chmod +x raspi-f2fs.sh
sudo ./raspi-f2fs.sh -i dietpi -d /dev/sdX -s

πŸ“œ Key Scripts

Cachyos/

Script Description Usage
up.sh All-in-one update orchestrator (system, flatpak, rust, python, npm, mise, etc.) curl -fsSL <URL> | bash
clean.sh Comprehensive cleanup: pacman cache, orphans, logs, browser data, privacy hardening curl -fsSL <URL> | bash
setup.sh Automated system configuration: repositories, sysctl tuning, service setup ./setup.sh
Rank.sh Mirror ranking for optimal download speeds + keyring updates curl -fsSL <URL> | bash
debloat.sh Remove bloatware and unnecessary services ./debloat.sh
rustbuild.sh Rust compilation environment with optimized flags ./rustbuild.sh

RaspberryPi/

Script Description Usage
setup.sh Pi optimization: APT config, modern tooling (fd, rg, bat, eza), optional Pi-hole ./Scripts/setup.sh --help
raspi-f2fs.sh Flash images to SD/USB with F2FS root (better flash longevity) sudo ./raspi-f2fs.sh -h
update.sh Pi-specific update script with APT optimization curl -fsSL <URL> | bash
PiClean.sh Pi cleanup: APT cache, logs, temp files curl -fsSL <URL> | bash
Kbuild.sh Raspberry Pi kernel building with optimization flags ./Scripts/Kbuild.sh
apkg.sh Interactive APT package manager using fzf/skim apkg --install

Scripts/Android/

Script Description Usage
android-optimize.sh Termux/Android system optimization ./android-optimize.sh
optimize_apk.sh APK size reduction & optimization ./optimize_apk.sh app.apk

πŸ› οΈ Features

Arch/CachyOS Scripts

  • Multi-source updates: pacman/paru/yay, flatpak, rustup, npm, pip/uv, mise, topgrade
  • Aggressive caching cleanup: Package cache, build artifacts, logs, browser data
  • Privacy hardening: Browser history/cache/cookies cleanup, SQLite optimization
  • Repository management: Chaotic-AUR, ALHP (x86-64-v3), Artafinde, EndeavourOS
  • Build optimization: Native CPU tuning, LTO, PGO-ready flags
  • Service debloating: Remove unnecessary systemd services and packages

Raspberry Pi Scripts

  • F2FS root filesystem: Better performance and longevity on SD cards/USB
  • APT optimization: Parallel downloads, compression, auto-upgrade config
  • Modern tooling: fd, ripgrep, bat, eza, zoxide, navi, yt-dlp
  • Kernel compilation: Optimized flags for Pi hardware
  • Interactive package management: TUI with fzf/skim integration
  • Automated Pi-hole/PiKISS setup: Optional external installers

πŸ“‹ Requirements

Arch/CachyOS

  • Base: bash 5.0+, coreutils, sudo
  • Package managers: pacman (+ optional: paru/yay for AUR)
  • Optional: flatpak, rustup, npm, python/uv, topgrade, mise

Raspberry Pi

  • Base: bash 5.0+, coreutils, sudo, rsync
  • OS: Debian-based (Raspbian, Raspberry Pi OS, DietPi)
  • For raspi-f2fs.sh: f2fs-tools, parted, xz-utils, fzf (optional)
  • For Kbuild.sh: build-essential, bc, flex, bison, libssl-dev

πŸ”’ Safety Features

  • Dry-run mode: Preview actions with -d / --dry-run
  • Error handling: set -euo pipefail, ERR traps with line numbers
  • Cleanup traps: Automatic temp file/mount cleanup on EXIT/INT/TERM
  • Device locking: Prevents concurrent operations (raspi-f2fs.sh)
  • USB/MMC validation: Safety checks for destructive operations
  • Pacman lock cleanup: Automatic handling of stale locks

πŸ“– Usage Examples

Example 1: Setup fresh Arch system

# Clone repo
git clone https://github.com/Ven0m0/Linux-OS.git
cd Linux-OS/Cachyos

# Run setup (adds repos, configures system)
./setup.sh

# Install AUR helper if needed
sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/paru.git && cd paru && makepkg -si

# Update system
./up.sh

# Optional: cleanup
./clean.sh

Example 2: Flash DietPi to Raspberry Pi with F2FS

# Download script
wget https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/RaspberryPi/raspi-f2fs.sh
chmod +x raspi-f2fs.sh

# Flash DietPi to /dev/sdb with SSH enabled
sudo ./raspi-f2fs.sh -i dietpi -d /dev/sdb -s

# Or interactive mode (prompts for device)
sudo ./raspi-f2fs.sh

Example 3: Raspberry Pi initial setup

# Clone repo on Pi
git clone https://github.com/Ven0m0/Linux-OS.git
cd Linux-OS/RaspberryPi/Scripts

# Run setup with minimal profile (no external installers)
./setup.sh --minimal

# Update system
cd .. && ./update.sh

# Cleanup
./PiClean.sh

Example 4: One-liner updates

# Arch: Update everything
curl -fsSL https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/Cachyos/up.sh | bash

# Pi: Update + cleanup
curl -fsSL https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/RaspberryPi/update.sh | bash && \
curl -fsSL https://raw.githubusercontent.com/Ven0m0/Linux-OS/main/RaspberryPi/PiClean.sh | bash

πŸ§ͺ Development

Code Standards

  • Strict mode: set -euo pipefail, shopt -s nullglob globstar
  • Linting: shellcheck (severity=style), shfmt (2-space indent)
  • Testing: bats-core for unit tests, manual integration testing
  • Performance: hyperfine for benchmarking critical paths
  • See: CLAUDE.md for detailed guidelines

Helper Functions

All scripts include standardized helpers (from Shell-book.md):

  • has() - Command existence check
  • log/msg/warn/err/die() - Logging hierarchy
  • dbg() - Debug logging (enabled via DEBUG=1)
  • Trans flag color palette (LBLU/PNK/BWHT)

Tool Hierarchy (with fallbacks)

Task Primary Fallback Chain
Find fd fdfind β†’ find
Grep rg grep -E
View bat cat
Edit sd sed -E
Web aria2c curl β†’ wget
JSON jaq jq
Parallel rust-parallel parallel β†’ xargs -P

🀝 Contributing

Contributions welcome! Please follow:

  1. Bash standards: See CLAUDE.md for style guide
  2. Testing: Run shellcheck and test on target systems
  3. Atomic commits: One logical change per commit
  4. Descriptive messages: Explain "why" not "what"
  5. Documentation: Update README and inline comments

πŸ“š Additional Resources


πŸ”— Links


⚠️ Disclaimer

These scripts perform system-level operations. Always review scripts before running, especially those executed with curl | bash. Use at your own risk. Backup important data before running destructive operations (raspi-f2fs.sh, debloat.sh, etc.).


πŸ“„ License

MIT License - See individual files for details. Scripts are provided as-is without warranty.


Made with ❀️ for the Arch and Raspberry Pi communities

About

My personal linux related stuff. Experimental and only meant for fun and for myself

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Contributors 8