Skip to content

Instantly share code, notes, and snippets.

View muminoff's full-sized avatar
🏠
Working from home

Sardor Muminov muminoff

🏠
Working from home
  • EA
  • Seoul, Korea
View GitHub Profile
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow

###How to install Python 2.7.3 on CentOS 6.3

###Install development tools

In order to compile Python you must first install the development tools:

yum groupinstall "Development tools"

You also need a few extra libs installed before compiling Python or else you will run into problems later when trying to install various packages:

@muminoff
muminoff / tree.md
Created March 9, 2014 05:59 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

import os
import time
def _generate_id():
return os.urandom(2).encode('hex') + hex(int(time.time() * 16))[5:]

How-to setup a simple git push deployment

These are my notes basically. I first created this just as a reminder for myself. Feel free to use this for your project as a starting point.

On the server (example.com)

  1. Create a user on example.com, as which we (the git client) connects (push) to exmaple.com.
sudo useradd -m -s /usr/bin/git-shell git
@muminoff
muminoff / docker
Last active August 29, 2015 14:05
Docker remove all containers/images
# docker withoud sudo (re-login makes effect)
sudo gpasswd -a __user__ docker
# stop all containers
docker stop $(docker ps -a -q)
# remove all containers
docker rm $(docker ps -a -q)
# remove all images
@muminoff
muminoff / psql.md
Last active August 29, 2015 14:05
Create db and user in PostgreSQL

##First login with postgres user

Create role

CREATE ROLE muminoff with LOGIN CREATEDB PASSWORD 'muminoff';

Create database

CREATE DATABASE muminoffdb;

Grant privileges to user on database

GRANT ALL PRIVILEGES ON DATABASE muminoffdb to muminoff;

@muminoff
muminoff / sed.md
Last active August 29, 2015 14:05
Sed recursive

find . -type f -print0|xargs -0 sed -i 's/source_word/destination_word/g'

[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