Skip to content

Instantly share code, notes, and snippets.

@tarsnake
tarsnake / fabfile.py
Last active August 29, 2015 14:09 — forked from cloudaice/fabfile.py
from __future__ import with_statement
import os
from django.core import management
# We have to re-name this to avoid clashes with fabric.api.settings.
import ohbooklist.conf.local.settings as django_settings
management.setup_environ(django_settings)
from fabric.api import *
@tarsnake
tarsnake / fabconfig.py
Last active August 29, 2015 14:09 — forked from hzbd/fabconfig.py
"""
Project-specific environment information.
This module provides configuration for the fabfile to run with. The idea is
that the fabfile is project-agnostic and all configuration takes place within
this file.
In reality, this won't be entirely true as each project will evolve specific
deployment needs. Nevertheless, this still provides a good starting point.
"""
# Flask installer
# If you want a quick setup for a flask app on CentOs 7, try this.
# Requires 'requirements.txt' on your application folder.
# WARNING: this script will open port 8081!
# ideas:
# - http://linuxcommand.org/lc3_new_script.php
# - http://stackoverflow.com/questions/14008125/shell-script-common-template
@tarsnake
tarsnake / fabfile.py
Last active August 29, 2015 14:09 — forked from elliottb/fabfile.py
from fabric.api import local, run, env, put
import os, time
# remote ssh credentials
env.hosts = ['10.1.1.25']
env.user = 'deploy'
env.password = 'XXXXXXXX' #ssh password for user
# or, specify path to server public key here:
# env.key_filename = ''
from fabric.api import run, require, env, hide, sudo, execute
from fabric.api import local, warn_only, cd, put, settings, show, hide
from fabric.contrib.files import append, sed
from fabric.contrib.project import rsync_project
import os
def vagrant():
"""Use the local virtual machine to run commands
# Flask installer
# If you want a quick setup for a flask app on CentOs 7, try this.
# Requires 'requirements.txt' on your application folder.
# WARNING: this script will open port 8081!
# ideas:
# - http://linuxcommand.org/lc3_new_script.php
# - http://stackoverflow.com/questions/14008125/shell-script-common-template
Barebones Server Setup
Current Linux Distro: Ubuntu 10.04 LTS
###
Optional:
or UPDATE distro in /etc/apt/sources.list run apt-get update and apt-get dist-upgrade
solve perl: warning: Setting locale failed.
https://gist.github.com/panchicore/1269109

Introduction

Create a sudo user

adduser appuser
passwd appuser
# Provide the password here
@tarsnake
tarsnake / fabfile.py
Last active August 29, 2015 14:08 — forked from cloudaice/fabfile.py
from __future__ import with_statement
import os
from django.core import management
# We have to re-name this to avoid clashes with fabric.api.settings.
import ohbooklist.conf.local.settings as django_settings
management.setup_environ(django_settings)
from fabric.api import *
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default