Skip to content

Instantly share code, notes, and snippets.

# ============================================
# Nmap Aliases (nmap.*)
# ============================================
# Assumes nmap is installed. Many scans require sudo.
# ============================================
# Example Usage:
# ============================================
# ============================================
# Linux Server Management Helper Functions & Aliases
# Designed for execution FROM local machine TARGETING remote server(s).
# ============================================
# Assumes passwordless SSH key authentication is set up for target hosts.
# --- Core Remote Execution Function ---
# Usage: _srv_remote_exec <user@host> <command_string...>
_srv_remote_exec() {
local target="$1"
# ============================================
# Cross-Platform Network Configuration Aliases
# ============================================
# ============================================
# Helper Funcs
# ============================================
# --- Function to get OS type (same as before) ---
_net_get_os() {
# ============================================
# Cross-Platform Network Info Aliases (net.*)
# ============================================
# ============================================
# Helper Functions
# ============================================
# ============================================
# OpenSSL Aliases (ossl.*)
# --------------------------------------------
# Hashing / Message Digests
# --------------------------------------------
# Calculate MD5 hash of a file (Use SHA instead where possible)
# (Append FILENAME)
alias ossl.hash.md5='openssl dgst -md5'
# Calculate SHA1 hash of a file (Use SHA256+ where possible)
# (Append FILENAME)
# ============================================
# SSH Related Aliases
# --------------------------------------------
# Connection Options & Verbosity
# --------------------------------------------
# Connect disabling password authentication (force key-based)
# (Append user@host)
alias sshnp='ssh -o PasswordAuthentication=no'
# Connect with SSH Agent Forwarding (Use cautiously!)
# (Append user@host)
# ============================================
# GPG Aliases
# --------------------------------------------
# Key Listing & Fingerprints
# --------------------------------------------
# List public keys (short ID format) - Existing
alias gpg.list='gpg --list-keys --keyid-format SHORT'
# List public keys (long ID format)
alias gpg.list.long='gpg --list-keys --keyid-format LONG'
# List public keys with full fingerprints