Skip to content

Instantly share code, notes, and snippets.

@octaflop
octaflop / traceback
Created February 20, 2012 03:58
deluge traceback
19:58:13.154 [ERROR ][deluge.pluginmanagerbase :158 ] Unable to instantiate plugin 'Blocklist' from '/usr/local/lib/python2.7/dist-packages/deluge-1.3.900_dev-py2.7.egg/deluge/plugins/Blocklist-1.2-py2.7.egg'!
19:58:13.154 [ERROR ][deluge.pluginmanagerbase :1164] No module named init
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/deluge-1.3.900_dev-py2.7.egg/deluge/pluginmanagerbase.py", line 154, in enable_plugin
cls = entry_point.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1955, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/lib/python2.7/dist-packages/deluge-1.3.900_dev-py2.7.egg/deluge/plugins/Blocklist-1.2-py2.6.egg/deluge/plugins/blocklist/__init__.py", line 37, in <module>
ImportError: No module named init
@octaflop
octaflop / admin.py
Created February 10, 2012 05:27
Key error
# -*- coding:utf-8 -*-
from django import forms
from django.contrib import admin
from django.conf import settings
from django.forms.models import modelform_factory
from django.utils.translation import ugettext_lazy as _
import django.db.models
from categories.app import product_app
import pricing.models
@octaflop
octaflop / keyerror
Created February 10, 2012 02:08
KeyError at /products/apparel/womens-apparel/wet/+womens-wetsuit/
Environment:
Request Method: GET
Request URL: http://localhost:8000/products/apparel/womens-apparel/wet/+womens-wetsuit/
Django Version: 1.3.1
Python Version: 2.6.6
Installed Applications:
['localeurl',
@octaflop
octaflop / mdblock.sh
Created October 21, 2011 23:14
md0 block
ls -l /sys/block/md0/holders /sys/block/md0/*/holders
/sys/block/md0/holders:
total 0
/sys/block/md0/md0p1/holders:
total 0
lrwxrwxrwx 1 root root 0 2011-10-21 15:51 dm-1 -> ../../../dm-1
/dev/mapper/vhost-hostvol on / type ext4 (rw,errors=remount-ro)
@octaflop
octaflop / find_expires.py
Created September 8, 2011 17:42
A set of django management commands to find expired Members and send them a notification.
from memdir.models import Member
import datetime
from pprint import pprint
class Command(BaseCommand):
args = '<None>'
help = """Finds all the Members in the database with an expired entry and
tags them as expired. This command should be run right before the
send_notices command.
"""
@octaflop
octaflop / models.py
Created August 11, 2011 22:58
Excel Model Migration with PostgreSQL error
# models.py
from django.db import models
from django.db.utils import IntegrityError
from tinymce.models import HTMLField
import datetime
from django.contrib.auth.models import User, UserManager, Permission
import re
from django.utils.translation import ugettext as _
@octaflop
octaflop / forms.py
Created August 3, 2011 22:47 — forked from patrys/forms.py
satchless model example
from django import forms
from satchless.forms.widgets import DecimalInput
from satchless.product.forms import BaseVariantForm
from . import models
class ProductPriceForm(forms.ModelForm):
class Meta:
widgets = {
'price': DecimalInput(min_decimal_places=2),
@octaflop
octaflop / forms.py
Created August 3, 2011 22:11
satchless model example
from satchless.forms.widgets import DecimalInput
from satchless.product.forms import BaseVariantForm
from . import models
class ProductPriceForm(forms.ModelForm):
class Meta:
widgets = {
'price': DecimalInput(min_decimal_places=2),
}
faris@cortex:~/workspace/src$ git clone https://github.com/joyent/node.git
Initialized empty Git repository in /home/faris/workspace/src/node/.git/
remote: Counting objects: 36420, done.
remote: Compressing objects: 100% (9171/9171), done.
remote: Total 36420 (delta 29036), reused 33711 (delta 26768)
Receiving objects: 100% (36420/36420), 21.35 MiB | 2.00 MiB/s, done.
Resolving deltas: 100% (29036/29036), done.
faris@cortex:~/workspace/src$ cd node
faris@cortex:~/workspace/src/node$ ./configure --prefix=~/.node
bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
@octaflop
octaflop / admin.py
Created March 29, 2011 23:53
part of the models file for verebena
# the admin views
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from verbena.models import Student, Faculty, NewsRelease, Location, Project,\
VolunteerOpportunity, Organization, Workshop, ActionGroup, Grant
class StudentAdmin(UserAdmin):
list_display = ('studying','comp_year',)