Skip to content

Instantly share code, notes, and snippets.

View patroqueeet's full-sized avatar

Jirka Schäfer patroqueeet

View GitHub Profile
@patroqueeet
patroqueeet / naxsi_exceptions
Last active December 29, 2024 10:21
naxsi munin monitoring
#!/usr/bin/env python3
"""Munin plugin to monitor naxsi rule hits
from https://gist.github.com/patroqueeet/ed48078de9b758cd35d92fa667894a84
needs logtail command being installed
=head1 NAME
#! /bin/bash
# print status
git status
locale
virtualenv .ve
VIRTUAL_ENV_DISABLE_PROMPT=true source .ve/bin/activate
# os pkgs
# sudo aptitude remove -y postgresql-9.4 postgresql-9.4-postgis-2.1 postgresql-9.4-postgis-2.2 postgresql-9.4-postgis-scripts postgresql-client-9.4 postgresql-client-common postgresql-common postgresql-contrib-9.4 postgresql-server-dev-9.4
In [11]: while True:
for t in Thumbnail.objects.all():
fname = os.path.basename(t.name)
dname = os.path.dirname(t.name)
h.join(root, dname)):.isfile(os.path.join(root, dname, fname)) and os.path.exists(os.path
for x in listdir(os.path.join(root,dname)):
if x[3:] == os.path.basename(t.name):
e, x[3:]) print "renaming", os.path.join(root,dname,x), os.path.join(root,dname
)) os.rename(os.path.join(root,dname,x), os.path.join(root,dname, x[3:])
time.sleep(3)