Skip to content

Instantly share code, notes, and snippets.

View drscream's full-sized avatar
🕶️
Focusing

Thomas Merkel drscream

🕶️
Focusing
View GitHub Profile
#!/bin/bash
configfile='/tmp/myconfig.cfg'
configfile_secured='/tmp/myconfig_secured.cfg'
# check if the file contains something we don't want
if egrep -q -v '^#|^[^ ]*=[^;]*' "$configfile"; then
echo "Config file is unclean, cleaning it..." >&2
# filter the original to a new file
egrep '^#|^[^ ]*=[^;&]*' "$configfile" > "$configfile_secured"
IFS='\n';for i in $(cat config_file); do eval $(echo $i | tr -dc '[:alnum:]/=\n'); done;IFS=' '
[ 1.573230] Initializing network drop monitor service
[ 1.599466] input: AT Raw Set 2 keyboard as /devices/mb:kmi0/serio0/input/input0
[ 1.637936] Freeing init memory: 152K
[ 1.641961] mmc0: host does not support reading read-only switch. assuming write-enable.
[ 1.644022] mmc0: new SDHC card at address 4567
[ 1.654328] mmcblk0: mmc0:4567 QEMU! 25.0 GiB
Co-routine is yielding to no one
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
diff --git a/ircd/ssl.c b/ircd/ssl.c
index debe89f..435269b 100644
--- a/ircd/ssl.c
+++ b/ircd/ssl.c
@@ -377,6 +377,8 @@ void ssl_init(void)
sslfail("SSL_CTX_use_certificate_file");
if (!SSL_CTX_use_RSAPrivateKey_file(ctx, pemfile, SSL_FILETYPE_PEM))
sslfail("SSL_CTX_use_RSAPrivateKey_file");
+ if (!SSL_CTX_use_certificate_chain_file(ctx, pemfile))
+ sslfail("SSL_CTX_use_certificate_chain_file");
#!/usr/bin/env python
# core-ns-download
# Check and download zip archive with zone information but only
# if required.
import requests
import os, zipfile
import argparse
from io import BytesIO
import json
#!/bin/bash
MUNIN_CONF=${1-'/opt/local/etc/munin/munin.conf'}
grep '^\[' ${MUNIN_CONF} | tr -d '[' | tr -d ']' |\
while read line; do
if [[ "${line}" =~ ";" ]]; then
# group exists
group=$(echo ${line} | awk -F \; '{ print $1 }')
node=$(echo ${line} | awk -F \; '{ print $2 }')
#!/usr/bin/env python
import crypt, string, random, sys, getpass
def gen_salt():
letters=string.ascii_letters+string.digits # alphanumeric, upper and lowercase
return ''.join([random.choice(letters) for _ in range(8)])
if len(sys.argv) < 1:
print "Usage: %s [salt]" % (sys.argv[0])
# core.io dovecot proxy config file
# defaults
postmaster_address = postmaster@%d
auth_mechanisms = plain
protocols = imap pop3 sieve
# secure
ssl = yes
disable_plaintext_auth = yes
@drscream
drscream / exim-base
Last active August 29, 2015 14:07
Ubuntu / Debian exim-base cron script build for SmartOS
#!/usr/bin/bash
if [ -n "$EX4DEBUG" ]; then
echo "now debugging $0 $@"
set -x
fi
# set this to some other value if you don't want the panic log to be
# watched by this script, for example when you're using your own log