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> | |
#define TOKENPASTE(x, y) x ## y | |
#define TOKENPASTE2(x, y) TOKENPASTE(x, y) | |
#define UNIQUE_FUNC_NAME TOKENPASTE2(cleanuper_func_, __LINE__) | |
#define UNIQUE_VAR_NAME TOKENPASTE2(cleanuper_var_, __LINE__) | |
#define SCOPE_EXIT(code_) \ | |
void UNIQUE_FUNC_NAME(int *t __attribute__((unused))) \ | |
code_ \ |
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
#app/settings.py | |
INSTALLED_APPS = ( | |
#... | |
'haystack', | |
) | |
HAYSTACK_CONNECTIONS = { | |
'default': { | |
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', | |
'URL': 'http://127.0.0.1:9200/', |
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
# 1. go to https://aws.amazon.com and launch t2.nano instance with Ubuntu 14.04, opening ports 11212 and 11211 in security group settings | |
# 2. connect via ssh to it | |
# 3. curl http://download.tarantool.org/tarantool/1.6/gpgkey | sudo apt-key add - | |
# 4. run next commands for installation of tarantool (it's from http://tarantool.org/download.html) | |
curl http://download.tarantool.org/tarantool/1.6/gpgkey | sudo apt-key add - | |
release=`lsb_release -c -s` | |
sudo rm -f /etc/apt/sources.list.d/*tarantool*.list | |
sudo tee /etc/apt/sources.list.d/tarantool_1_6.list <<- EOF | |
deb http://download.tarantool.org/tarantool/1.6/ubuntu/ $release main |
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
from django.core.management.base import BaseCommand | |
from qa.models import Question, Answer | |
from lib.models import Liker, Tag | |
import random | |
#cd /Users/denis/track/env/lib/python2.7/site-packages/django && fgrep -lr "def " . | xargs -P8 -n1 cat | perl -lne '/^def (\w+)\(/ && print $1' >/tmp/all_django_funcs.txt | |
with open('/tmp/all_django_funcs.txt', 'r') as f: | |
all_django_funcs = f.read().splitlines() | |
question_text_templates = ( |
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
from django.core.management.base import BaseCommand | |
from qa.models import Question, Answer | |
from lib.models import Liker, Tag | |
import random | |
#cd /Users/denis/track/env/lib/python2.7/site-packages/django && fgrep -lr "def " . | xargs -P8 -n1 cat | perl -lne '/^def (\w+)\(/ && print $1' >/tmp/all_django_funcs.txt | |
with open('/tmp/all_django_funcs.txt', 'r') as f: | |
all_django_funcs = f.read().splitlines() | |
question_text_templates = ( |
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
# wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
# echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
# sudo apt-get update | |
# sudo apt-get install –y openjdk-7-jre-headless elasticsearch | |
# pip install elasticsearch |
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
-- This is default tarantool initialization file | |
-- with easy to use configuration examples including | |
-- replication, sharding and all major features | |
-- Complete documentation available in: http://tarantool.org/doc/ | |
-- | |
-- To start this example just run "sudo tarantoolctl start example" or | |
-- use init scripts provided by binary packages. | |
-- To connect to the instance, use "sudo tarantoolctl enter example" | |
-- Features: | |
-- 1. Database configuration |
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
# memcached default config file | |
# 2003 - Jay Bonci <jaybonci@debian.org> | |
# This configuration file is read by the start-memcached script provided as | |
# part of the Debian GNU/Linux distribution. | |
# Run memcached as a daemon. This command is implied, and is not needed for the | |
# daemon to run. See the README.Debian that comes with this package for more | |
# information. | |
-d |
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
wget https://github.com/centrifugal/centrifugo/releases/download/v1.4.5/centrifugo-1.4.5-linux-amd64.zip | |
unzip centrifugo-1.4.5-linux-amd64.zip | |
cd centrifugo-1.4.5-linux-amd64/ | |
./centrifugo -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
wget https://raw.githubusercontent.com/centrifugal/centrifuge-js/master/centrifuge.js -O static/js/centrifuge.js | |
./manage.py collectstatic |
OlderNewer