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
| $HTTP["url"] !~ "^/(?:media|ping.html|hna).*" { | |
| $HTTP["scheme"] == "https" { | |
| setenv.add-request-header = ("X-FORWARDED-PROTOCOL" => "ssl", "X-FORWARDED-SSL" => "on") | |
| } | |
| proxy.server = ( | |
| "/" => (( | |
| "host" => "127.0.0.1", | |
| "port" => 8302, | |
| )) | |
| ) |
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
| diff -ruN anacron-2.3/Makefile /tmp/anacron-2.3/Makefile | |
| --- anacron-2.3/Makefile 2000-06-23 02:26:11.000000000 +0400 | |
| +++ /tmp/anacron-2.3/Makefile 2012-04-13 13:49:08.000000000 +0400 | |
| @@ -22,7 +22,7 @@ | |
| PREFIX = | |
| BINDIR = $(PREFIX)/usr/sbin | |
| MANDIR = $(PREFIX)/usr/man | |
| -CFLAGS = -Wall -pedantic -O2 | |
| +CFLAGS = -Wall -pedantic -O2 -I. | |
| #CFLAGS = -Wall -O2 -g -DDEBUG |
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
| diff -ru anacron-2.3/gregor.c /tmp/anacron-2.3/gregor.c | |
| --- anacron-2.3/gregor.c 2000-06-23 02:50:40.000000000 +0400 | |
| +++ /tmp/anacron-2.3/gregor.c 2012-04-13 11:23:24.000000000 +0400 | |
| @@ -65,7 +65,6 @@ | |
| { | |
| int dn; | |
| int i; | |
| - const int isleap; /* save three calls to leap() */ | |
| /* Some validity checks */ |
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
| #!/usr/bin/env python | |
| import logging as log | |
| from fileinput import input | |
| from collections import namedtuple, defaultdict | |
| from pprint import pprint | |
| if __debug__: | |
| log_level = log.DEBUG | |
| else: |
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
| import subprocess | |
| import myproject | |
| from flaskext.script import Manager | |
| manager = Manager(app) | |
| @manager.command | |
| def dbshell(): | |
| db = myproject.get_db() |
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
| sudo apt-get install make linux-headers-`uname -r` | |
| cd /tmp | |
| wget 'http://download.virtualbox.org/virtualbox/4.1.18/VBoxGuestAdditions_4.1.18.iso' | |
| sudo mount VBoxGuestAdditions_4.1.18.iso -o loop /mnt | |
| sudo sh /mnt/VBoxLinuxAdditions.run --nox11 |
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
| client_body_in_file_only clean; # предзакачивать POST на диск и чистить после ответа | |
| client_body_temp_path /tmp/nginx/body/; # папка с постами | |
| fastcgi_pass_request_body off; # не прокачивать тело POSTа в fastcgi напряму | |
| fastcgi_param REQUEST_BODY_FILE $request_body_file; # прокинуть в ENV путь к телу POSTа |
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
| # source: http://blog.lalf.ru/2012/01/django-traceback-production.html#more | |
| from django.views.debug import technical_500_response | |
| import sys | |
| class UserBasedExceptionMiddleware(object): | |
| def process_exception(self, request, exception): | |
| if request.user.is_superuser: | |
| return technical_500_response(request, *sys.exc_info()) |
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
| nnoremap <Leader>r :set keymap=russian-jcuken<CR> | |
| nnoremap <Leader>e :set keymap=<CR> | |
| inoremap <Leader>r <ESC>:set keymap=russian-jcuken<CR>a | |
| inoremap <Leader>e <ESC>:set keymap=<CR>a |
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
| now = datetime.utcnow() | |
| then = now + timedelta(seconds=LOCK_TIME) | |
| if db.locks.find_and_modify({'type': command, 'time': {'$lt': now}}, | |
| {'type': command, 'time': then}, | |
| new=True, | |
| upsert=(not bool(mongo.dbtaxi.locks.find({'type': command}).count()))): | |
| do_stuff() |