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
| # modsecurity scanner | |
| echo "SecRule FILES_TMPNAMES "@inspectFile /opt/modsecurity_clamdscan.sh" phase:2,t:none,log,deny" >> /etc/modsecurity/modsecurity.conf | |
| # clamav scan script | |
| cat >> /opt/modsecurity_clamdscan.sh << EOF | |
| #! /bin/bash | |
| if [ ! $1 ]; then | |
| echo "No file to scan" | |
| exit 1 |
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
| 82c82 | |
| < | |
| --- | |
| > | |
| 94,105c94,95 | |
| < my (@list); | |
| < if (!opendir(I, "$dir")) { | |
| < return if $! =~ /no such file/i; | |
| < print STDERR "$dir: Can't open: $!, skipping\n"; | |
| < return; |
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
| var ProgressItem = Backbone.Model.extend({ | |
| defaults: { | |
| max: 100, | |
| value: 0 | |
| }, | |
| getValueRatio: function () { | |
| return this.get('value') * 100 / this.get('max'); | |
| } |
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
| abstract class Events { | |
| Map _events; | |
| on(String events, Function callback, [Map datas]) { | |
| _events == null ? (_events = {}) : null; | |
| var eventsList = _splitEvents(events); | |
| for (int i = 0; i < eventsList.length; i++) { | |
| String event = eventsList[i]; | |
| _events[event] == null ? (_events[event] = []): null; |
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
| from django import template | |
| from django.template import Context, loader | |
| from django.template.base import Node, token_kwargs, TemplateSyntaxError | |
| from django.utils import six | |
| from django.conf import settings | |
| register = template.Library() | |
| class IncludeSelectedNode(Node): |
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
| #! /bin/sh | |
| vhosts=/var/www/vhosts | |
| for d in `ls -1 $vhosts`; do | |
| echo "<Directory $vhosts/$d/httpdocs/images>" | |
| echo " AllowOverride None" | |
| echo "</Directory>" | |
| done |
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
| #! /bin/sh | |
| domain=example.com | |
| rt=/var/qmail/mailnames/$domain | |
| postqueue -p | grep ^[A-Z0-9] | grep $domain | while read line; do | |
| id=`echo $line | awk '{print $1}' | sed 's/\*//'` | |
| user=`echo $line | awk '{print $7}' | awk -F '@' '{print $1}'` | |
| if [ ! -d $rt/$user ]; then |
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
| class Parser(object): | |
| PATTERN = r"^" \ | |
| + r"(?P<month>\w{3})\s+" \ | |
| + r'(?P<day>\d{1,2})\s+' \ | |
| + r'(?P<time>\d{2}:\d{2}:\d{2})\s+' \ | |
| + r'(?P<hostname>[^\s]+)\s+' \ | |
| + r'(?P<exec>\w+/\w+)' \ | |
| + r'\[(?P<port>\d+)\]:\s+' \ | |
| + r'(?P<message_id>\w+):\s+' \ |
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
| #! /bin/sh -e | |
| DAEMON="/usr/bin/xboxdrv" | |
| DEAMON_OPT="--quiet --silent" | |
| DAEMONUSER="root" | |
| DEAMON_NAME="xboxdrv" | |
| PATH="/sbin:/bin:/usr/sbin:/usr/bin" | |
| test -x $DAEMON || exit 0 |
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
| function tail($fh, $max_length=10) { | |
| $tailed = array(); | |
| fseek($fh, -2, SEEK_END); | |
| $stop = ftell($fh) + 2; | |
| while (ftell($fh) >= 0 && count($tailed) < $max_length) { | |