Skip to content

Instantly share code, notes, and snippets.

View turicas's full-sized avatar

Álvaro Justen turicas

View GitHub Profile
======================================================
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
anonymous
anonymous / gist:156623
Created July 27, 2009 16:41
"""
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._
[extensions]
extdiff =
fetch =
rebase =
mq =
histedit = /usr/bin/histedit.py
pager =
transplant =
graphlog =
bookmarks =
# projectfoo/config/__init__.py
from os import path
ROOT_PATH = path.dirname(path.dirname(path.abspath(__file__)))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@glacjay
glacjay / tun-ping-linux.py
Created September 18, 2010 04:49
Reading/writing Linux's TUN/TAP device using Python.
import fcntl
import os
import struct
import subprocess
# Some constants used to ioctl the device file. I got them by a simple C
# program.
TUNSETIFF = 0x400454ca
TUNSETOWNER = TUNSETIFF + 2
@fsouza
fsouza / add_prefix.py
Created September 8, 2011 23:01
Removes prefix to your contacts on Google Contacts
# -*- coding: utf-8 -*-
import gdata.contacts.client
import gdata.contacts.data
USER = ""
PASSWD = ""
PREFIX = '041'
def add_prefix_to_contacts(gd_client, prefix):
@maurobaraldi
maurobaraldi / .gitconfig
Created November 6, 2011 23:37 — forked from tomster/.gitconfig
An example git configuration including convenience aliases, some saner default behavior, a neat shell prompt and tab completion that can display the name of the tracking remote
# ~/.gitconfig
[branch]
autosetupmerge = true
[push]
default = current
[core]
excludesfile = .gitignore
@rodrigopinto
rodrigopinto / grbc_horaextra_2012.beer
Created January 21, 2012 22:25
Samba enredo 2012 do G.R.B.C #horaextra
Hojeee é mais uma segunda-feira,
a patroa ta avisada,
não tenho hora pra voltar.
Vou pro bar com amigos,
Entre uma cerveja e outra,
não vejo a hora passar
Conversa nerd, filosófica ou afiada
o que importa é a cervejada
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active September 4, 2025 19:21
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ferd
ferd / app_deps.erl
Created September 23, 2012 05:33
Quick escript to generate a visualization of app dependencies in Erlang/OTP.
%%% Run with 'escript app_deps.erl'
%%% Change the path in filelib:wildcard/1 as required to capture all
%%% your dependencies.
%%%
%%% Rectangular nodes will represent library apps (no processes involved)
%%% and the circular nodes will represent regular apps. An arrow going from
%%% 'A -> B' means 'A depends on B'.
%%%
%%% This script depends on graphviz being present on the system.
-module(app_deps).