Skip to content

Instantly share code, notes, and snippets.

@w3bservice
w3bservice / bogonsblocks.sh
Created March 18, 2018 13:23 — forked from vagnernogueira/bogonsblocks.sh
Firewall-D and IPSETs
#!/bin/bash
# geoip on firewall in centos 7
# this file: /etc/cron.weekly/bogonsblocks.sh
# sudo chmod +x /etc/cron.weekly/bogonsblocks.sh
## create tmp dir
# sudo mkdir /var/tmp/ipbogons
## create list on ipset
# sudo ipset create bogonslist hash:net maxelem 1000000
## create rule on firewall-cmd
@w3bservice
w3bservice / modsec-clamscan.lua
Created April 1, 2018 10:54 — forked from angeloxx/modsec-clamscan.lua
ModSecurity ClamAV integration script (LUA)
#!/usr/bin/lua
--[[
This script can be used to inspect uploaded files for viruses
via ClamAV. To implement, use with the following ModSecurity rule:
SecRule FILES_TMPNAMES "@inspectFile /opt/modsecurity/bin/modsec-clamscan.lua" "phase:2,t:none,log,deny"
Author: Angelo Conforti (based on Josh Amishav-Zlatin code)
Requires the clamav-server and clamav-scanner
smtpd_recipient_restrictions =
reject_invalid_hostname,
reject_unknown_recipient_domain,
reject_unauth_pipelining,
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unverified_recipient,
reject_non_fqdn_sender,
@w3bservice
w3bservice / Postfix SMTPD Restrictions
Created May 13, 2018 18:20 — forked from stevejenkins/Postfix SMTPD Restrictions
SteveJ's Postfix SMTPD Restrictions
# SMTPD Restrictions v2015-06-02
# NOTE: Overiding restrictions are in master.cf for submission and other services
smtpd_helo_required = yes
disable_vrfy_command = yes
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
permit_dnswl_client list.dnswl.org=127.0.[2..14].[2..3],
@w3bservice
w3bservice / 01 main.cf
Created May 13, 2018 18:21 — forked from kraba/01 main.cf
Postfix (RBL/DNSBL/BL) + Dovecot + Postgrey + Spamassassin + Clamav + Sieve + Roundcube + Postfixadmin : https://wiki.matteobasso.com/Postfix_%26_Dovecot_:_installation_procedure
biff = no
myhostname = mail.mysite.org
mydomain = mysite.org
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
@w3bservice
w3bservice / postfix commands
Created May 13, 2018 18:21 — forked from rushipkar90/postfix commands
postfix commands
Ref Links:
=============
https://jvulinux.wordpress.com/2014/12/26/commands-to-check-spamming-in-postfix-mail-server/
https://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html
=============
Commands to check spamming in POSTFIX mail server
1. To see the mail queue:
@w3bservice
w3bservice / autopgsqlbackup
Created August 24, 2018 14:16 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@w3bservice
w3bservice / configure_apcupsd
Created April 4, 2020 07:46 — forked from gschora/configure_apcupsd
configuring apcupsd to suspend all running VM and then shutdown the esxi 5.5 u1 host
###############################################################################################################
# these are instructions for automating the suspend and shutdown of esxi vm's and host in case of a
# power failure.
# works with apc smartups 750xl and esxi 5.5u1
###############################################################################################################
0# make a new VM and install Ubuntu-Server on it
1# install apcupsd
apt-get install apcupsd