Skip to content

Instantly share code, notes, and snippets.

@drucko
drucko / gitlab.sh
Created July 17, 2012 11:44 — forked from cristianrasch/gitlab.sh
Install Gitlab on Debian Squeeze/Wheezy
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
aptitude install gitolite
cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
su - git
@drucko
drucko / yammerauth.py
Created November 13, 2012 14:38
Yammer oauth
import oauth2 as oauth
import urllib
def yam():
consumer_key = YOUR_CONSUMER_KEY
consumer_secret= YOUR_CONSUMER_SECRET
access_token = YOUR_ACCESS_TOKEN
access_token_secret = YOUR_ACCESS_TOKEN_SECRET
consumer = oauth.Consumer(consumer_key, consumer_secret)
token = oauth.Token(access_token,access_token_secret)
client = oauth.Client(consumer,token)
@drucko
drucko / fabfile.py
Created November 20, 2012 09:28 — forked from bingomanatee/fabfile.py
A fabric script file
from fabric.api import *
import agi_config
import fab_lib
# these lists are populated with 'username@hostname' strings by prep_hosts()
ast_hostnames_as_root = []
ast_hostnames_as_tyger = []
agi_hostnames_as_root = []
agi_hostnames_as_tyger = []
@drucko
drucko / fab_ejabberd.py
Created November 20, 2012 09:30 — forked from wamberg/fab_ejabberd.py
Python Fabric ejabberd installation script
"""
Automated installation of ejabberd with a postgresql backend inspired by this
article: http://www.planeterlang.org/en/planet/article/How_to_install_ejabberd_2.0.0_with_PostgreSQL_support/
"""
from fabric.api import run, sudo
EJABBERD_VERSION = '2.0.5'
EJABBERD_SOURCE_HOME = '~/dev/xmpp/oss'
POSTGRES_PSQL_PASSWORD = 'user'
@drucko
drucko / fabfile.py
Created November 20, 2012 11:03 — forked from kogakure/fabfile.py
Python: Fabric (< 0.9) – Server-Backup
#!/usr/bin/python
# -*- coding: utf-8 -*-
from time import *
lt = localtime()
config.fab_hosts = ['server.com'],
config.fab_host = 'server.com',
config.fab_user = 'user',
config.postgres_bin = '/usr/local/pgsql/bin',
@drucko
drucko / index.html
Created November 20, 2012 12:10 — forked from adgedenkers/index.html
Yammer Authentication
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<ul id="site_menu" class="nav nav-list"></ul>
<script type="text/javascript" data-app-id="ABCDEFGHIJKlmnopqrstuv" src="https://assets.yammer.com/platform/yam.js"></script>
<script src="/tanzanite/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
@drucko
drucko / gist:4117581
Created November 20, 2012 12:11 — forked from drewtang/gist:1477180
Yammer Connect Example
yam.connect.loginButton('#yammer-login', function (resp) {
if (resp.authResponse) {
yam.request({
url: '/api/v1/users/current',
type: 'GET',
success: function (msg) {
document.write('<IMG SRC="' + msg.mugshot_url + '">' + '<h3>Welcome Back ' + msg.full_name + '!</h3>');
},
error: function (msg) { alert('Data Not Saved: ' + msg); }
});
@drucko
drucko / fabfile.py
Created November 26, 2012 19:29 — forked from onyxfish/fabfile.py
Fabric configuration for advanced mapping w/ TileMill and invar
import os
import re
from fabric.api import *
import yaml
"""
Base configuration
"""
# Ubuntu
@drucko
drucko / gist:4421243
Created December 31, 2012 16:56 — forked from pindia/gist:3166678

Step by step from jQuery to Agility.js

There's probably hundreds of Javascript MVC frameworks out there. But my favorite, Agility.js, seems to be barely ever mentioned. Agility has served me well in several projects both big and small, so I'm writing a tutorial in the spirit of Step by step from jQuery to Backbone for Agility.

What makes Agility different from other MVC frameworks? In short, the lack of boilerplate and the completeness. Other frameworks involve many, many lines of boilerplate that provide a significant barrier to entry and detract from the readability of the final product. Agility minimizes this, lets you get started fast, and stays out of your way. But it doesn't sacrifice either completeness or maintainability. Agility is feature-rich, including two-way model-view bindings, declarative controller-events, prototypical inheritance, server persistance, and everything else

############################## django-auth-ldap ##############################
import ldap
from django_auth_ldap.config import LDAPSearch, PosixGroupType
# django-auth-ldap configuration starts here
AUTH_LDAP_SERVER_URI = "ldap://ldap.els03.loc ldap://ldap.zbw03.loc ldap://ldap.cvg03.loc"
#AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,ou=People,o=loc"
# JW is in ou=Admin,o=loc so we search over o=loc to find him
AUTH_LDAP_USER_SEARCH = LDAPSearch("o=loc",