This file contains 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
# ... | |
CACHE_BACKEND = 'memcached://127.0.0.1:11211/' | |
# criado por mim | |
CACHE_KEY_PREFIX = 'easyproject' | |
CACHE_IGNORE_REGEXPS = ( | |
r'/admin.*', | |
) |
This file contains 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 easy_gunicorn { | |
server 127.0.0.1:9000; | |
} | |
server { | |
listen 80; | |
server_name localhost 127.0.0.1; | |
client_max_body_size 10m; | |
access_log /var/log/nginx/easyproject.access.log; |
This file contains 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/python | |
# -*- coding: UTF-8 -*- | |
import re | |
from django.core.cache import cache | |
from django.conf import settings | |
class NginxCacheMiddleware: | |
def process_response(self, request, response): | |
cacheIt = True |
This file contains 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
# ... | |
CACHE_MIDDLEWARE_KEY_PREFIX = 'atepassar' | |
# Cache system integrated with NGINX | |
CACHE_KEY_PREFIX = CACHE_MIDDLEWARE_KEY_PREFIX | |
CACHE_IGNORE_REGEXPS = ( | |
r'/admin.*', | |
r'/cadastre.*', | |
r'/login.*', |
This file contains 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
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/time.h> | |
#include <sys/queue.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <err.h> | |
#include <event.h> | |
#include <evhttp.h> | |
#include <libmemcached/memcached.h> |
This file contains 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 easy_gunicorn { | |
server 127.0.0.1:9000; | |
} | |
upstream pre_server { | |
server 127.0.0.1:8000; | |
} | |
server { | |
listen 80; |
This file contains 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
# -*- ecoding:utf-8 -*- | |
import urllib2 | |
from string import ascii_lowercase, digits | |
def inject(sql): | |
"""Injeta o commando SQL no cookie da requisição.""" | |
r = urllib2.Request("http://localhost") | |
r.add_header("Cookie", "sessionid=' UNION %s" % sql.replace("\n", " ").strip()) | |
return urllib2.urlopen(r) |
This file contains 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
filter = { _array, _func: | |
map( map(_array, _func), { _item: | |
if ( _item, { | |
_item | |
}); | |
}); | |
}; |
This file contains 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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
.coisa { | |
margin-top: 40px; | |
width: 100px; | |
height: 100px; | |
background-color: #bbb; | |
} |
This file contains 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
*.swp | |
*.pyc | |
*.pyo |