Keeping your server up to date is essential for security. Ubuntu's unattended-upgrades package handles this automatically. Install unattended-upgrades sudo apt install unattended-upgrades Enable Automatic Updates sudo dpkg-reconfigure --priority=low unattended-upgrades Configure Update Behavior Edit /etc/apt/apt.conf.d/50unattended-upgrades to control which packages are updated and whether the server auto-reboots: Unattended-Upgrade::Automatic-Reboot "true"; Unattended-Upgrade::Automatic-Reboot-Time "02:00"…
Master your systems with precision and ease.
Comprehensive guides for Windows, Linux, macOS, and beyond. Step-by-step instructions designed for modern developers and system administrators.
A default SSH configuration is a common attack target. These steps reduce your attack surface significantly by changing defaults and restricting access. Change the Default Port Edit /etc/ssh/sshd_config and change: Port 2222 Disable Root Login PermitRootLogin no Limit Login Attempts MaxAuthTries 3 Restrict to Specific Users AllowUsers alice bob Use Fail2Ban to Block Brute Force sudo apt install fail2ban sudo systemctl enable fail2ban Restart SSH after changes: sudo systemctl restart sshd
The tar command creates and extracts archive files on Linux and macOS. Combined with gzip or bzip2, it produces compressed archives widely used for backups and distribution. Create a Compressed Archive tar -czvf archive.tar.gz /path/to/folder Extract an Archive tar -xzvf archive.tar.gz Extract to a Specific Directory tar -xzvf archive.tar.gz -C /destination/ List Archive Contents tar -tzvf archive.tar.gz Create a bzip2 Archive tar -cjvf archive.tar.bz2 /path/to/folder
Monitoring log files in real time is a critical skill for system administrators. The tail and grep commands are your primary tools for this task. Follow a Log File in Real Time tail -f /var/log/syslog Show Last N Lines tail -n 100 /var/log/nginx/error.log Filter Logs with grep tail -f /var/log/nginx/access.log | grep "404" Search Across Multiple Log Files grep -r "ERROR" /var/log/ Case-Insensitive Search grep -i "warning" /var/log/syslog Show Context Around a Match grep -C 3 "segfault" /var/log/syslog
curl is a command-line tool for making HTTP requests. It is indispensable for testing REST APIs, downloading files, and debugging web services. Basic GET Request curl https://api.example.com/users POST Request with JSON Body curl -X POST https://api.example.com/users -H "Content-Type: application/json" -d '{"name": "John", "email": "[email protected]"}' Set Authorization Header curl -H "Authorization: Bearer YOUR_TOKEN" https://api.example.com/me Save Response to File curl -o response.json…
Git is the most widely used version control system. This guide walks through installing Git, configuring your identity, and creating your first repository. Install Git sudo apt install git # Debian/Ubuntu brew install git # macOS Configure Identity git config --global user.name "Your Name" git config --global user.email "[email protected]" Initialize a Repository mkdir myproject && cd myproject git init git add . git commit -m "Initial commit" Connect to GitHub git remote add origin https://github.com/user/repo.git…
Rsync is the standard tool for fast, incremental file transfer and synchronization on Linux and macOS. It copies only what has changed, making it very efficient for backups. Basic Syntax rsync -avz source/ destination/ Sync to a Remote Server rsync -avz -e ssh /local/path/ user@server:/remote/path/ Dry Run (Preview Changes) rsync -avzn source/ destination/ Exclude Files rsync -avz --exclude="*.log" --exclude="node_modules/" source/ destination/ Delete Files Removed from Source rsync -avz --delete source/…
GPIO (General Purpose Input/Output) pins allow the Raspberry Pi to interact with hardware — LEDs, sensors, relays, and more. This guide introduces GPIO control using Python. Install RPi.GPIO Library sudo apt install python3-rpi.gpio Blink an LED import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.OUT) for _ in range(10): GPIO.output(18, GPIO.HIGH) time.sleep(0.5) GPIO.output(18, GPIO.LOW) time.sleep(0.5) GPIO.cleanup() Read a Button Input GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP)…
A Raspberry Pi makes an excellent low-power home server for file sharing, media streaming, or self-hosted services. This guide sets up the basics. Install Raspberry Pi OS Lite Use the headless (Lite) version for a server — no desktop environment needed, saving RAM and CPU. Assign a Static IP Edit /etc/dhcpcd.conf : interface eth0 static ip_address=192.168.1.50/24 static routers=192.168.1.1 static domain_name_servers=1.1.1.1 Install Common Server Software sudo apt install nginx mariadb-server php-fpm Enable…
Raspberry Pi OS (formerly Raspbian) is the official operating system for Raspberry Pi boards. This guide walks through the complete installation process using Raspberry Pi Imager. Download Raspberry Pi Imager Download it from raspberrypi.com/software and install it on your computer. Flash the SD Card Open the Imager, choose your device (Raspberry Pi 4), select the OS, and click Write. First Boot Insert the SD card, connect keyboard, mouse, and display, then power on. The setup wizard will guide you through locale…