# Send form data
curl -X POST https://example-webhook.com/your-id -d "data1=value1&data2=value2"
# Send JSON data
curl -X POST -H "Content-Type: application/json" \
https://example-webhook.com/your-id \
-d '{"key1":"value1","key2":"value2"}'
# Upload a file/image
curl -X POST https://example-webhook.com/your-id -F "file=@image.jpg"
Advanced Curl
# Add Authorization header
curl -H "Authorization: Bearer YOUR_API_TOKEN" https://api.example.com/data
# Post to an IoT feed (e.g., Adafruit IO)
curl -H "X-AIO-Key: YOUR_AIO_KEY" \
-F "value=on" \
https://io.adafruit.com/api/v2/YOUR_USERNAME/feeds/YOUR_FEED/data
# Save output to file
curl -o file.html https://example.com
# Download file with same name
curl -O https://example.com/file.zip
# Show only headers
curl -I https://example.com
# Verbose (debugging)
curl -v https://example.com
Webhook Testing
# Steps:
# 1. Go to https://webhook.site
# 2. Copy your unique URL
# 3. Send requests using curl
# Example POST test
curl -X POST https://webhook.site/your-unique-id -d "test=hello"
MQTT with Curl
# Subscribe to topic
curl mqtt://mqtt.eclipseprojects.io/topic_name
# Force output to terminal
curl mqtt://mqtt.eclipseprojects.io/topic_name --output -
# Save messages to file
curl mqtt://mqtt.eclipseprojects.io/topic_name --output data.txt
# Publish message
curl -d "Hello" mqtt://mqtt.eclipseprojects.io/topic_name
# Get current time (Kolkata timezone)
curl "https://timeapi.io/api/Time/current/zone?timeZone=Asia/Kolkata"
FTP Upload
# Upload file to FTP server
curl -k -T file.jpg ftp://USERNAME:PASSWORD@ftp.example.com/htdocs/uploads/
# Access uploaded files (paste in Windows File Explorer address bar)
# ftp://USERNAME:PASSWORD@ftp.example.com/htdocs/
💡 Replace USERNAME, PASSWORD, and ftp.example.com with your actual FTP credentials.
Nmap
🔧 Installation (Windows): Download from
nmap.org/download.html
→ Run the .exe installer → ✅ Check "Add Nmap to PATH"
# Basic scan
nmap google.com
# Scan specific ports
nmap -p 22,80,443 192.168.1.1
# Scan all ports
nmap -p 1-65535 192.168.1.1
# Detect OS
nmap -O 192.168.1.1
PowerShell Test-NetConnection
✅ Built-in PowerShell utility — no installation required.
# Ping test
Test-NetConnection google.com
# Test HTTPS port
Test-NetConnection google.com -Port 443
# Trace route
Test-NetConnection google.com -TraceRoute
# Check RDP port (Remote Desktop)
Test-NetConnection -ComputerName 192.168.1.10 -Port 3389
# Check SMB port (file sharing)
Test-NetConnection -ComputerName 192.168.1.20 -Port 445
1. Leaf cert — Proves the server's identity
2. Intermediate cert — Trusted middleman linking the server cert to a root
3. Root cert — Ultimate trust anchor; already trusted by your OS/browser
SSH – Secure Shell
# Connect to a remote machine
ssh username@hostname
# Connect to a Raspberry Pi
ssh pi@192.168.0.100
ssh pi@raspberrypi
# Execute a remote command and exit
ssh user@host "ls -l"
⚙️ How remote commands work: SSH logs in → executes the command → returns output → exits automatically.
SCP – Secure File Transfer
# Copy local file to remote machine
scp file.txt user@host:/remote/path/
# Copy file from remote to local
scp user@host:/remote/path/file.txt .
# Copy entire directory recursively
scp -r local-folder/ user@host:/remote/path/