Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# assuming all of the instances start with "postf" e.g. "postfix-2" or "postfix-test"
mapfile -t strace_array < <( strace curl https://www.google.com |&grep 'open.*ssl' )
if [ ${#strace_array[@]} -eq 0 ]; then
echo "strace is not installed, install it with apt-get install strace or apt install strace"
else
expected_cert_path=`echo ${strace_array[-1]} | cut -d'"' -f 2`
@jamenlang
jamenlang / fix_instances.sh
Last active November 3, 2020 17:29
Dynamic postmulti management script
#!/bin/bash
# assuming all of the instances start with "postf" e.g. "postfix-2" or "postfix-test"
mapfile -t instance_array < <( find /etc* -maxdepth 1 -type d -name "postf*" -printf "%f\n" )
for instance in "${instance_array[@]}"
do
echo "copying resolv.conf for ${instance}"
cp /etc/resolv.conf "/var/spool/${instance}/etc/resolv.conf"
echo "updating ssl certs for ${instance}"
@jamenlang
jamenlang / hangups set-presence.py
Last active February 9, 2018 15:32
custom hangups script for setting status
"""Example of using hangups to set presence."""
import asyncio
import hangups
import urllib.request
from common import run_example
async def set_presence(client, args):