Skip to content

Instantly share code, notes, and snippets.

@do3cc
do3cc / keybase.md
Last active August 29, 2015 14:09
keybase.md

-----BEGIN PGP MESSAGE----- Version: GnuPG v1

owF1kntQVFUcxxdIC6YSSCGQBG9jCax43w9kTBSE1BwjKgJqueeec5crsrvsA0ME RSWjUEHEEYQyaJxBHhaKCD7YQYYI0oApiKFleqKGQ2NI43OmexmaqJnOX+fx+X3P 93t+p+QpD52721BuSemdu492uvXdBLpE55ghFwNmmINF5mLSNgWZ7NrMJGYiLBLL QDlAtKEIxRxiMkMUsdUWMsvosWxktSlmk0rhEVwEheXpNVwrlhWTEVktVkXTwmQA GZoQJZIVRU4CJA1ljgC0RNKCQMgsLgoMwbI0oUqmm232f92KzWgaFKjuzvDrWTz6 H94xc4AIQWAgK0GZ4WiewYFE8TwhCwQnQZrDcQ20IetsJGimJEkzm4msGduQwWo2 zySW7Ip2TtAkIZCMQNCqHdGWrlZINJAEjqBknuQBLxJAEBEHKBxKnESKEEesBBBP

@do3cc
do3cc / gist:1179ebaa8de24247eb75
Created May 13, 2014 14:12
Repair CMFEditions quick and dirty
from Products.CMFEditions.ZVCStorageTool import Removed
zvc_repo = app.Plone2.portal_historiesstorage.zvc_repo
for shadow_history in app.Plone2.portal_historiesstorage._shadowStorage._storage.values():
for version in shadow_history._full.values():
if not 'referenced_data' in version:
continue
vc_info = version['vc_info']
zope_version = zvc_repo._histories[vc_info.history_id]._versions[vc_info.version_id]
if isinstance(Removed, zope_version._data._object):
del version['referenced_data']
@do3cc
do3cc / gist:11041989
Created April 18, 2014 12:38
Simple way to generate ssl certs without interactive questions
# When having multiple vhosts, and one of them listens to https,
# nginx will answer ssl requests for all of your vhosts, but with data
# from that one host that answers ssl. The browser will complain
# that the certificate is for the wrong site and you will receive
# the wrong site.
# With this simple self signed certificate, the user gets a warning
# for the untrusted certificate but at least gets the right site.
openssl req -x509 -newkey rsa:2048 -keyout lala.key -out lala.crt -days 3650 -nodes -subj "/C=de/CN=www.example.com"