Skip to content

Instantly share code, notes, and snippets.

@pixline
pixline / guest-account.sh
Created October 14, 2013 20:30
/usr/sbin/guest-account script (debian version)
#!/bin/bash
# (C) 2008 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
# License: GPL v2 or later
# modified by David D Lowe and Thomas Detoux
# Debian 7 support by pixline <pixline@gmail.com>
# It NEEDS /bin/bash, dash won't work (sed issues).
#
# Setup user and temporary home directory for guest session.
@lalinsky
lalinsky / fp-find.py
Created July 22, 2011 18:02
Locate audio snippets in a longer stream
def format_time(secs):
return "%d:%02d" % (secs / 60, secs % 60)
def invert(arr):
"""
Make a dictionary that with the array elements as keys and
their positions positions as values.
>>> invert([3, 1, 3, 6])