Skip to content

Instantly share code, notes, and snippets.

View sp1thas's full-sized avatar

Panagiotis Simakis sp1thas

View GitHub Profile
@sp1thas
sp1thas / image-pipelines.py
Last active July 7, 2020 06:09
scrapy ImagePipeline: store images efficiently using folder tree structure
import os
from scrapy.pipelines.images import ImagesPipeline
class FolderStructureImagePipeline(ImagesPipeline):
"""Store Images using a folder tree structure.
DEPTH attribute can be used to specify the depth of the tree.
"""
DEPTH = 3
@sp1thas
sp1thas / cronicle.service
Created March 5, 2019 13:09
Cronicle Unit File
[Unit]
Description=Cronicle Service
After=network.target
[Service]
Restart=on-failure
Type=forking
ExecStart=/opt/cronicle/bin/control.sh start
ExecStop=/opt/cronicle/bin/control.sh stop
Restart=/opt/cronicle/bin/control.sh restart