For a customer I needed to have an old school custom Plone template not to be cashed. The site was put behind varnish and just adding “no-cache” headers did not work.
The solution was creating an extra rule in the “Cache Configuration Tool” (http://yourplonecms.com/portal_cache_settings/with-caching-proxy/rules), which allows for quite a lot of customization.
To the top of the existing rule set, add a copy of the plone-templates. In the rule under “Templates” add your template id and for the “Header Set for …” set both dropdowns to “Do not cache”. This should do the trick, at least it did for me.
This book has proven to be a great read. It is: easily written, focussed on web designers, has great regard for web standard and builds up nicely by showing all the steps and then sticking them together in a fictional case.
Based on semantic HTML and CSS the book shows you how to enhance the user experience with JavaScript without adding relevant content. As a web developer with python experiance but less knowledge of JavaScript this book quickly clarifies how to do things the right way.
Starting of with a brief history of JavaScript, followed by basic syntax explanation. It then gives an explanation of the DOM. Through a set of carefully explained examples of javaScript enhancements, like for example: an image gallery and folding of content based on a subnavigation, the book leads to putting it all together in a final example case.
After reading the book it will be easier to recognise the good JavaScript from the bad. The frequently used “copy/paste” code, becomes higher quality (if you take the trouble to read the code before “copy/pasting”). You also want to start writing scripts yourself because after the book JavaScript looks easy and fun.
While updating a plone 3.1.7 instance to 3.2.1 I all of the sudden had the following import error:
ImportError: No module named ImplPython
Searching the net I only found irrelevant solutions to my situation. I had an other plone 3.2.1 instance that used to work, so I checked if it would still run and it did. Creating a test instance of that buildout, once again didn’t work. Running a div between the two instance files showed 3 differences.
zope.component-3.5.1 was now zope.component-3.6.0
and two missing packages
zope.deferredimport
zope.deprecation
(both dependencies of zope.component-3.5.1)
Version pinning zope.component-3.5.1 in the buildout solved the import error.
[buildout]
versions = versions
[versions]
zope.component=3.5.1
Our office network has horrible download speeds, it is more efficient to zip a file before copying it. (No longer slow but still nice to not forget this)
rsync -avz --progress server:source target
On http://transcyberia.info/archives/39-customizing-navigation-in-Plone3.html I found a great article on how to subclass the navigation portlet. Explanations and all. This entry is based on that article but doesn’t have all the nice explanations.
For a generic plone 3 portlet with a template portlet.pt and a module named portlet.py, this is what you need to do to subclass it. I tend to create a portlets folder in my porducts, which you have to register in the same way as the browser folder from your theme is registered. Don’t forget the __init__.py and a configure.zcml!
Copy portlet.pt template from the source egg into your theme’s portlets/ directory. Don’t copy portlet.py, but instead create your own portlet.py. It needs only the following measly five lines of code:
from source.egg.portlet import Renderer
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
class MyPortletRenderer(Renderer):
render = ViewPageTemplateFile('portlet.pt')
In portlets/configure.zcml put the following lines:
<plone:portletRenderer
portlet="source.egg.portlet.IPortletInterface"
layer=".interfaces.IThemeSpecific"
/>
If, like in this example, the template in the renderer is called render (so render = ViewPageTemplateFile(‘portlet.pt’)) and not index or _template or something the like, you just use the template instead of creating a class for it in a special portlet.py. The subclassing also works with multiple templates or differently named ones.
<plone:portletRenderer
portlet="source.egg.portlet.IPortletInterface"
template="portlet.pt"
layer=".interfaces.IThemeSpecific"
/>
Setting up a host for a server in the ssh config and creating an ssh tunnel.
For this your would have to have access to a server. Open your ssh configuration in a text editor.
gedit ~/.ssh/config
Add the server specifications.
Host host
HostName path.to.server.com
User username
Create an ssh tunnel.
ssh host -L8080:127.0.0.1:8080
Now you can reach host as if it were 127.0.0.1 (localhost). “-L8080″ stands for your local host, “127.0.0.1:8080″ stands for what you are on the other side of the tunnel.
To close the tunnel.
exit
Case insensitivity for tabcompletion is something I have needed more often, this is how to do it. (found the solution on ubuntu forums, http://ubuntuforums.org/showthread.php?t=559596 )
Create or edit the file .inputrc and add the line:
set completion-ignore-case on
My coleague Jarno had the following tip originally as a comment.
You could also add the following to your .bashrc
bind 'set completion-ignore-case on'
Recent Comments