Skip to content

Instantly share code, notes, and snippets.

View ramit-mitra's full-sized avatar
✔️

Ramit Mitra ramit-mitra

✔️
View GitHub Profile
@ramit-mitra
ramit-mitra / compose.yaml
Created April 7, 2024 14:49
Self hosted Wordpress setup using docker compose (using arm64 images)
services:
service__mariadb:
image: arm64v8/mariadb:latest
volumes:
- ./data/mariadb:/var/lib/mysql
restart: unless-stopped
environment:
MARIADB_ROOT_PASSWORD: <enter_your_value>
MYSQL_ROOT_PASSWORD: <enter_your_value>
MYSQL_DATABASE: <enter_your_value>
@ramit-mitra
ramit-mitra / report_ips_to_abuseipdb.sh
Last active November 1, 2023 17:30
Report abusive IPs to AbuseIPDB
#!/bin/bash
# Example: curl -sk https://gist.githubusercontent.com/ramit-mitra/5b9c93f8354f2a41ac94f09e3a38c517/raw/report_ips_to_abuseipdb.sh | bash
url="https://raw.githubusercontent.com/ramit-mitra/blocklist-ipsets/main/rottenIPs.json"
echo "-------------------------"
echo "Reading Banlist IPs"
blocked_ips=$(curl -s $url | jq -r '.[]')
@ramit-mitra
ramit-mitra / ufw_block_banned_ips.sh
Last active November 1, 2023 17:27
Block banned IPs using UFW
#!/bin/bash
# Example: curl -sk https://gist.githubusercontent.com/ramit-mitra/f72b16b34099f85b3423bd32f63930c3/raw/ufw_block_banned_ips.sh | bash
url="https://raw.githubusercontent.com/ramit-mitra/blocklist-ipsets/main/rottenIPs.json"
echo "-------------------------"
echo "Reading Banlist IPs..."
blocked_ips=$(curl -s $url | jq -r '.[]')
@ramit-mitra
ramit-mitra / block_banned_ips.sh
Last active December 22, 2022 14:39
This script helps block banned IPs using fail2ban in Linux
#!/bin/bash
# Example: curl -s https://gist.githubusercontent.com/ramit-mitra/f5e9c4f9adc4a155ebcce2608bc50f39/raw/block_banned_ips.sh | bash
url=https://raw.githubusercontent.com/ramit-mitra/blocklist-ipsets/main/rottenIPs.json
jail_names=($(fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'))
blocked_ips=$(curl -s $url | jq -r '.[]')
echo "-------------------------"
@ramit-mitra
ramit-mitra / cron_tasks.sh
Last active December 19, 2022 16:27
Personal CRON tasks (for Ubuntu)
#!/bin/bash
# Personal cron tasks script file
# General housekeeping stuff
# Example usage:
# curl -s https://gist.githubusercontent.com/ramit-mitra/32f3844608c2af97fc8a41bcc1f48ee5/raw/cron_tasks.sh | bash
hour=$(date +"%H")
minute=$(date +"%M")