-
Create Ubuntu server instance under Parallels (obviously).
-
Start VM, goto Actions - Install Parallels Tools... to mount the ISO image.
-
From the terminal, run the following commands:
$ sudo su $ apt-get install gcc make $ mkdir -p /media/cdrom $ mount /dev/cdrom /media/cdrom
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
""" | |
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: |
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
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md | |
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192 | |
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB. | |
------------ | |
-- Basics -- | |
------------ | |
-- Get indexes of tables |
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
from AccessControl.SecurityManagement import newSecurityManager | |
from Acquisition import aq_inner | |
from Acquisition import aq_parent | |
from Products.CMFCore.utils import getToolByName | |
from Testing.makerequest import makerequest | |
from zope.component.hooks import setSite | |
import transaction | |
app = globals()['app'] | |
# we need to get a super user security and a request |
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
# ZODB recovery script that 'rebases' transactions onto an older copy of the same | |
# FileStorage. This is useful in the case where a FileStorage is lightly corrupted | |
# but that is not detected and it remains in production, garnering new transactions. | |
# | |
# The corruption in the storage may have prevented various transactions for completing | |
# and prevents packing or incremental backups, so backup taken before the corruption | |
# happened is used as a graft for the newer transactions. This only works if all | |
# the corruption happens to transactions covered by the backup, corruption that affects | |
# the transactions being appended is not recoverable in this fashion. | |
# |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Indeterminate Checkboxes</title> | |
</head> | |
<body> | |
<p>Vanilla/Plain Javascript Version of <a href="https://github.com/TheNotary/IndeterminateCheckboxes">TheNotary - Indeterminate Checkboxes</a></p> | |
<div id="containter"> |
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
// Array literal (= []) is faster than Array constructor (new Array()) | |
// http://jsperf.com/new-array-vs-literal/15 | |
var array = []; | |
// Object literal (={}) is faster than Object constructor (new Object()) | |
// http://jsperf.com/new-array-vs-literal/26 | |
var obj = {}; | |
// property === undefined is faster than hasOwnProperty(property) | |
// Note: don't use this in cases where 'undefined' is a possible value for your properties |
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
context = self.context.aq_parent | |
remove = ['Check for invalid objects....'] | |
catalog = getToolByName(context, 'portal_catalog') | |
for brain in catalog.unrestrictedSearchResults(): | |
# First get the new value | |
obj = brain._unrestrictedGetObject() | |
if obj is None: | |
if brain.UID in proovedItems: | |
try: | |
path = uuidToPhysicalPath(brain.UID) |
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
from StringIO import StringIO | |
from DateTime import DateTime | |
from plone.subrequest import subrequest | |
from urllib import unquote | |
from ho.pisa import pisaDocument | |
from pyPdf import PdfFileWriter, PdfFileReader | |
from Products.Five import BrowserView |
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
<xsl:template match="div[contains(@class, 'pfg-form')]//form"> | |
<form> | |
<xsl:copy-of select="attribute::*[not(name()='class')]" /> | |
<xsl:attribute name="class"> | |
<xsl:value-of select="@class" /> form-horizontal | |
<xsl:if test="@class[contains(., 'formid-formular-test')]"> form-test container</xsl:if></xsl:attribute> | |
<xsl:attribute name="id">pfg-form</xsl:attribute> | |
<xsl:apply-templates /> | |
</form> | |
</xsl:template> |
NewerOlder