Skip to content

Instantly share code, notes, and snippets.

View omgbbqhaxx's full-sized avatar
🪐
Universal

Yasin Aktimur omgbbqhaxx

🪐
Universal
View GitHub Profile
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
#mehmetkose.org/linode-uzerinde-nginx-supervisord-tornado-yapilandirmasi.html
import tornado.ioloop
from tornado.options import define, options, logging
import tornado.web
define("port", default=8888, help="run on the given port", type=int)
settings = {
"debug": True,
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/opt/venv/retwiends # Django project directory
SOCKFILE=/opt/venv/run/gunicorn.sock # we will communicte using this unix socket
USER=root # the user to run as
GROUP=root # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=retwiends.settings # which settings file should Django use
DJANGO_WSGI_MODULE=retwiends.wsgi # WSGI module name
@omgbbqhaxx
omgbbqhaxx / gist:9290573
Last active August 29, 2015 13:56 — forked from rolo/gist:1481128
#!/bin/bash
#http://postgis.net/source
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
-*-*-*-*-*-*-
sudo apt-get install libpq-dev python-dev
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install build-essential
sudo apt-get -y install python-software-properties
<!doctype html>
<html>
<head>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?sensor=false">
</script>
<meta charset="UTF-8">
<title>Example Google Map</title>
</head>
<body>

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
// show UIActionSheet
}];
moreAction.backgroundColor = [UIColor greenColor];
UITableViewRowAction *flagAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Flag" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
// flag the row
}];
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(