Skip to content

Instantly share code, notes, and snippets.

View mietzen's full-sized avatar

Nils mietzen

  • Germany
  • 08:25 (UTC +01:00)
View GitHub Profile
@mietzen
mietzen / bump-version
Last active August 16, 2023 04:59 — forked from siddharthkrish/version.sh
simple bash script to increment the version number of the format major.minor.bug
#!/usr/bin/env bash
help () {
echo "usage: ./bump-version version_number [major/minor/bug]"
}
# Check input remove prepending 'v'
if grep -q -c -E '^v?[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}$' <<< ${1}; then
version=$(sed 's/^.\{1\}//g' <<< ${1})
else
@mietzen
mietzen / block_badips.sh
Last active April 8, 2021 18:28 — forked from Aikhjarto/block_badips.sh
Fetch a list of known brute force attackers from abuseipdb.com and apply/update iptables DROP rules
#!/bin/bash
# This a replacement Aikhjarto/block_badips.sh, using https://www.abuseipdb.com/ since badips.com seems to be offline :(
# This script downloads a list of IPs known for brute force attacking.
# The fetched IPs get blocked with iptables with the special comment "BADIP". This script only
# modifies iptables rules with that comment. This measure makes it well compatible with other firewall
# scripts like the SUSEFirewall.
# The iptables rules are updated every time this script is executed. Additionally this script is
# quiet on stdout, which makes it well suited for being executed as a cronjob.
# TODO Block ipv6