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
import json, io, codecs, os | |
from scrapy.xlib.pydispatch import dispatcher | |
from scrapy import signals | |
class BeevaPipeline(object): | |
def __init__(self): | |
dispatcher.connect(self.spider_opened, signals.spider_opened) | |
dispatcher.connect(self.spider_closed, signals.spider_closed) |
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
# create the virtualenv and work on it | |
mkvirtualenv graphite | |
workon graphite | |
cd $VIRTUAL_ENV # we are now in /home/envs/graphite/ . If you are not, you may have a problem with your virtualenv | |
# apparently you have to make a symlink because cairo does not work with python 2.7 and pip | |
# my cairo module was located on /usr/lib/pymodules/python2.7/cairo Check this path, it may change on your server. | |
# You can execute `locate cairo` to find out. | |
# if this step does not work, you will not have any graphics in graphite later | |
ln -s /usr/lib/pymodules/python2.7/cairo ./lib/python2.7/ |
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 | |
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
set -e | |
# Must be a valid filename | |
NAME=foo | |
PIDFILE=/var/run/$NAME.pid | |
#This is the command to be run, give the full pathname | |
DAEMON=/usr/local/bin/bar |