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 / djangodersleri3.txt
Last active January 10, 2016 04:44
Django Dersleri 3. VPS Konfigurasyonu ve virtualenv kurulumu
sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get install vim -y && sudo apt-get install python-dev -y && sudo apt-get install libevent-dev -y && sudo apt-get install python-virtualenv -y && apt-get install git -y
@omgbbqhaxx
omgbbqhaxx / vsftpd.conf
Created November 2, 2013 16:20
vsftpd örnek configirasyonu.
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
@omgbbqhaxx
omgbbqhaxx / ajax.js
Created November 3, 2013 21:06
Django AJAX POST Example
$(document).ready(function(){
// using jQuery
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
@omgbbqhaxx
omgbbqhaxx / index.html
Created January 9, 2014 12:15
sock.js arguments
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script>
<script>
$(function() {
var conn = null;
function log(msg) {
@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