Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
# FEATURES
# - Doesn't show the sink that is already the default
# - Automatically switches all running input sinks when switching the default sink
# Get the current default sink
SINK_DEFAULT=$(pactl info | ag "Default Sink" | ag -o "(?!.*:)[^\s].*")
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(