Skip to content

Instantly share code, notes, and snippets.

View macagua's full-sized avatar
🏠
Working from home

Leonardo J. Caballero G. macagua

🏠
Working from home
View GitHub Profile
@macagua
macagua / GourceGravatarExample.py
Created June 20, 2014 04:20
Python Gravatar Example for Gource software
# -*- coding: utf-8 -*-
#fetch Gravatars
# https://code.google.com/p/gource/wiki/GravatarExample
import os
import requests
import subprocess
import hashlib
@macagua
macagua / fixblobs.py
Created August 25, 2014 23:09
A Zope command line script to delete content with missing BLOB in Plone
"""
A Zope command line script to delete content with missing BLOB in Plone, causing
POSKeyErrors when content is being accessed or during portal_catalog rebuild.
Tested on Plone 4.1 + Dexterity 1.1.
http://stackoverflow.com/questions/8655675/cleaning-up-poskeyerror-no-blob-file-content-from-plone-site
Also see:
@macagua
macagua / rsync-backup.sh
Created August 26, 2014 14:33
A rsync backup script
#!/bin/bash
# Source URL: http://www.plone-entwicklerhandbuch.de/plone-entwicklerhandbuch/produktivserver/backup-der-zodb/rsync-backup.sh/view
# SOURCES and TARGET must end with slash
SOURCES="/home/plone/plone41_buildout/backups/backup_*"
SOURCES="${SOURCES} /home/plone/plone41_buildout/var/blobbackup*/*.0/"
TARGET="/backups/plone/plone41_buildout/"
MOUNTPOINT="/backups/"
LOGFILE="/home/plone/plone41_buildout/var/log/backup_plone41.log"
@macagua
macagua / buildout.cfg
Last active August 29, 2015 14:11
SVN Pre commit Hook for Quality Assurance Plone buildout configuration
[buildout]
extensions =
# A zc.buildout extension to ease the development of large projects with lots of packages.
# For options see http://pypi.python.org/pypi/mr.developer
mr.developer
extends =
https://raw.github.com/collective/buildout.plonetest/master/qa.cfg
http://dist.plone.org/release/4.3-latest/versions.cfg
@macagua
macagua / buildout.cfg
Last active August 29, 2015 14:11
Event Log, Verbose and Debug mode for Plone buildout configuration
[buildout]
extends = http://dist.plone.org/release/4.3-latest/versions.cfg
find-links =
http://dist.plone.org/release/4.3-latest/
http://dist.plone.org/thirdparty/
show-picked-versions = true
eggs =
unzip = true
versions = versions
@macagua
macagua / buildout.cfg
Last active August 29, 2015 14:11
Quality Assurance Plone buildout configuration
[buildout]
extends =
https://raw.github.com/collective/buildout.plonetest/master/qa.cfg
[code-analysis]
directory = ${buildout:directory}/src/
pre-commit-hook = True
flake8-ignore = E501
clean-lines = True
deprecated-aliases = True
@macagua
macagua / buildout.cfg
Created December 21, 2014 18:53
Omelette recipe for Plone
[buildout]
extends = http://dist.plone.org/release/4.3-latest/versions.cfg
find-links =
http://dist.plone.org/release/4.3-latest/
http://dist.plone.org/thirdparty/
show-picked-versions = true
eggs =
unzip = true
versions = versions
@macagua
macagua / buildout.cfg
Created December 21, 2014 18:59
IPython for Zope / Plone
[buildout]
extends = http://dist.plone.org/release/4.3-latest/versions.cfg
find-links =
http://dist.plone.org/release/4.3-latest/
http://dist.plone.org/thirdparty/
show-picked-versions = true
eggs =
unzip = true
versions = versions
@macagua
macagua / svn-ignore.txt
Created December 22, 2014 19:55
SVN ignore file for Plone projects
*~
*.pyc
*.pyo
*.tmp*
*.mo
*.egg
*.EGG
*.egg-info
*.EGG-INFO
*.kpf
@macagua
macagua / utils.py
Created May 29, 2015 11:42
Hello world like Plone guy
# Source https://plus.google.com/102636120635048200626/posts/HMk2yNfysQN
from Products.statusmessages.interfaces import IStatusMessage
IStatusMessage(self.request).addStatusMessage('Hello World', type='info')