OSX MacPorts install of postgres

June 23rd, 2009

Following their instructions to initialise the database, you get a complaing about /dev/null.

This is because the default postgres user is installed with a shell of /dev/null.

To change it, forget all the Unix stuff you know about administering users and do this


sudo dscl . -change /Users/postgres UserShell /dev/null /bin/sh

Or if you want to check first, check that the user exists

sudo dscl . -list /Users UniqueID

And then check the postgres user

sudo dscl . read /users/postgres

perl: warning: Setting locale failed.

June 11th, 2009

Needed to do this:


sudo locale-gen en_GB.UTF-8
sudo dpkg-reconfigure locales

ubuntu command line dist upgrade

June 9th, 2009

sudo apt-get install update-manager-core
sudo do-release-upgrade

subversion/ssl with client certs stopped working?

May 29th, 2009

There’s a bug in (at least some versions of) Ubuntu, which means the wrong library is being picked up.

https://bugs.launchpad.net/ubuntu/+source/subversion/+bug/294648

Workaround: LD_PRELOAD=/usr/lib/libneon.so.27 svn

checking for duplicates

May 8th, 2009

if for example, you want to apply a unique index, but you can’t because there’s duplicates in the table.

SELECT name FROM mytable GROUP BY name HAVING COUNT(*) > 1;

www.eBookPrice.Info

May 1st, 2009

new site…

make script executable

May 1st, 2009

svn propset svn:executable on

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.