Browsing the blog archives for December, 2008.

Backup and Restore Postgres Database

technical

this compresses with zlib. restore does not take into account for roles, so you’ll need to define them if you plan to restore onto a different location. The restore also tries to define plpgsql which is already present in my situation. it is merely a warning so that is fine.

pg_dump -F c -b -D -f “mydb.sql” mydb

pg_restore -d mydb -F c mydb.sql

No Comments

Filming in 3D (The Bare Minimum)

3D

after a fruitless pursuit of a 3D lense adapter. I opted to get 2 budget camcorders and mount them side by side using a 30+ year old camera harness my dad had kicking around. Oddly enough, when I was spotted at the CES 07 with the rig, someone commented that they had the exact same harness.

No Comments

.net 2.0 + mono + ubuntu

technical

assumes apache2 installed via apt-get

apt-get install mono-apache-server2
apt-get install libapache2-mod-mono
a2enmod mod_mono
/etc/init.d/apache2 restart

edit the virtualhost file or httpd.conf file and add this to the end. In the case of virtualhost, for some reason this must reside outside of the tags.

        MonoPath default "/usr/lib/mono/2.0"
        MonoServerPath default /usr/bin/mod-mono-server2
        AddMonoApplications default "/:/var/www"
        <location>
                MonoSetServerAlias default
                SetHandler mono
        </location>

create a file called NumberService.asmx and place the following code:

<%@ WebService Language="C#" Class="MathService.MathService" %>

using System;
using System.Web.Services;

namespace MathService
{
	[WebService (Namespace = "http://mono.local/NumberService")]
	public class MathService : WebService
	{
		[WebMethod]
		public int AddNumbers (int number1, int number2)
		{
			return number1 + number2;
		}

		[WebMethod]
		public int SubtractNumbers (int number1, int number2)
		{
			return number1 - number2;
		}
	}
}
No Comments

Mac Server 10.5 + Postgres + PHP

technical

install postgres from binary distribution (enterprisedb packaged)
install apache2
install php5

tar -xvf php-5.2.6.tar.gz
cd php-5.2.6
./configure –with-pgsql=/Library/PostgreSQL/8.3 –with-apxs2
make
cp libs/libphp5.so /usr/libexec/apache2
cd /usr/sbin
cp httpd httpd.original
lipo httpd -thin i386 -output
apachectl configtest
apachectl graceful

No Comments