Skip to content

Instantly share code, notes, and snippets.

#!/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
#!/usr/bin/env bash
# Usage: ./run.sh <ips.csv>
set -euo pipefail
IP_CSV="$1"
OUT_LOG="combined-output.log"
# 1) Clear the single output file
: > "$OUT_LOG"
#!/usr/bin/env python3
import ipaddress, csv
# ◼ Adjust these file‐names/paths as needed
CIDR_FILE = 'cidrs.tsv'
IP_FILE = 'ips.txt'
OUTPUT_FILE = 'matched.tsv'
# 1) Load and parse your CIDRs
networks = []