Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Input PKCS#12 file
P12_FILE="$1"
if [[ ! -f "$P12_FILE" ]]; then
echo "❌ Usage: $0 site.p12"
exit 1
fi
#!/bin/bash
# Input PKCS#12 file
P12_FILE="$1"
if [[ ! -f "$P12_FILE" ]]; then
echo "❌ Usage: $0 site.p12"
exit 1
fi
#!/bin/bash
# === Configuration ===
SMTP_SERVER="smtp.example.com"
SMTP_PORT="25" # Use 25 for no encryption. Use 587/465 only with TLS support (see note below)
EHLO_DOMAIN="myhost.example.com"
MAIL_FROM="[email protected]"
RCPT_TO="[email protected]"
SUBJECT="Netcat Test Email"
BODY="Hello,\r\n\r\nThis is a test email sent using netcat from a Bash script.\r\n\r\nRegards,\r\nNetcat Tester"
(
printf "EHLO myhost.example.com\r\n"
sleep 1
printf "MAIL FROM:<[email protected]>\r\n"
sleep 1
printf "RCPT TO:<[email protected]>\r\n"
sleep 1
printf "DATA\r\n"
sleep 1
printf "Subject: Netcat Test Email\r\n"
while IFS= read -r line; do
# Check if the line contains a tab
if [[ "$line" == *$'\t'* ]]; then
# Split the line by tabs into an array
IFS=$'\t' read -r -a cols <<< "$line"
# Only process if at least 4 columns exist
if [[ ${#cols[@]} -ge 4 ]]; then
# Grab column 4
col4="${cols[3]}"
# Do the replacements using perl
We couldn’t find that file to show.
We couldn’t find that file to show.
openssl verify -CAfile /etc/ssl/certs/ca-bundle.crt your_cert.crt
#!/usr/bin/env zsh
set -euo pipefail
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <input_file>"
exit 1
fi
input_file=$1
#!/usr/bin/env bash
# runscript.sh
# Usage: ./runscript.sh <ip-address>
set -euo pipefail
IP_ADDRESS=${1:-}
if [[ -z $IP_ADDRESS ]]; then
echo "Usage: $0 <ip-address>" >&2
exit 1
fi