Skip to content

Instantly share code, notes, and snippets.

View kcleong's full-sized avatar

Kim Chee Leong kcleong

  • Python United, Turftorr
  • The Netherlands, Groningen
View GitHub Profile
(Pdb) from plone import api
(Pdb) api.group
*** AttributeError: 'module' object has no attribute 'group'
(Pdb) from plone.api import group
(Pdb) api.group
<module 'plone.api.group' from '/Users/me/Projects/buildout-plone-api/src/plone/api/group.pyc'>
@kcleong
kcleong / mediaqueries.css
Created October 7, 2012 09:44
Responsive stylesheet for Plone
/* For devices with narrow screens, phones, tablets, etc. */
/* support these sizes: 320,480, 600, 768, 1024, 1200 Ethan Marcotte */
/* * 1. 1625px and above huge screens * */
/* * 2. 1301px and above huge screens * */
/* * 3. 1025px to 1300px * */
/* * 4. 769px to 1024px * */
/* * 5. 601px to 768px * */
/* * 6. 600px and below * */
/* * 7. 481px to 600px * */
/* * 8. 480px wide and below * */
npm ERR! [email protected] postinstall: `tsd install`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'tsd install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the zone.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsd install
npm ERR! You can get information on how to open an issue for this project with:
# Confug for /etc/apache2/mods-available/proxy_html.conf
# Here's the declaration for W3C HTML 4.01 and XHTML 1.0
ProxyHTMLLinks a href
ProxyHTMLLinks area href
ProxyHTMLLinks link href
ProxyHTMLLinks img src longdesc usemap
ProxyHTMLLinks object classid codebase data usemap
ProxyHTMLLinks q cite
ProxyHTMLLinks blockquote cite
<div class='row' id='babel-edit'
xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en"
lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="plone.app.multilingual"
tal:define="pamutils context/@@babel_utils;">

Plone performance metrics

This gist describes how-to install and use zperfmetrics_. The zperfmetrics module uses statd and graphite. The easiest way to set-up statd and graphite is to use a docker image. First install Docker compose_, then use Kitematic to install the graphite-statsd_ Docker image. After installing the image the 'Graphite dashboard' can be opened in Kitematic by clicking on the web review option.

Next configure buildout, I used a separate buildout-perf.cfg which extends from the

DELETE plone
PUT plone
POST plone/_close
PUT plone/_settings
{
"settings": {
"analysis": {
"filter": {
"dutch_stop": {
@kcleong
kcleong / es_dutch.json
Created February 2, 2018 14:41
Dutch language analyzer in Elasticsearch
PUT ham
{
"mappings": {
"doc": {
"properties": {
"created": {
"type": "date"
},
"title": {
@kcleong
kcleong / edit.py
Created April 25, 2018 08:53
Dexterity edit form which disables constraint checks for certain fields
"""
Dexterity edit form which disables constraint checks for certain fields
use at your own risk as the error handling is manipulated!
configure.zcml:
<browser:page
for="plone.dexterity.interfaces.IDexterityContent"
layer="plone.addon.interfaces.IPloneAddonLayer"
# Uninstall old NRPE (v 2.15)
apt remove -y nagios-nrpe-server
# Install NRPE 3.2.1 in /usr/local/nagios
apt install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget
cd /tmp
wget --no-check-certificate -O nrpe.tar.gz https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.2.1.tar.gz
tar xzf nrpe.tar.gz