Temporary use of fast PRNG

January 8th, 2009

rngd -f -r /dev/urandom

This sends the output from the fast-but-not-very-random PRNG as input into /dev/random. Useful when testing and speed is more important than security.

How to get at request in a template

December 18th, 2008

I needed to get at the request in a template which had been called ‘direct_to_template’. To make the request available, you need to modify the TEMPLATE_CONTEXT_PROCESSORS variable.

Add this to your settings file


TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.request',
)

Then you can use {{ request }}

Why won’t your browser install your cookie?

December 11th, 2008

It seems that browser refuse to install cookies for a TLD. So for example, if your local network is .internal, then you won’t be able to set a domain in a cookie for .internal. Add another layer into the domain e.g. .level2.internal, and the cookie will work fine.

How to fix “ViewDoesNotExist at /admin/”

December 9th, 2008

Common problem when migrating from 0.96 to 1.0…

  1. Add “django.contrib.admin” to INSTALLED_APPS
  2. Add “from django.contrib import admin” to urls.py
  3. Add “admin.autodiscover()” in urls.py
  4. Change line to (r’^admin/(.*)’, admin.site.root),

Link to relevant page in Django tutorial

OpenSSL / Apache links

December 9th, 2008

How to create a self-signed certificate

Apache’s mod_ssl HOWTO

Van’s Apache SSL/TLS mini-HOWTO

How to create a egg file from your ZenPack

December 2nd, 2008


cd
python setup.py bdist_egg

This creates the egg file in the dist directory.

Ref: Section 3.5 Zenoss Dev Guide (V2.3.0)

How to add a zProperty in your ZenPack

December 2nd, 2008

Define it in the class in __init__.py in the ZenPack’s home directory.

Ref: Section 3.4.1 “Base ZenPack Class” of the Zenoss Developers Guide. (V2.3)

Debugging ZenPacks: why isn’t an event being generated?

November 29th, 2008

Check the zenhub.log file to make sure that there isn’t a syntax error in the code

How to see the Software Inventory

November 27th, 2008

Install the HRSWInstalledMap.

How to add collectors to a device class

November 27th, 2008

In the device class, go More>Collector Plugins; or go to the zProperties screen, then click the edit button next to the zCollectorPlugins field.

To add a new collector, click the very faint “Add Fields” link and a box will pop up with all the available ones.