Skip to content

Instantly share code, notes, and snippets.

@viktordw
viktordw / basic_bind9_configuration.md
Created October 31, 2023 17:57 — forked from jmndoza/basic_bind9_configuration.md
Create your own DNS server with bind9

Bind9 Basic Domain Configuration

Example Domain: mydomain.com

Install Bind9

foo@bar:~$ apt-get install bind9
foo@bar:~$ cd /etc/bind
@viktordw
viktordw / loops.md
Last active October 4, 2023 12:41 — forked from hluaces/loops.md
List of ISP feedback looops

This list was originally present the wiki for this mailserver repository wiki page. I've created a gist with it as it is something that can be useful per se and I'd like to keep a copy of it.

A Feedback Loop (FBL) is a system by which an Internet Service Provider provides the sender a copy of the message that one of their subscribers has reported as spam — usually by hitting a “report spam” button in that ISP’s mail interface.

ISPs offer feedback loops to qualified senders, so the senders can identify subscribers who no longer want to receive similar mail and/or any problems originating from their networks, such as virus-infected spam-producing machines.

This page summarizes the information about FBL signup pages, whitelist pages, and postmaster pages of most popular ISPs around the world.

ISP Info Postmaster Page
@viktordw
viktordw / accounts.list
Created May 4, 2023 12:08 — forked from onlime/accounts.list
imapsync script to migrate multiple IMAP accounts in a row
# <SRCUSER> <SRCPW> <DSTUSER> <DSTPW>
declare -a DIRS
savedir() {
local i
for ((i=1;i<=9;i++)); do
test "$1" = "${DIRS[$i]}" && return
done
for ((i=9;i>1;i--)); do
DIRS[$i]="${DIRS[((i-1))]}"
done
@viktordw
viktordw / disable-comments.sh
Created August 30, 2022 07:59 — forked from jplhomer/disable-comments.sh
Disable all comments/pings in WordPress with WP-CLI
$ wp post list --format=ids | xargs wp post update --comment_status=closed
# Output:
# Success: Updated post 2514.
# Success: Updated post 2511.
# Success: Updated post 2504.
# Success: Updated post 2499.
# Success: Updated post 2441.
# etc...
@viktordw
viktordw / checkmk-install.sh
Created August 12, 2022 13:55
Install checkmk monitoring server
#!/bin/bash
# https://checkmk.com/download
if [ -n `command -v ufw` ]; then
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw reload
fi
@viktordw
viktordw / ip-check.sh
Created August 12, 2022 13:11
Check public IP address of server
#!/bin/bash
# NOTE: route command is part of dnsutils package on Debian, and net-tools on Ubuntu
# Based on following Stack Overflow answer:
# https://stackoverflow.com/questions/14594151/methods-to-detect-public-ip-address-in-bash/22209864#22209864
MAINIF=$( route -n | grep '^0\.0\.0\.0' | head -n 1 | awk '{print $NF}' )
IP=$( ifconfig $MAINIF | awk -v row=2 'FNR == 'row' {print $2}' )
echo $IP
@viktordw
viktordw / uset-wp-install.sh
Last active February 24, 2022 15:01
WordPress installation script - taken from https://github.com/sitemapxml/USet
#!/bin/bash
# WordPress install script
# This is a snippet from USet. It is not functional on its own.
# Project URL: https://github.com/sitemapxml/USet
# config.txt
# Wordpress settings
conf_wp_wget_locale='https://wordpress.org/latest.tar.gz'
conf_wp_aditional_php_extensions='php-xmlrpc php-exif'
@viktordw
viktordw / pager.sh
Created February 10, 2022 15:07
Less pager
#!/bin/bash
text=$(curl -s 'https://baconipsum.com/api/?type=meat-and-filler')
pager() {
# if stdout is not to a TTY, copy directly w/o paging
[ -t 1 ] || { cat; return; }
if [ -n "$PAGER" ]; then
"$PAGER"
@viktordw
viktordw / gist:c9e4adfac8d5dcff6004a724f257bc36
Created December 25, 2021 11:18 — forked from reikind/gist:4072830
Example bash getopts
#!/bin/bash
usage() {
cat << EOT
usage $0 [-hgw]
$0 -m MESSAGE
OPTIONS