Skip to content

Instantly share code, notes, and snippets.

@scotu
scotu / fabfile.py
Created January 24, 2010 12:04 — forked from kogakure/fabfile.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too

Python 2.6 + Virtualenv + Django 1.1 + Postgres on WebFaction

  1. mkdir -p ~/bin ~/lib/python2.6/site-packages
  2. Configure the environment by putting something like this in your .bashrc and sourcing it:

    export CFLAGS=-I/usr/local/pgsql/include 
    export LDFLAGS=-L/usr/local/pgsql/lib
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the

Keybase proof

I hereby claim:

  • I am scotu on github.
  • I am matteo (https://keybase.io/matteo) on keybase.
  • I have a public key whose fingerprint is E986 3043 9891 545B 6A16 A320 8BFE 4CEC E98E 1A57

To claim this, I am signing this object:

@scotu
scotu / YOLO.sh
Created August 25, 2014 09:36
Wrapper to make sure a command is run only once at a time
#!/bin/sh
# taken from http://stackoverflow.com/a/959511/150932
SCRIPTNAME=`basename $0`
PIDFILE=/var/run/${SCRIPTNAME}.pid
if [ -f ${PIDFILE} ]; then
#verify if the process is actually still running under this pid
@scotu
scotu / ffbookmark.js
Created June 19, 2014 17:51
Friendfeed fixed bookmarklet code
(function(){function A(){function a(){var a=document.getElementById("ff__shadow"),b=document.getElementById("ff__foreground");if(!a||!b)clearInterval(n);else if(h!=b.offsetWidth||k!=b.offsetHeight)h=b.offsetWidth,k=b.offsetHeight,a.style.width=h+s+"px",a.style.height=k+s+"px"}if(!document.getElementById("ff__container")){var b;window.getSelection?b=""+window.getSelection():document.selection&&(b=document.selection.createRange().text);for(var c=0,e=window.ff__reshare?[]:document.getElementsByTagName("img"),
d=0;d<e.length;d++){var f=e[d];if(!(f.width<t||f.height<t)){c++;var l=q(f,"mouseover",u(B,f));r.push({element:f,cursor:f.style.cursor,listener:l})}}var g=m();g.id="ff__container";g.style.position="absolute";g.style.top=p().y+"px";g.style.right="0";g.style.width="auto";g.style.zIndex=1E5;d=m(g);d.id="ff__shadow";d.style.backgroundColor="black";d.style.position="absolute";d.style.zIndex=0;d.style.top="0";d.style.right="0";C(d,.3);d=m(g);d.id="ff__foreground";d.style.backgroundColor="white";d.style.zIndex=
2;d