Skip to content

Instantly share code, notes, and snippets.

@MarcelFox
MarcelFox / list-grub-entries.sh
Created December 7, 2022 19:19 — forked from nderjung/list-grub-entries.sh
List grub entries
awk -F\' '$1=="menuentry " || $1=="submenu " {print i++ " : " $2}; /\tmenuentry / {print "\t" i-1">"j++ " : " $2};' /boot/grub/grub.cfg
@MarcelFox
MarcelFox / iptables.sh
Last active December 15, 2020 04:39 — forked from scorredoira/iptables.sh
iptables rules
# flush iptable rules
iptables -F
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
# Allowing DNS lookups (tcp, udp port 53)
iptables -A OUTPUT -p tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
@MarcelFox
MarcelFox / setup-mailserver-1.sh
Created May 30, 2018 21:04 — forked from ruanbekker/setup-mailserver-1.sh
Mail Server Virtual Users with MySQL Postfix Dovecot on CentOS
#!/bin/bash
# blog: https://sysadmins.co.za/mail-server-virtual-users-mysql-postfixadmin-on-centos/
# dependencies
yum update -y
yum --enablerepo=centosplus install postfix mailx mutt -y
yum install dovecot mysql-server dovecot-mysql cyrus-sasl cyrus-sasl-devel -y
# mysql configuration
chkconfig mysqld on
#!/bin/bash
echo -e "\nLista de Inodes do diretório: $(pwd)\n\n" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; echo -e "$c\t\t- $d"; done | sort -nr ;echo -e "\nTotal: \t\t$(find $(pwd) | wc -l)"
@MarcelFox
MarcelFox / 01_postfix_installer.md
Last active December 17, 2020 20:40 — forked from solusipse/01_postfix_installer.md
Postfix + Dovecot + Postgresql + Postfixadmin + Roundcube + Opendkim

Postfix Installer

Following script may be used for configuring complete and secure email server on fresh install of Debian 9. It will probably work on other distributions using apt-get. After minor changes you'll be able to use it on other Linux distros.

What it does?

02_postfix.sh:

  • Install Postfix and configure it with TLS support.
  • Install Dovecot and configure it's transport on Postfix.
  • Download, extract and correct permissions for Postfixadmin.
  • Download, extract and correct permissions for Roundcube.