This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Session(web.session.Session): | |
def _setcookie(self, session_id, expires='', **kw): | |
if expires == '': | |
expires = self._config.timeout | |
super(Session, self)._setcookie(session_id, expires, **kw) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample def block with mako | |
<%def name="artist_summary(label, img1, img2, *klass)" | |
cached="True" cache_timeout="300"> | |
<div id="${label}" class="artist-column ${' '.join(klass)}"> | |
<img src="/static/img/${img1}"/> | |
</div> | |
<script type="text/javascript"> | |
$$("#${label} img").invoke('observe', 'mouseover', function(ev) { | |
ev.element().setAttribute('src', "/static/img/${img2}"); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
# Parse access log from a virtual host and output 404 requests. | |
# Logfile is $LOGDIR/host1.domain.tld/access.log for example. | |
# If you want this report by mail, set a crontab: | |
# | |
# 0 22 * * * 404stats.sh | mail -s "404 report" [email protected] | |
# | |
#apache log directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Script to help customize iso ubuntu installer. | |
# | |
# script constants | |
# | |
UBUNTU_MIRROR="mirror.ovh.net/ftp.ubuntu.com/releases" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# - ssh-lookup - | |
# | |
# This script read configuration file for ssh client. Without argument it list | |
# all hosts entries in the file. With host as argument, it print the real address | |
# for this entry. | |
# | |
# $ ssh-lookup.sh | |
# host1.domain.tld |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ./command.sh help | |
# HELP MESSAGE | |
# ./command.sh first | |
# FIRST COMMAND | |
# | |
command_help() | |
{ | |
echo "HELP MESSAGE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" Render restructured text as html in a pygtk webkit view. | |
""" | |
import gobject | |
import gtk | |
import gtksourceview2 as gtksourceview | |
import io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#webpy with mako | |
class render_mako(object): | |
"""Rendering interface to Mako Templates. | |
Example: | |
render = render_mako( | |
directories=['templates'], | |
input_encoding='utf-8', |