Skip to content

Instantly share code, notes, and snippets.

# remove specific emails from the postqueue
mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == "[email protected]" && $9 == "")
print $1 }
' | tr -d '*!' | postsuper -d -
# ssh-keygen options
ssh-keygen -t ed25519 -f ssh_host_ed25519_key -N "" < /dev/null
ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key -N "" < /dev/null
# useful debugging on console
>>> import os
>>> os.environ['TDSDUMP'] = 'stdout'
>>>
>>> import pymssql
>>> conn = pymssql.connect(server="sqlserverhost")
# py3-extended unpacking
a, *b, c = [1, 2, 3, 4, 5]