Skip to content

Instantly share code, notes, and snippets.

@e3rd
e3rd / gist:faf219c50136246616bf76df18750957
Last active September 11, 2019 09:06
IntelMQ generate collector-parser pairs for feed downloaded from Shadowserver to disk
# configure
feeds = [] # @see https://github.com/certtools/intelmq/issues/1442
files = [] # @see https://github.com/certtools/intelmq/issues/1442
rootdir = "/home/.../your-files/"
# generator
from pprint import pprint
definitions = []
@e3rd
e3rd / GPGSafe.py
Last active January 4, 2018 16:38
Since https://github.com/isislovecruft/python-gnupg/issues/49 is not fully solved, you may want to use these class instead of gnupg.GPG class in order to mitigate the encoding issue (I.E. when using email.mime.MIMEMultipart).
# Example of use:
# gpg = GPGSafe(use_agent=False, homedir="~/.gnupg/") (instead of gpg = gnupg.GPG(...))
# gpg.sign(text)
import codecs
from functools import wraps
import gnupg
class GPGSafe:
@e3rd
e3rd / intelmqctl.py
Last active April 25, 2017 13:44
intelmq: bot_reload functionality, part of intelmqctl.py
def bot_reload(self, bot_id):
pid = self.__read_pidfile(bot_id)
if not pid:
if self.controller._is_enabled(bot_id):
log_bot_error('stopped', bot_id)
return 'stopped'
else:
log_bot_message('disabled', bot_id)
return 'disabled'
if not self.__status_process(pid):