Skip to content

Instantly share code, notes, and snippets.

View juanrossi's full-sized avatar

Juan Rossi juanrossi

  • mercadolibre
  • Buenos Aires, Argentina
View GitHub Profile
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }
"""
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._
from __future__ import with_statement
from fabric.api import local, settings, abort, run, cd, env, sudo
from fabric.colors import green as _green
from fabric.colors import yellow as _yellow
from fabric.colors import red as _red
from fabric.contrib.console import confirm
from fabric.contrib.project import rsync_project
from fabric.contrib.files import upload_template, exists
from fabric.operations import require
from fabric.context_managers import prefix
<!-- jQuery CDN Failsafe to CloudFlare CDN -->
<script>window.jQuery || document.write('<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"><\/script>');</script>

Step 1

Get a VPS that offers 2 or more IP addresses.

Step 2

From the WHM cPanel, find the menu item Service Configuration, select Apache Configuration and then click on Reserved IPs Editor.

Step 3

Step 1

Get a VPS that offers 2 or more IP addresses.

Step 2

From the WHM cPanel, find the menu item Service Configuration, select Apache Configuration and then click on Reserved IPs Editor.

Step 3

@juanrossi
juanrossi / select-to-dropdown.js
Created February 6, 2012 18:54 — forked from ignacioricci/select-to-dropdown.js
Change select to dropdown list
$('#selectJob').children().hide();
var sel_list = $('<div id="jobDropdown"><strong class="cta"><span></span></strong><ul></ul></div>');
sel_list.find('span').text($('#selectJob label').text());
$('#selectJob select').children('option').each(function(){
sel_list.children('ul').append('<li>' + $(this).text() + '</li>');
});
$('#selectJob').append(sel_list);
$('#jobDropdown').find('li').live('click',function(e){
$('#selectJob select option').eq($(this).index()).attr('selected','selected').siblings('option').removeAttr('selected');
$(this).addClass('selected');