Skip to content

Instantly share code, notes, and snippets.

@jkullick
jkullick / postfix-null-client-config.md
Last active July 29, 2016 10:39
Postfix Null Client Config

/etc/postfix/main.cf

smtpd_banner = $myhostname ESMTP
myhostname = $HOSTNAME
mydestination =
relayhost =
mynetworks = 127.0.0.0/8
inet_interfaces = loopback-only
inet_protocols = ipv4
@jkullick
jkullick / nginx-reverse-proxy-config.md
Last active July 29, 2016 10:54
Nginx Reverse Proxy Configuration
upstream $PROXY_NAME {
  server 127.0.0.1:$PROXY_PORT;
}

server {
  location / {
    proxy_set_header  Host      $host;
    proxy_set_header  Proxy     "";
 proxy_set_header X-Real-IP $remote_addr;
@jkullick
jkullick / exchange-force-database-switch.md
Last active July 29, 2016 11:52
Force Exchange to switch over to other Database
Move-ActiveMailboxDatabase $DATABASE -ActivateOnServer $SERVER -SkipLagCheck -SkipClientExperience -SkipHealthChecks -MountDialOverride:None
@jkullick
jkullick / osx-flush-dns-cache.md
Last active July 29, 2016 11:52
Flush DNS Cache in macOS
sudo killall -HUP mDNSResponder
@jkullick
jkullick / linux-activate-hot-added-memory.md
Last active July 29, 2016 11:54
Activate Hot-Added Memory in Linux
grep offline /sys/devices/system/memory/*/state | \
  cut -d: -f1 | \
  while read -r mem; do 
    echo online > "$mem";
  done
@jkullick
jkullick / linux-ext4-remove-reserved-blocks.md
Last active July 29, 2016 11:56
Remove Reserved Blocks from Ext4 Partition
tune2fs -m 0 /dev/sda1
@jkullick
jkullick / check-open-port-netcat.md
Last active July 29, 2016 11:57
Check Open Port with netcat
nc -z $SERVER $PORT
@jkullick
jkullick / wget-download-ftp-files-recursive.md
Last active July 29, 2016 11:57
Download Files recursively from FTP with wget
wget -r -l inf -nH -nc --restrict-file-names=nocontrol ftp://$USER:'$PASSWORD'@$SERVER/
@jkullick
jkullick / iptables-basic-rules.md
Last active July 29, 2016 11:57
Basic IPTables Rules
# keep ssh connection alive
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

# reset iptables rules/chains
iptables -F
iptables -X
iptables -t nat -F
@jkullick
jkullick / postfix-delete-mail-queue.md
Last active July 29, 2016 11:57
Delete all Mails in Postfix Queue
postsuper -d ALL