-
Install redis on OSX (10.7) Lion I used:
$ brew install redis
-
In the project and virtualenv I wanted to use django-celery in I installed the following.
This file contains 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
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( |
This file contains 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
# UpYun storage for django, written by Tyr Chen @ tukeq.com | |
# to run this gist you need to get upyun python sdk first. | |
# upyun storage | |
class UpYunStorage(Storage): | |
def __init__(self, bucket=settings.UPYUN_BUCKET): | |
self.upyun = UpYun(bucket, settings.UPYUN_USERNAME, settings.UPYUN_PASSWORD) | |
self.upyun.setApiDomain(settings.UPYUN_API_DOMAIN) | |
self.binding_domain = settings.UPYUN_BINDING_DOMAIN |
Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
This file contains 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
// Set up a collection to contain player information. On the server, | |
// it is backed by a MongoDB collection named "players". | |
Players = new Meteor.Collection("players"); | |
if (Meteor.isClient) { | |
Template.leaderboard.players = function () { | |
return Players.find({}, {sort: {score: -1, name: 1}}); | |
}; | |
Template.leaderboard.selected_name = function () { | |
var player = Players.findOne(Session.get("selected_player")); | |
return player && player.name; |
This file contains 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/bash | |
# | |
# MongoDB Backup Script | |
# VER. 0.1 | |
# Note, this is a lobotomized port of AutoMySQLBackup | |
# (http://sourceforge.net/projects/automysqlbackup/) for use with | |
# MongoDB. | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
This file contains 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
ssh [email protected] "bash -s -x" -- <ixgbevf-upgrade.sh |
This file contains 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/bash | |
usage () | |
{ | |
cat <<UsageHERE | |
boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host | |
Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT | |
or boot2docker-fwd -d RULE_NAME | |
or boot2docker-fwd -l | |
or boot2docker-fwd -A |
OlderNewer