Skip to content

Instantly share code, notes, and snippets.

View gothicx's full-sized avatar

Marco Rodrigues gothicx

View GitHub Profile
@gothicx
gothicx / valid_imgs.py
Last active February 22, 2021 19:55
Find valid images using Python code
#!/usr/bin/env python
#
# Find and clean up invalid images
#
# bY Marco Rodrigues 2021 - <[email protected]>
#
import imghdr
from os import walk, path, remove
dir_moments = '/volume1/homes/user/Drive/Moments'
@gothicx
gothicx / gist:2b9742329304610a9437
Created July 7, 2015 14:18
fail2ban mod_antiloris failregex
jail.conf:
[apache-antiloris]
enabled = true
filter = antiloris
action = iptables-multiport[name=apache-antiloris,port="80,443"]
logpath = /var/log/httpd/error_log
filter.d/antiloris.conf:
[Definition]
# Option: failregex
# Start httpd from zabbix with httpd_t domain
policy_module(myfix, 1.0.0)
optional_policy(`
gen_require(` type httpd_initrc_exec_t, zabbix_agent_t; ')
init_labeled_script_domtrans(zabbix_agent_t, httpd_initrc_exec_t)
')