# Emil HaukelandMostly for myself, but maybe something useful for you too?

27Apr/10

## Why you can’t work at work

With its constant commotion, unnecessary meetings, and infuriating wastes of time, the modern workplace makes us all work longer, less focused hours. Jason Fried explains how we can change all of this.

17Apr/10

## URL rewriting for wordpress and lighttpd

Please note: Since I managed to lose my original database-file for this blog I have tried to recreate this post since quite a few of you found it useful.

In your lighttpd.conf or 10-rewrite.conf enable mod_rewrite and then paste the following code (you will need to edit the $HTTP["host"] though): $HTTP["host"] =~ "emil.haukeland.name" { url.rewrite-final = (   # Exclude some directories from rewriting "^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)" => "$0", # Exclude .php files at root from rewriting "^/(.*.php)" => "$0",   # Handle permalinks and feeds "^/(.*)$" => "/index.php/$1" ) }

These three rules should cover for every plugin and functionality. If you have other folders which you will need to access without any redirection (images in a separate folder etc), you have to add this to the first rule.

Now change the setting in Options->Permalinks to Custom and create your permalink structure. Personally I prefer this:
http://emil.haukeland.name/%category%/%year%/%postname%/

10Apr/10

## How to extend a table column size

While this post is trying to explain how to extend the description for Change Orders, this method can be used to extend just about any database-column for CA SDM. The SDM I change in this post is running on Windows servers, but it should be little or no difference if you're running any other supported platform.

Order Description contains 5184 characters, but its maximum size is 4000

As you see we cannot save this post due to limitation of the Order Description column.

Note that the String Length is only capable of storing 4000 characters

This limitation is not set on the web-page, but in the Change_Request description column. You can review yout current String Length by starting Web Screen Painter and click the Schema Designer button. To the right is a screenshot of the default setting - limiting String Length to 4000 characters.

In order to change this column we need to create a sch-file. This will contain a syntax which tells pdm_configure to extend the database column.

pdm_configure will try to read and perform all actions on all sch-files located in:

"drive:\path\to\CA\Service Desk\site\mods\"

How you choose to organize your sch-files are entierly up to you, but for this example I'll create a file called"zChangeRequest.sch" because I like to keep changes on a "per table"-basis.

To extend the description column size; type or paste the following line into your sch-file and save:

// Extend the description column in the Change_Request // table to hold up to 25000 characters TABLE Change_Request {description STRING 25000;}

As I assume you have already guessed, we need to run pdm_configure to apply our changes to the database. NOTE: Remember to stop your SDM prior to running pdm_configure.

Note that the String Length has been extended to 25000 characters

When pdm_configure has done it's work we can fire up SDM again and check our changes. Lets start the Web Screen Painter again and click on the Schema Designer-button. You chould see that the String Length property has been set according to your wishes.

At last we do need to test our changes on the website:

Save successful. Hooray!

9Apr/10

## New blog from scratch…

Crap. I actually managed to lose my SQL-file somewhere while moving to a new server.

Guess this is a new beginning...