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
#! /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
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
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
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
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
# 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
upstream django { | |
## uwsgi launcher example: uwsgi --socket mysite.sock --module mysite.wsgi --chmod-socket=666 | |
server unix:///path/to/mysite.sock; | |
} | |
server { | |
listen 8080 default_server; |
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 Event(object): | |
def __init__(self): | |
self.callables = {} | |
def on(self, func, uid=None): | |
if not callable(func): | |
raise TypeError("callable required") | |
if not uid: | |
uid = str(hash(func)) |
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.http import HttpResponseNotAllowed | |
HTTP_METHODS_11 = ['HEAD', 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'TRACE'] | |
class HttpView: | |
_http_methods = list(HTTP_METHODS_11) | |
def methods_available(self): | |
methods = getattr(self, '_http_methods_available', None) |