Skip to content

Instantly share code, notes, and snippets.

@Dem0n3D
Dem0n3D / README.md
Created September 7, 2016 15:16 — forked from nichtich/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
{
"actstat": {
"convert": {
"actstatid": "int"
}
},
"addrobj": {
"null": [
"actstat",
"nextid",
@Dem0n3D
Dem0n3D / dblock.py
Last active August 29, 2015 14:10 — forked from atabary/dblock.py
#-*- coding: utf-8 -*-
import contextlib
from django.db import connection
@contextlib.contextmanager
def acquire_table_lock(read=[], write=[]):
'''Acquire read & write locks on tables.
import re
import sys
import subprocess
def file_len(fname):
p = subprocess.Popen(['grep', fname, '-e', 'INSERT', '-c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result, err = p.communicate()
if p.returncode != 0:
raise IOError(err)