Useful configuration

Making preformatted text not wrap, add this config option. This saves having to change other stylesheets or depend on user CSS.

    html_head = """<style type="text/css">pre { white-space: pre !important; word-wrap: normal !important; }</style>"""

Textchas, backwards:

class FarmConfig(DefaultConfig):
    textchaQuestions = { }
    for i in range(10,99):
        textchaQuestions["Please enter this number backwards: %d"%i] = \
            '%02d'%(i//10 + (i%10)*10)
    textchas = {'en': textchaQuestions}

Delete spam user accounts:

rsync -a user/ user-backup/
(cd user ; grep ^name * ) > delusers
emacs delusers
sed -r 's/([^:]+):.*/\1/' delusers | ( cd user ; xargs rm )

Delete non-real pages (created when someone started to edit, but never actually saved it. MAYBE this would delete deleted pages, too...):

find pages/ -mindepth 1 -maxdepth 1 -not -exec stat {}/current --printf "" \; -print -exec rm -r {} \;

Backup via rsync

look at DebianNotes/SSH for key info for rsync

sudo rsync --rsh="ssh -i $HOME/.ssh/rsync-deleuze-lefschetz.key" /var/local/lib/moin/data/ -rltivz --exclude 'pages/BadContent/***' --exclude 'user/***' --exclude /edit-log --exclude /event-log --exclude '/cache/***'

Wiki config you should set to do the backuping:

class Config(FarmConfig):
    data_dir = '/srv/wiki-data/hcoop-data/'
    sitename = u'HCoop Wiki READ ONLY BACKUP'
    page_front_page = u"WelcomePage"   # If it's different
    acl_rights_before = u'-All:write,admin,delete,revert'

    page_header2 = u"""<div style="border:yellow; border-style:dotted; padding:0.5em; background-color:#FFFFCC;">This is BACKUP to the <a href="">HCoop wiki</a>.  You shouldn't be able to edit anything here, but if somehow you can and do, it won't be saved!</div>"""


Specific installs on my computers


This describes the MoinMoin implementation which I use on lefschetz, and in particular how to upgrade them. Note that this upgrade is only for post-1.5.3 upgrades. This isn't for user documentation.

All main files are installed as root:

python install --prefix /usr/local/moin/

You might want to delete /usr/local/moin/lib/python2.4/site-packages/MoinMoin, since in the past there was a module name conflict.

So then to upgrade, change dir to /srv/www/moin/ and

PYTHONPATH=/usr/local/moin/lib/python2.4/site-packages/:. /usr/local/moin/bin/moin migration data

explanation: the .../moin it uses the from $PWD, and you tell it the URL to upgrade, and it finds the datadir automatically and goes and does whatever upgrades it needs.

DebianNotes/Moin (last edited 2010-03-03 01:19:34 by RichardDarst)