Skip to content

Instantly share code, notes, and snippets.

View joshbeitelspacher's full-sized avatar

Josh Beitelspacher joshbeitelspacher

View GitHub Profile
@joshbeitelspacher
joshbeitelspacher / redmine-to-ldap.rb
Created December 9, 2011 06:48
A script to copy Redmine users and groups from a Postgres DB to LDAP. Requires a minor modification to Redmine to use SSH passwords.
#!/usr/bin/ruby1.8 -rubygems
require "base64"
require "net/ldap"
require "pg"
require "set"
class User
attr_reader :login
attr_reader :firstname
@joshbeitelspacher
joshbeitelspacher / post-receive
Created March 14, 2011 05:06
A Git post-receive hook for deploying files from a branch to a configurable location after every push.
#!/bin/bash
#
# A Git post-receive hook to deploy content from a Git repository on every
# push into a repository. The branches that should be automatically deployed
# must be listed in the config file of the Git repository. The simplest possible
# configuration is shown below:
#
# [deploy "refs/heads/master"]
# directory = /var/www/site
#