Skip to content

Instantly share code, notes, and snippets.

View logic's full-sized avatar
:shipit:

Ed Marshall logic

:shipit:
View GitHub Profile
@logic
logic / hgwebdir-mongrel2.py
Created April 15, 2011 03:12
Simple wrapper for running hgwebdir under mongrel2
#!/usr/bin/env python
from m2wsgi.io.standard import WSGIHandler
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir
app = hgwebdir('/path/to/hgweb.config')
handler = WSGIHandler(app, "tcp://127.0.0.1:9999")
handler.serve()
#!/bin/sh
# Replacement for raw "ksu" in kerberized environments;
# behaves more like "su -", and retains xauth data.
if [ $# -lt 1 ]
then
echo "Usage: `basename $0` <target user> [ <command> [ <arg> ] ... ]"
exit 2
fi
# Append to /root/.bashrc
[ ! -d $HOME/.history ] && mkdir $HOME/.history
set -- `/usr/bin/who -m`
HISTFILE="$HOME/.history/`/bin/date +%Y-%m-%d.%T`.`/bin/hostname -s`.$$.$1"