graystreamlogger is a python script born out of necessity. Use graylogger.py to send GELF-formatted messages to a graylog host. You may log string messages, file contents or read from stdin, add additional fields. Host name and timestamp will be provided automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" Fake email domain crawler | |
uses search page of known temp mail provider to crawl domains | |
These domains are getting used on, among others: | |
https://generator.email/ | |
https://emailfake.com/ | |
https://email-fake.com/ | |
1.) slowly retrives results for strings aaa-zzz, validates DNS and stores in set | |
2.) fetches public tld list from icann | |
3.) writes entry with one "." and known tld into outfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule "access log" | |
when | |
m : Message( message matches ".*access.*:.*" ) | |
then | |
Matcher matcher = Pattern.compile("^.* (.*\\.log): ([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}).* \"([A-Z]{3,7}) (.*) HTTP/1.1\" ([0-9][0-9][0-9]) ([0-9]{1,}) \"(.*)\" \"(.*)\" (?<=[ ])([0-9]+$)").matcher(m.getMessage()); | |
if (matcher.find()) { | |
m.addField("_Logfile",matcher.group(1)); | |
m.addField("_clientIp",matcher.group(2)); | |
m.addField("_Method",matcher.group(3)); | |
m.addField("_URI",matcher.group(4)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sync_syndic(): | |
''' | |
Sync defined folders and files from the salt master to the syndic fileserver | |
Looks for production specific top file to replace top.sls on syndics | |
''' | |
base_dir = "/srv/salt/" | |
dirs_to_sync = ["salt-cloud", "_modules", "_grains", "_runners", "scripts", "states"] | |
files_to_sync = [] | |
production_top = "top-prod.sls" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# munin-deleted-files.py | |
# | |
# Generic munin shell cmd monitor | |
# replace monitor_cmd with your shell cmd | |
# | |
from sys import exit,argv | |
import subprocess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
'''Get mercurial hook and post commit message with link to hg page to youtrack issue as comment. | |
Installation: | |
Add hook entry in your hgrc: | |
[hooks] | |
incoming = python:/<path>/commit-to-youtrack.py:hook | |
[youtrack-hook] | |
ID = EXPL,EG,OPS | |
AGGRO = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# List, create, delete vmware vsphere snapshots with unix-like user interface. | |
# This assumes that the vm name are equal to the hostname or the fqdn | |
# Requirements: pysphere >= 0.1.6 If Python < 2.7: argparse | |
# | |
# Peter Froehlich ([email protected]) @ 03/2013 | |
# | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |