This file contains hidden or 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 fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
This file contains hidden or 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
#!/bin/sh | |
# place in {repo}/.git/hooks/update | |
# chmod +x update | |
name="$1" | |
old="$2" | |
new="$3" | |
user_name=$(git log -1 --pretty=format:%aN $new) | |
#branch=$(git rev-parse --symbolic --abbrev-ref $1) | |
branch=${name#refs/heads/} |
This file contains hidden or 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
date -s "$(wget --no-cache -S -O /dev/null google.com 2>&1 | sed -n -e '/ *Date: */ {' -e s///p -e q -e '}')" |
This file contains hidden or 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
./configure --prefix=/opt/nginx --with-debug --with-http_dav_module \ | |
--with-http_addition_module --with-http_geoip_module --with-http_gzip_static_module \ | |
--with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module \ | |
--with-http_ssl_module --with-http_sub_module --with-http_xslt_module \ | |
--with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail \ | |
--with-mail_ssl_module \ | |
--add-module=/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/nginx | |
------------------------------------------------------------------------------------- | |
without passenger |
This file contains hidden or 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
#!/usr/bin/env python | |
from __future__ import with_statement | |
import os | |
import re | |
import shutil | |
import subprocess | |
import sys | |
import tempfile | |
This file contains hidden or 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
#start command, stores pid in a file in /tmp | |
sudo python manage.py run_gunicorn -p /tmp/gunicorn.pid -b 127.0.0.1:8000 --daemon | |
#save as ./start | |
#stop command | |
sudo kill `cat /tmp/gunicorn.pid` #note those aren't apostrophes, but the ~ key | |
#save as ./stop | |
#restart commad | |
sudo kill -HUP `cat /tmp/gunicorn.pid` |
This file contains hidden or 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
postactivate | |
+ | |
cd ~/dev/$env_name | |
+ | |
will be kool |
This file contains hidden or 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
sudo apt-get install samba | |
edit: /etc/samba/smb.conf | |
[mfs] | |
path = /home/someone | |
writable = yes | |
add user: | |
smbpasswd -a someone |
This file contains hidden or 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
sudo apt-get install postgresql postgresql-clinet libpq-dev | |
pip install psycopg2 | |
su postgres | |
createdb [db] | |
psql | |
CREATE USER "" WITH PASSWORD ''; ( user use " password use ') | |
on settings.py | |
DATABASES = { |
This file contains hidden or 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
#!/bin/sh | |
DJANGO_SETTINGS_MODULE=mysettings | |
export DJANGO_SETTINGS_MODULE | |
PYTHONPATH=/path/to/python_libs:/path/to/my_django_apps | |
export PYTHONPATH | |
/path/to/python /path/to/my_django_script |
OlderNewer