Skip to content

Instantly share code, notes, and snippets.

@next-marianmoldovan
next-marianmoldovan / pipelines.py
Last active December 3, 2022 12:42
JSON UTF-8 Pipeline Scrapy
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)
@jdeniau
jdeniau / 1-virtualenv.sh
Last active April 19, 2017 18:02
Install Graphite in a virtualenv (python2.7) with apache and StatsD (Debian Squeeze)
# 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/
@alobato
alobato / start-stop-example.sh
Created March 3, 2012 23:09
start-stop-example
#!/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