APKHunt Tutorial: Static Android APK Security Analysis
Install APKHunt on Kali, scan InsecureShop, and manually validate MASVS-style static findings including an exported-activity false negative.
Pentest Lab Setup: Kali Linux and Metasploitable 2 on VirtualBox
Build a penetration testing lab on VirtualBox: host-only network, Kali Linux attacker VM, and a Metasploitable 2 target, with DVWA running inside Kali for authorized ethical hacking practice.
Set Up an Android Pentesting Lab with Android Studio Emulator (AVD)
Build a free Android pentesting lab on Kali with Android Studio AVD, pick a Google APIs image without Play Store, verify adb, and sideload a vulnerable APK for authorized mobile testing.
Move Files Between Git Repositories and Preserve History
Move selected files or directories from one Git repository into an existing target repository with git filter-repo, then merge the filtered history without losing commit messages, authors, or dates.
Build a Bash CLI with Arguments, Validation, Tests and CI
Build a Bash command-line tool with short and long options, argument validation and predictable exit codes, then test it with Bats and automate checks in CI.
Create Linux Users from a File with Bash
Build a safe Bash bulk user creation script that reads colon-delimited records, validates usernames shells and groups, skips existing accounts, supports dry-run, and creates locked or one-time-password users without …
Bash Log Analyzer Script
Build a Bash log analyzer for Nginx Combined Log Format with one gawk pass, top IP and path reports, top user agents, 4xx and 5xx sections, byte totals, CSV export, malformed-line handling, and a sample log you can diff …
Bash Backup Script with rsync: Incremental Backups, Logging and Cron
Create an automated Bash backup script with rsync incremental snapshots, logging, retention and cron scheduling, then test that your files can be restored.
Linux System Health Check Script in Bash
Build a Bash system health check script that scores host-level CPU utilization, load averages, available memory, swap, disk space, inodes, and failed systemd units against thresholds, returns a clear exit code, and …
Bash Disk Usage Alert Script
Build a Bash disk usage alert script with df -P parsing, warning and critical thresholds, logging, state-file deduplication, recovery notifications, email and webhook hooks, synthetic fixture tests, flock overlap …
Run SSH Commands on Multiple Servers with Bash
Run SSH commands on multiple Linux servers from a Bash hosts-file loop with BatchMode, ConnectTimeout, ssh -n, exit codes, bounded parallelism, and bash -s for local scripts.
Bash as a Docker Entrypoint: PID 1, Signals and exec
Write a Bash Docker entrypoint with exec form ENTRYPOINT, exec "$@" for PID 1 handoff, test SIGTERM with podman stop, compare shell vs exec form, and know when --init or a minimal wrapper beats a Bash supervisor.
Call REST APIs from Bash with curl and jq
Call REST APIs from Bash with curl and jq: GET/POST/PUT/PATCH/DELETE, -sS and --fail-with-body, timeouts and retries, Bearer and API-key auth, safe query encoding, jq JSON bodies, pagination, and separating curl …
Parse JSON in Bash with jq
Parse JSON in Bash with jq: read scalars with -r, walk nested keys, filter arrays with select, pass shell values via --arg, build request bodies with jq -n, loop records with jq -c, and handle missing keys, null, and …
Linux Text Processing with grep, sed and awk
Learn Linux text processing with grep, sed, and awk on one access log: filter lines, transform text, read fields, then use cut, sort, and uniq as supporting pipeline tools in Bash pipelines.
Schedule Bash Scripts with Cron and systemd Timers
Schedule Bash scripts with user cron and systemd timers: common crontab schedules, scheduler-ready scripts, PATH and WorkingDirectory, logs, flock overlap locks, and debugging when a script works manually but fails under …
How to Measure Bash Script Execution Time
Check Bash script execution time with time ./script.sh, SECONDS, EPOCHREALTIME, and date +%s; compare Bash time vs GNU /usr/bin/time; save timing output to a file; briefly cap runtime with timeout.
Run Multiple Bash Commands in Parallel and Capture Exit Codes
Run multiple Bash commands in parallel with ampersand and wait, capture each exit code, cap concurrency with wait -n and wait -n -p worker pools, and compare xargs -P and GNU Parallel for larger batches.
Prevent a Bash Script from Running Twice with flock
Prevent a Bash script from running twice with flock: wrapper and in-script file-descriptor locks, -n and -w, conflict exit codes, cron wrappers, NFS caveats, and when PID files still help.
Run Bash Commands in Background: &, $! and wait
Learn Bash background execution with ampersand, capture child PIDs with dollar-exclamation, wait for one or many children, use wait -n and wait -p for racing tasks, handle stdin and exit codes, and clean up children on …
How to Test Bash Scripts with Bats (Bash Unit Testing)
Learn how to unit test Bash scripts with Bats: run, exit status, separate stderr, setup and teardown, fixtures, bats-assert, parallel jobs, debugging flags, and CI JUnit reports using one check-config CLI.
Bash Best Practices for Production Scripts
Production Bash best practices as a decision checklist: when to use Bash, quoting, arrays, strict mode caveats, traps, mktemp, idempotency, secrets, locks, timeouts, ShellCheck, and when to move to another language.
Lint and Format Bash with ShellCheck and shfmt
Learn how to lint Bash scripts with ShellCheck, format them with shfmt, configure project rules, fix common warnings, and enforce both tools in CI.
Debug Bash Scripts with bash -x, PS4 and LINENO
Learn how to debug Bash scripts with bash -x, set -x, bash -n, PS4 line numbers, ShellCheck, and BASH_XTRACEFD, with practical examples and trace output.
Bash trap: Signals, EXIT and Cleanup
Learn Bash trap for EXIT cleanup, SIGINT and SIGTERM handling, reading exit status in EXIT traps, ERR traps with set -E, signal forwarding to children, and what signals cannot be caught.
Bash mktemp: Create Temporary Files and Directories Safely
Learn how Bash mktemp creates temporary files and directories safely, use templates and TMPDIR, register trap EXIT cleanup, avoid unsafe mktemp -u, and atomically replace files on the same filesystem.
Logging in Bash Scripts
Learn Bash script logging: stdout vs stderr, a minimal log function with levels and timestamps, tee, exec redirects, logger for syslog/journald, systemd capture, rotation, and keeping secrets out of logs.
Bash set vs shopt: How Shell Options Work
Learn why Bash has both set and shopt, how to enable and check shell options, and when to use nullglob, failglob, lastpipe, and inherit_errexit in scripts.
Bash Error Handling: Practical Patterns for Reliable Scripts
Learn Bash error handling with exit codes, set -e exceptions, trap ERR, expected grep and diff statuses, bounded retries with backoff, batch partial failure, stderr diagnostics, and trap EXIT cleanup.
Bash Strict Mode: `set -euo pipefail` Explained
Learn what set -euo pipefail does in Bash, when set -e does not exit, how nounset and pipefail behave, and the common strict-mode pitfalls in functions, pipelines, and command substitution.

