GPG Bash Playground

GPG Bash Playground Guide Introduction The GPG Bash Playground is an educational Bash script that demonstrates the practical use of GPG (GNU Privacy Guard) for key generation, public key exchange, encryption, and decryption. The script simulates a secure communication scenario by creating three users (Alice, Bob, and Carol), generating their GPG keys, exchanging public keys, and performing encrypted message exchanges. It includes comprehensive logging, error handling, and a debug mode for detailed output. This guide explains how to set up, run, and understand the script’s functionality. ...

September 28, 2025 · 5 min · 989 words · Manzolo

APT Package Repository Management Guide

APT Package Repository Management Guide Introduction Understanding where your installed packages come from is crucial for system maintenance, security auditing, and troubleshooting. This guide shows how to identify package sources, manage repositories, list packages by origin, and audit your APT installation on Debian/Ubuntu systems. What are Package Repositories? Package repositories are servers that host software packages for installation via APT (Advanced Package Tool). Understanding repository sources helps you: Security: Identify packages from untrusted sources Maintenance: Track PPA dependencies Troubleshooting: Find conflicting package sources System Cleanup: Remove unused repositories Documentation: Maintain installation records Repository Types Type Description Example Official Ubuntu/Debian main repositories archive.ubuntu.com PPA Personal Package Archives (Ubuntu) ppa.launchpad.net/user/repo Third-party External repositories download.docker.com Local Locally installed packages /var/lib/dpkg/status Prerequisites Debian or Ubuntu-based system Basic terminal knowledge apt, dpkg, and perl installed (usually pre-installed) 🚀 Quick Commands List All Packages with Repositories dpkg --get-selections | awk '!/deinstall$/ {print $1}' | \ xargs -I{} sh -c 'echo "=== $1 ===" && apt-cache policy "$1" | grep -E "^\s+\*\*\*" | head -1' -- {} | \ paste - - | sed 's/=== \([^ ]*\) ===/\1:/' | \ perl -pe 's/:\s+\*\*\*[^5]*500\s+/: /' | \ sed 's/\s\[.*\]$//' List Only PPA Packages dpkg --get-selections | awk '!/deinstall$/ {print $1}' | \ xargs -I{} apt-cache policy {} | \ perl -0777 -ne 'while(/^(\S+?):\n.*?\n\s+\*\*\*.*?500 http:\/\/ppa\.launchpad\.net\/([^\s\/]+)/gms) {print "$1: $2\n"}' Count Packages per Repository dpkg --get-selections | awk '!/deinstall$/ {print $1}' | \ xargs -I{} apt-cache policy {} 2>/dev/null | \ perl -0777 -ne 'while(/^(\S+?):\n.*?\n\s+\*\*\*.*?500\s+(http:\/\/[^\s]+)/gms) { $repo = $2; $repo =~ s/\s.*//; $repos{$repo}++ } END { for $r (sort keys %repos) { print "$r: $repos{$r} packages\n" } }' 📦 Complete Package Audit Script Full-featured bash script with multiple options Save as package-audit.sh: ...

October 5, 2025 · 12 min · 2355 words · Manzolo